MCPcopy Create free account
hub / github.com/Kitware/VTK / vtkOpenGLImageMapper

Method vtkOpenGLImageMapper

Rendering/OpenGL2/vtkOpenGLImageMapper.cxx:38–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36vtkStandardNewMacro(vtkOpenGLImageMapper);
37
38vtkOpenGLImageMapper::vtkOpenGLImageMapper()
39{
40 this->Actor = vtkTexturedActor2D::New();
41 vtkNew<vtkPolyDataMapper2D> mapper;
42 vtkNew<vtkPolyData> polydata;
43 vtkNew<vtkPoints> points;
44 points->SetNumberOfPoints(4);
45 polydata->SetPoints(points);
46
47 vtkNew<vtkCellArray> tris;
48 tris->InsertNextCell(3);
49 tris->InsertCellPoint(0);
50 tris->InsertCellPoint(1);
51 tris->InsertCellPoint(2);
52 tris->InsertNextCell(3);
53 tris->InsertCellPoint(0);
54 tris->InsertCellPoint(2);
55 tris->InsertCellPoint(3);
56 polydata->SetPolys(tris);
57
58 vtkNew<vtkTrivialProducer> prod;
59 prod->SetOutput(polydata);
60
61 // Set some properties.
62 mapper->SetInputConnection(prod->GetOutputPort());
63 this->Actor->SetMapper(mapper);
64
65 vtkNew<vtkTexture> texture;
66 texture->RepeatOff();
67 this->Actor->SetTexture(texture);
68
69 vtkNew<vtkFloatArray> tcoords;
70 tcoords->SetNumberOfComponents(2);
71 tcoords->SetNumberOfTuples(4);
72 polydata->GetPointData()->SetTCoords(tcoords);
73}
74
75vtkOpenGLImageMapper::~vtkOpenGLImageMapper()
76{

Callers

nothing calls this directly

Calls 15

InsertCellPointMethod · 0.80
SetPolysMethod · 0.80
NewFunction · 0.50
SetNumberOfPointsMethod · 0.45
SetPointsMethod · 0.45
InsertNextCellMethod · 0.45
SetOutputMethod · 0.45
SetInputConnectionMethod · 0.45
GetOutputPortMethod · 0.45
SetMapperMethod · 0.45
SetTextureMethod · 0.45
SetNumberOfComponentsMethod · 0.45

Tested by

no test coverage detected