| 36 | vtkStandardNewMacro(vtkOpenGLImageMapper); |
| 37 | |
| 38 | vtkOpenGLImageMapper::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 | |
| 75 | vtkOpenGLImageMapper::~vtkOpenGLImageMapper() |
| 76 | { |
nothing calls this directly
no test coverage detected