MCPcopy Create free account
hub / github.com/MITK/MITK / CreateRectangle

Method CreateRectangle

Modules/Core/src/Rendering/vtkMitkRectangleProp.cpp:89–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void vtkMitkRectangleProp::CreateRectangle()
90{
91 auto points = m_PolyData->GetPoints();
92 auto lines = m_PolyData->GetLines();
93
94 m_BottomLeft = points->InsertNextPoint(0.0f, 0.0f, 0.0f);
95 m_BottomRight = points->InsertNextPoint(1.0f, 0.0f, 0.0f);
96 m_TopRight = points->InsertNextPoint(1.0f, 1.0f, 0.0f);
97 m_TopLeft = points->InsertNextPoint(0.0f, 1.0f, 0.0f);
98
99 auto line = vtkSmartPointer<vtkLine>::New();
100 line->GetPointIds()->SetId(0, m_BottomLeft);
101 line->GetPointIds()->SetId(1, m_BottomRight);
102 lines->InsertNextCell(line);
103
104 line = vtkSmartPointer<vtkLine>::New();
105 line->GetPointIds()->SetId(0, m_BottomRight);
106 line->GetPointIds()->SetId(1, m_TopRight);
107 lines->InsertNextCell(line);
108
109 line = vtkSmartPointer<vtkLine>::New();
110 line->GetPointIds()->SetId(0, m_TopRight);
111 line->GetPointIds()->SetId(1, m_TopLeft);
112 lines->InsertNextCell(line);
113
114 line = vtkSmartPointer<vtkLine>::New();
115 line->GetPointIds()->SetId(0, m_TopLeft);
116 line->GetPointIds()->SetId(1, m_BottomLeft);
117 lines->InsertNextCell(line);
118}
119
120void vtkMitkRectangleProp::SetColor(float red, float green, float blue)
121{

Callers 1

vtkMitkRectanglePropMethod · 0.95

Calls 2

NewFunction · 0.50
SetIdMethod · 0.45

Tested by

no test coverage detected