19 #include <vtkActor2D.h>
20 #include <vtkCellArray.h>
22 #include <vtkObjectFactory.h>
23 #include <vtkPoints.h>
24 #include <vtkPolyData.h>
25 #include <vtkPolyDataMapper2D.h>
26 #include <vtkProperty2D.h>
27 #include <vtkSmartPointer.h>
28 #include <vtkViewport.h>
44 tcoord->SetCoordinateSystemToDisplay();
45 mapper->SetTransformCoordinate(tcoord);
52 GetProperty()->SetLineWidth(2);
63 vtkErrorMacro(<<
"vtkActor2D::Render - No mapper set");
69 if (viewport->GetSize()[0] !=
m_Width || viewport->GetSize()[1] !=
m_Height)
71 m_Width = viewport->GetSize()[0];
77 this->Mapper->RenderOverlay(viewport,
this);
84 vtkSmartPointer<vtkPoints> points =
m_PolyData->GetPoints();
85 float offset = (GetProperty()->GetLineWidth() - 0.5);
106 vtkSmartPointer<vtkPoints> points =
m_PolyData->GetPoints();
107 vtkSmartPointer<vtkCellArray> lines =
m_PolyData->GetLines();
114 m_TopLeftD = points->InsertNextPoint(0.0, 1.0, 0.0);
116 m_TopLeftR = points->InsertNextPoint(0.0, 1.0, 0.0);
117 m_TopRightL = points->InsertNextPoint(1.0, 1.0, 0.0);
119 m_TopRightD = points->InsertNextPoint(1.0, 1.0, 0.0);
122 vtkSmartPointer<vtkLine> lineVtk;
126 lines->InsertNextCell(lineVtk);
131 lines->InsertNextCell(lineVtk);
136 lines->InsertNextCell(lineVtk);
141 lines->InsertNextCell(lineVtk);
146 GetProperty()->SetColor(col1, col2, col3);
151 GetProperty()->SetLineWidth(lineWidth);
void SetColor(float col1, float col2, float col3)
SetColor Set the color of the rectangle.
vtkSmartPointer< vtkPolyData > m_PolyData
m_PolyData holds the rectangle.
vtkStandardNewMacro(vtkMitkRectangleProp)
void SetLineWidth(unsigned int lineWidth)
The vtkMitkRectangleProp2 class Renders a rectangle into a renderwindow as a frame.
virtual ~vtkMitkRectangleProp()
int RenderOverlay(vtkViewport *viewport)
void CreateRectangle()
CreateRectangle internal helper to fill a vtkPolydata with a rectangle.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.