1 #include <cpExtensions/Visualization/ImageSliceMapper.h>
3 #include <vtkCellArray.h>
5 #include <vtkOpenGLPolyDataMapper.h>
6 #include <vtkPolyData.h>
8 // -------------------------------------------------------------------------
9 cpExtensions::Visualization::ImageSliceMapper::
10 Self* cpExtensions::Visualization::ImageSliceMapper::
13 return( new Self( ) );
16 // -------------------------------------------------------------------------
17 cpExtensions::Visualization::ImageSliceMapper::
21 // Complete polydatas to avoid bizarre rendering errors (multi-thread)
23 a[ 0 ] = this->PolyDataActor;
24 a[ 1 ] = this->BackingPolyDataActor;
25 a[ 2 ] = this->BackgroundPolyDataActor;
26 for( unsigned int i = 0; i < 3; ++i )
31 dynamic_cast< vtkOpenGLPolyDataMapper* >( a[ i ]->GetMapper( ) );
34 auto p = m->GetInput( );
37 vtkNew< vtkCellArray > verts;
38 vtkNew< vtkCellArray > lines;
39 vtkNew< vtkCellArray > strips;
40 p->SetVerts( verts.Get( ) );
41 p->SetLines( lines.Get( ) );
42 p->SetStrips( strips.Get( ) );
56 // -------------------------------------------------------------------------
57 cpExtensions::Visualization::ImageSliceMapper::