Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

vtkUnstructuredGridMapper Class Reference

#include <vtkUnstructuredGridMapper.h>

List of all members.

Public Member Functions

 vtkTypeRevisionMacro (vtkUnstructuredGridMapper, vtkMapper)
void PrintSelf (ostream &os, vtkIndent indent)
void Render (vtkRenderer *ren, vtkActor *act)
 vtkGetObjectMacro (PolyDataMapper, vtkPolyDataMapper)
void ReleaseGraphicsResources (vtkWindow *)
unsigned long GetMTime ()
void SetInput (vtkUnstructuredGrid *input)
vtkUnstructuredGrid * GetInput ()
void SetBoundingObject (mitk::BoundingObject *bo)

Static Public Member Functions

static vtkUnstructuredGridMapperNew ()

Protected Member Functions

 vtkUnstructuredGridMapper ()
 ~vtkUnstructuredGridMapper ()
virtual void ReportReferences (vtkGarbageCollector *)
virtual int FillInputPortInformation (int port, vtkInformation *info)

Protected Attributes

vtkGeometryFilter * GeometryExtractor
vtkPolyDataMapper * PolyDataMapper
mitk::BoundingObject::Pointer m_BoundingObject

Detailed Description

Definition at line 31 of file vtkUnstructuredGridMapper.h.


Constructor & Destructor Documentation

vtkUnstructuredGridMapper::vtkUnstructuredGridMapper (  ) [protected]

Definition at line 32 of file vtkUnstructuredGridMapper.cpp.

References GeometryExtractor, and PolyDataMapper.

{
  this->GeometryExtractor = 0;
  this->PolyDataMapper = 0;
}
vtkUnstructuredGridMapper::~vtkUnstructuredGridMapper (  ) [protected]

Definition at line 39 of file vtkUnstructuredGridMapper.cpp.

References GeometryExtractor, and PolyDataMapper.

{
  // delete internally created objects.
  if ( this->GeometryExtractor )
    {
    this->GeometryExtractor->Delete();
    }
  if ( this->PolyDataMapper )
    {
    this->PolyDataMapper->Delete();
    }
  
}

Member Function Documentation

virtual int vtkUnstructuredGridMapper::FillInputPortInformation ( int  port,
vtkInformation *  info 
) [protected, virtual]
vtkUnstructuredGrid * vtkUnstructuredGridMapper::GetInput ( void   )

Definition at line 73 of file vtkUnstructuredGridMapper.cpp.

Referenced by Render().

{
  //return this->Superclass::GetInputAsDataSet();
  return vtkUnstructuredGrid::SafeDownCast(
      this->GetExecutive()->GetInputData(0, 0));
}
unsigned long vtkUnstructuredGridMapper::GetMTime (  )

Definition at line 199 of file vtkUnstructuredGridMapper.cpp.

{
  unsigned long mTime=this->vtkMapper::GetMTime();
  unsigned long time;

  if ( this->LookupTable != NULL )
    {
    time = this->LookupTable->GetMTime();
    mTime = ( time > mTime ? time : mTime );
    }

  return mTime;
}
static vtkUnstructuredGridMapper* vtkUnstructuredGridMapper::New (  ) [static]
void vtkUnstructuredGridMapper::PrintSelf ( ostream &  os,
vtkIndent  indent 
)

Definition at line 175 of file vtkUnstructuredGridMapper.cpp.

References GeometryExtractor, and PolyDataMapper.

{
  this->Superclass::PrintSelf(os,indent);

  if ( this->PolyDataMapper )
    {
    os << indent << "Poly Mapper: (" << this->PolyDataMapper << ")\n";
    }
  else
    {
    os << indent << "Poly Mapper: (none)\n";
    }

  if ( this->GeometryExtractor )
    {
    os << indent << "Geometry Extractor: (" << this->GeometryExtractor << ")\n";
    }
  else
    {
    os << indent << "Geometry Extractor: (none)\n";
    }
}
void vtkUnstructuredGridMapper::ReleaseGraphicsResources ( vtkWindow *  renWin )

Definition at line 81 of file vtkUnstructuredGridMapper.cpp.

References PolyDataMapper.

{
  if (this->PolyDataMapper)
    {
    this->PolyDataMapper->ReleaseGraphicsResources( renWin );
    }
}
void vtkUnstructuredGridMapper::Render ( vtkRenderer *  ren,
vtkActor *  act 
)

Definition at line 92 of file vtkUnstructuredGridMapper.cpp.

References GeometryExtractor, GetInput(), m_BoundingObject, New(), and PolyDataMapper.

