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 #ifdef cpPlugins_OpenGL_BackEnd_OpenGL2
22 // Complete polydatas to avoid bizarre rendering errors (multi-thread)
24 a[ 0 ] = this->PolyDataActor;
25 a[ 1 ] = this->BackingPolyDataActor;
26 a[ 2 ] = this->BackgroundPolyDataActor;
27 for( unsigned int i = 0; i < 3; ++i )
32 dynamic_cast< vtkOpenGLPolyDataMapper* >( a[ i ]->GetMapper( ) );
35 auto p = m->GetInput( );
38 vtkNew< vtkCellArray > verts;
39 vtkNew< vtkCellArray > lines;
40 vtkNew< vtkCellArray > strips;
41 p->SetVerts( verts.Get( ) );
42 p->SetLines( lines.Get( ) );
43 p->SetStrips( strips.Get( ) );
55 #endif // cpPlugins_OpenGL_BackEnd_OpenGL2
58 // -------------------------------------------------------------------------
59 cpExtensions::Visualization::ImageSliceMapper::