{
  // make sure that we've been properly initialized
  //
  if ( !this->GetInput() )
    {
    vtkErrorMacro(<< "No input!\n");
    return;
    } 

  // Need a lookup table
  //
  if ( this->LookupTable == 0 )
    {
    this->CreateDefaultLookupTable();
    }
  this->LookupTable->Build();

  // Now can create appropriate mapper
  //
  if ( this->PolyDataMapper == 0 ) 
    {
    vtkGeometryFilter *gf = vtkGeometryFilter::New();
    vtkPolyDataMapper *pm = vtkPolyDataMapper::New();
    pm->SetInput(gf->GetOutput());

    this->GeometryExtractor = gf;
    this->PolyDataMapper = pm;
    }

  // share clipping planes with the PolyDataMapper
  //
  if (this->ClippingPlanes != this->PolyDataMapper->GetClippingPlanes()) 
    {
    this->PolyDataMapper->SetClippingPlanes(this->ClippingPlanes);
    }
  
  if (this->m_BoundingObject)
  {
    mitk::BoundingBox::BoundsArrayType bounds = this->m_BoundingObject->GetGeometry()->CalculateBoundingBoxRelativeToTransform(0)->GetBounds();
    this->GeometryExtractor->SetExtent(bounds[0], bounds[1], bounds[2], 
        bounds[3], bounds[4], bounds[5]);
    this->GeometryExtractor->ExtentClippingOn();
  }
  else
  {
    this->GeometryExtractor->ExtentClippingOff();
  }

  this->GeometryExtractor->SetInput(this->GetInput());
  this->PolyDataMapper->SetInput(this->GeometryExtractor->GetOutput());
  
  // update ourselves in case something has changed
  this->PolyDataMapper->SetLookupTable(this->GetLookupTable());
  this->PolyDataMapper->SetScalarVisibility(this->GetScalarVisibility());
  this->PolyDataMapper->SetUseLookupTableScalarRange(
    this->GetUseLookupTableScalarRange());
  this->PolyDataMapper->SetScalarRange(this->GetScalarRange());
  this->PolyDataMapper->SetImmediateModeRendering(
    this->GetImmediateModeRendering());
  this->PolyDataMapper->SetColorMode(this->GetColorMode());
  this->PolyDataMapper->SetInterpolateScalarsBeforeMapping(
                               this->GetInterpolateScalarsBeforeMapping());

  this->PolyDataMapper->SetScalarMode(this->GetScalarMode());
  if ( this->ScalarMode == VTK_SCALAR_MODE_USE_POINT_FIELD_DATA ||
       this->ScalarMode == VTK_SCALAR_MODE_USE_CELL_FIELD_DATA )
    {
    if ( this->ArrayAccessMode == VTK_GET_ARRAY_BY_ID )
      {
      this->PolyDataMapper->ColorByArrayComponent(this->ArrayId,ArrayComponent);
      }
    else
      {
      this->PolyDataMapper->ColorByArrayComponent(this->ArrayName,ArrayComponent);
      }
    }
  
  this->PolyDataMapper->Render(ren,act);
  this->TimeToDraw = this->PolyDataMapper->GetTimeToDraw();
}
void vtkUnstructuredGridMapper::ReportReferences ( vtkGarbageCollector *  collector ) [protected, virtual]

Definition at line 222 of file vtkUnstructuredGridMapper.cpp.

References GeometryExtractor, and PolyDataMapper.

{
  this->Superclass::ReportReferences(collector);
  // These filters share our input and are therefore involved in a
  // reference loop.
  vtkGarbageCollectorReport(collector, this->GeometryExtractor,
                            "GeometryExtractor");
  vtkGarbageCollectorReport(collector, this->PolyDataMapper,
                            "PolyDataMapper");
}
void vtkUnstructuredGridMapper::SetBoundingObject ( mitk::BoundingObject bo )

Definition at line 53 of file vtkUnstructuredGridMapper.cpp.

References m_BoundingObject.

{
  m_BoundingObject = bo;
}
void vtkUnstructuredGridMapper::SetInput ( vtkUnstructuredGrid *  input )

Definition at line 59 of file vtkUnstructuredGridMapper.cpp.

{
  if(input)
    {
    this->SetInputConnection(0, input->GetProducerPort());
    }
  else
    {
    // Setting a NULL input removes the connection.
    this->SetInputConnection(0, 0);
    }
}
vtkUnstructuredGridMapper::vtkGetObjectMacro ( PolyDataMapper  ,
vtkPolyDataMapper   
)
vtkUnstructuredGridMapper::vtkTypeRevisionMacro ( vtkUnstructuredGridMapper  ,
vtkMapper   
)

Member Data Documentation

vtkGeometryFilter* vtkUnstructuredGridMapper::GeometryExtractor [protected]

Definition at line 67 of file vtkUnstructuredGridMapper.h.

Referenced by Render(), and SetBoundingObject().

vtkPolyDataMapper* vtkUnstructuredGridMapper::PolyDataMapper [protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines