27 #define _USE_MATH_DEFINES
35 : m_NodeModified(true), m_NodeModifiedObserverTag(0), m_NodeModifiedObserverAdded(false)
45 if (m_NodeModifiedObserverAdded && GetDataNode() != NULL)
47 GetDataNode()->RemoveObserver(m_NodeModifiedObserverTag);
55 m_AnnotationOverlay->SetVisibility(
false, renderer);
57 m_QuantityOverlay->SetVisibility(
false, renderer);
59 GetDataNode()->GetVisibility(visible, renderer,
"visible");
75 if (planarFigurePlaneGeometry == NULL)
77 MITK_ERROR <<
"PlanarFigure does not have valid PlaneGeometry!";
88 if ((planarFigurePlaneGeometry != NULL) && (rendererPlaneGeometry != NULL))
90 double planeThickness = planarFigurePlaneGeometry->
GetExtentInMM(2);
91 if (!planarFigurePlaneGeometry->
IsParallel(rendererPlaneGeometry) ||
92 !(planarFigurePlaneGeometry->
DistanceFromPlane(rendererPlaneGeometry) < planeThickness / 3.0))
106 ApplyColorAndOpacityProperties(renderer);
109 glEnable(GL_LINE_SMOOTH);
110 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
111 glEnable(GL_DEPTH_TEST);
115 this->InitializePlanarFigurePropertiesFromDataNode(node);
121 lineDisplayMode = PF_SELECTED;
123 else if (m_IsHovering)
125 lineDisplayMode = PF_HOVER;
133 RenderLines(lineDisplayMode, planarFigure, anchorPoint, planarFigurePlaneGeometry, rendererPlaneGeometry, renderer);
137 double annotationOffset = 0.0;
140 float globalOpacity = 1.0;
143 if (m_DrawControlPoints)
146 RenderControlPoints(planarFigure, lineDisplayMode, planarFigurePlaneGeometry, rendererPlaneGeometry, renderer);
150 const std::string name = node->
GetName();
151 if (m_DrawName && !name.empty())
153 RenderAnnotations(renderer, name, anchorPoint, globalOpacity, lineDisplayMode, annotationOffset);
158 if (m_DrawQuantities)
160 RenderQuantities(planarFigure, renderer, anchorPoint, annotationOffset, globalOpacity, lineDisplayMode);
177 std::vector<mitk::Point2D> pointlist;
178 for (
auto iter = vertices.cbegin(); iter != vertices.cend(); ++iter)
182 this->TransformObjectToDisplay(*iter, displayPoint, planarFigurePlaneGeometry, rendererPlaneGeometry, renderer);
184 pointlist.push_back(displayPoint);
186 if (displayPoint[0] > rightMostPoint[0])
187 rightMostPoint = displayPoint;
196 this->TransformObjectToDisplay(
197 vertices.cbegin()[0], displayPoint, planarFigurePlaneGeometry, rendererPlaneGeometry, renderer);
199 pointlist.push_back(displayPoint);
204 glBegin(GL_LINE_STRIP);
205 for (
auto pointIter = pointlist.cbegin(); pointIter != pointlist.cend(); pointIter++)
211 anchorPoint = rightMostPoint;
221 for (
auto loop = 0; loop < numberOfPolyLines; ++loop)
226 polyline, figure->
IsClosed(), anchorPoint, planarFigurePlaneGeometry, rendererPlaneGeometry, renderer);
239 for (
unsigned int loop = 0; loop < numberOfHelperPolyLines; ++loop)
241 const auto helperPolyLine =
251 this->PaintPolyLine(helperPolyLine,
false, anchorPoint, planarFigurePlaneGeometry, rendererPlaneGeometry, renderer);
264 objectGeometry->
Map(point2D, point3D);
281 if (this->GetDataNode() !=
nullptr && this->GetDataNode()->GetDataInteractor().IsNull())
284 if (markerOpacity == 0 && lineOpacity == 0)
289 this->TransformObjectToDisplay(point, displayPoint, objectGeometry, rendererGeometry, renderer);
291 glColor4f(markerColor[0], markerColor[1], markerColor[2], markerOpacity);
292 glLineWidth(lineWidth);
302 glDisable(GL_LINE_SMOOTH);
303 if (markerOpacity > 0)
305 glRectf(displayPoint[0] - 4, displayPoint[1] - 4, displayPoint[0] + 4, displayPoint[1] + 4);
308 glColor4f(lineColor[0], lineColor[1], lineColor[2], lineOpacity);
309 glBegin(GL_LINE_LOOP);
310 glVertex3f(displayPoint[0] - 4, displayPoint[1] - 4,
PLANAR_OFFSET);
311 glVertex3f(displayPoint[0] - 4, displayPoint[1] + 4,
PLANAR_OFFSET);
312 glVertex3f(displayPoint[0] + 4, displayPoint[1] + 4,
PLANAR_OFFSET);
313 glVertex3f(displayPoint[0] + 4, displayPoint[1] - 4,
PLANAR_OFFSET);
322 if (markerOpacity > 0)
326 for (
int angle = 0; angle < 8; ++angle)
328 float angleRad = angle * (float)3.14159 / 4.0;
329 float x = displayPoint[0] + radius * (float)cos(angleRad);
330 float y = displayPoint[1] + radius * (float)sin(angleRad);
337 glColor4f(lineColor[0], lineColor[1], lineColor[2], lineOpacity);
338 glBegin(GL_LINE_LOOP);
339 for (
int angle = 0; angle < 8; ++angle)
341 float angleRad = angle * (float)3.14159 / 4.0;
342 float x = displayPoint[0] + radius * (float)cos(angleRad);
343 float y = displayPoint[1] + radius * (float)sin(angleRad);
355 m_IsSelected =
false;
356 m_IsHovering =
false;
357 m_DrawOutline =
false;
358 m_DrawQuantities =
false;
359 m_DrawShadow =
false;
360 m_DrawControlPoints =
false;
362 m_DrawDashed =
false;
363 m_DrawHelperDashed =
false;
364 m_AnnotationsShadow =
false;
366 m_ShadowWidthFactor = 1.2;
368 m_OutlineWidth = 4.0;
369 m_HelperlineWidth = 2.0;
371 m_DevicePixelRatio = 1.0;
375 this->SetColorProperty(m_LineColor, PF_DEFAULT, 1.0, 1.0, 1.0);
376 this->SetFloatProperty(m_LineOpacity, PF_DEFAULT, 1.0);
377 this->SetColorProperty(m_OutlineColor, PF_DEFAULT, 0.0, 0.0, 1.0);
378 this->SetFloatProperty(m_OutlineOpacity, PF_DEFAULT, 1.0);
379 this->SetColorProperty(m_HelperlineColor, PF_DEFAULT, 0.4, 0.8, 0.2);
380 this->SetFloatProperty(m_HelperlineOpacity, PF_DEFAULT, 0.4);
381 this->SetColorProperty(m_MarkerlineColor, PF_DEFAULT, 1.0, 1.0, 1.0);
382 this->SetFloatProperty(m_MarkerlineOpacity, PF_DEFAULT, 1.0);
383 this->SetColorProperty(m_MarkerColor, PF_DEFAULT, 1.0, 1.0, 1.0);
384 this->SetFloatProperty(m_MarkerOpacity, PF_DEFAULT, 0.0);
385 this->SetColorProperty(m_AnnotationColor, PF_DEFAULT, 1.0, 1.0, 1.0);
387 this->SetColorProperty(m_LineColor, PF_HOVER, 1.0, 0.7, 0.0);
388 this->SetFloatProperty(m_LineOpacity, PF_HOVER, 1.0);
389 this->SetColorProperty(m_OutlineColor, PF_HOVER, 0.0, 0.0, 1.0);
390 this->SetFloatProperty(m_OutlineOpacity, PF_HOVER, 1.0);
391 this->SetColorProperty(m_HelperlineColor, PF_HOVER, 0.4, 0.8, 0.2);
392 this->SetFloatProperty(m_HelperlineOpacity, PF_HOVER, 0.4);
393 this->SetColorProperty(m_MarkerlineColor, PF_HOVER, 1.0, 1.0, 1.0);
394 this->SetFloatProperty(m_MarkerlineOpacity, PF_HOVER, 1.0);
395 this->SetColorProperty(m_MarkerColor, PF_HOVER, 1.0, 0.6, 0.0);
396 this->SetFloatProperty(m_MarkerOpacity, PF_HOVER, 0.2);
397 this->SetColorProperty(m_AnnotationColor, PF_HOVER, 1.0, 0.7, 0.0);
399 this->SetColorProperty(m_LineColor, PF_SELECTED, 1.0, 0.0, 0.0);
400 this->SetFloatProperty(m_LineOpacity, PF_SELECTED, 1.0);
401 this->SetColorProperty(m_OutlineColor, PF_SELECTED, 0.0, 0.0, 1.0);
402 this->SetFloatProperty(m_OutlineOpacity, PF_SELECTED, 1.0);
403 this->SetColorProperty(m_HelperlineColor, PF_SELECTED, 0.4, 0.8, 0.2);
404 this->SetFloatProperty(m_HelperlineOpacity, PF_SELECTED, 0.4);
405 this->SetColorProperty(m_MarkerlineColor, PF_SELECTED, 1.0, 1.0, 1.0);
406 this->SetFloatProperty(m_MarkerlineOpacity, PF_SELECTED, 1.0);
407 this->SetColorProperty(m_MarkerColor, PF_SELECTED, 1.0, 0.6, 0.0);
408 this->SetFloatProperty(m_MarkerOpacity, PF_SELECTED, 1.0);
409 this->SetColorProperty(m_AnnotationColor, PF_SELECTED, 1.0, 0.0, 0.0);
421 if (!m_NodeModifiedObserverAdded)
426 m_NodeModifiedObserverTag = node->AddObserver(itk::ModifiedEvent(), nodeModifiedCommand);
427 m_NodeModifiedObserverAdded =
true;
436 m_NodeModified =
false;
439 float globalOpacity = 1.0;
446 node->
GetBoolProperty(
"planarfigure.drawquantities", m_DrawQuantities);
447 node->
GetBoolProperty(
"planarfigure.drawcontrolpoints", m_DrawControlPoints);
451 node->
GetBoolProperty(
"planarfigure.helperline.drawdashed", m_DrawHelperDashed);
454 node->
GetFloatProperty(
"planarfigure.shadow.widthmodifier", m_ShadowWidthFactor);
458 node->
GetFloatProperty(
"planarfigure.devicepixelratio", m_DevicePixelRatio);
459 node->
GetStringProperty(
"planarfigure.annotations.font.family", m_AnnotationFontFamily);
460 node->
GetBoolProperty(
"planarfigure.annotations.font.bold", m_DrawAnnotationBold);
461 node->
GetBoolProperty(
"planarfigure.annotations.font.italic", m_DrawAnnotationItalic);
462 node->
GetIntProperty(
"planarfigure.annotations.font.size", m_AnnotationSize);
463 if (!node->
GetBoolProperty(
"planarfigure.annotations.shadow", m_AnnotationsShadow))
470 if (styleProperty.IsNotNull())
472 m_ControlPointShape = styleProperty->GetShape();
477 if (!node->
GetColor(m_LineColor[PF_DEFAULT], NULL,
"planarfigure.default.line.color"))
479 node->
GetColor(m_LineColor[PF_DEFAULT], NULL,
"color");
481 node->
GetFloatProperty(
"planarfigure.default.line.opacity", m_LineOpacity[PF_DEFAULT]);
483 if (!node->
GetColor(m_OutlineColor[PF_DEFAULT], NULL,
"planarfigure.default.outline.color"))
485 node->
GetColor(m_OutlineColor[PF_DEFAULT], NULL,
"color");
487 node->
GetFloatProperty(
"planarfigure.default.outline.opacity", m_OutlineOpacity[PF_DEFAULT]);
489 if (!node->
GetColor(m_HelperlineColor[PF_DEFAULT], NULL,
"planarfigure.default.helperline.color"))
491 node->
GetColor(m_HelperlineColor[PF_DEFAULT], NULL,
"color");
493 node->
GetFloatProperty(
"planarfigure.default.helperline.opacity", m_HelperlineOpacity[PF_DEFAULT]);
495 node->
GetColor(m_MarkerlineColor[PF_DEFAULT], NULL,
"planarfigure.default.markerline.color");
496 node->
GetFloatProperty(
"planarfigure.default.markerline.opacity", m_MarkerlineOpacity[PF_DEFAULT]);
497 node->
GetColor(m_MarkerColor[PF_DEFAULT], NULL,
"planarfigure.default.marker.color");
498 node->
GetFloatProperty(
"planarfigure.default.marker.opacity", m_MarkerOpacity[PF_DEFAULT]);
499 if (!node->
GetColor(m_AnnotationColor[PF_DEFAULT], NULL,
"planarfigure.default.annotation.color"))
501 if (!node->
GetColor(m_AnnotationColor[PF_DEFAULT], NULL,
"planarfigure.default.line.color"))
503 node->
GetColor(m_AnnotationColor[PF_DEFAULT], NULL,
"color");
508 node->
GetColor(m_LineColor[PF_HOVER], NULL,
"planarfigure.hover.line.color");
509 node->
GetFloatProperty(
"planarfigure.hover.line.opacity", m_LineOpacity[PF_HOVER]);
510 node->
GetColor(m_OutlineColor[PF_HOVER], NULL,
"planarfigure.hover.outline.color");
511 node->
GetFloatProperty(
"planarfigure.hover.outline.opacity", m_OutlineOpacity[PF_HOVER]);
512 node->
GetColor(m_HelperlineColor[PF_HOVER], NULL,
"planarfigure.hover.helperline.color");
513 node->
GetFloatProperty(
"planarfigure.hover.helperline.opacity", m_HelperlineOpacity[PF_HOVER]);
514 node->
GetColor(m_MarkerlineColor[PF_HOVER], NULL,
"planarfigure.hover.markerline.color");
515 node->
GetFloatProperty(
"planarfigure.hover.markerline.opacity", m_MarkerlineOpacity[PF_HOVER]);
516 node->
GetColor(m_MarkerColor[PF_HOVER], NULL,
"planarfigure.hover.marker.color");
517 node->
GetFloatProperty(
"planarfigure.hover.marker.opacity", m_MarkerOpacity[PF_HOVER]);
518 if (!node->
GetColor(m_AnnotationColor[PF_HOVER], NULL,
"planarfigure.hover.annotation.color"))
520 if (!node->
GetColor(m_AnnotationColor[PF_HOVER], NULL,
"planarfigure.hover.line.color"))
522 node->
GetColor(m_AnnotationColor[PF_HOVER], NULL,
"color");
527 node->
GetColor(m_LineColor[PF_SELECTED], NULL,
"planarfigure.selected.line.color");
528 node->
GetFloatProperty(
"planarfigure.selected.line.opacity", m_LineOpacity[PF_SELECTED]);
529 node->
GetColor(m_OutlineColor[PF_SELECTED], NULL,
"planarfigure.selected.outline.color");
530 node->
GetFloatProperty(
"planarfigure.selected.outline.opacity", m_OutlineOpacity[PF_SELECTED]);
531 node->
GetColor(m_HelperlineColor[PF_SELECTED], NULL,
"planarfigure.selected.helperline.color");
532 node->
GetFloatProperty(
"planarfigure.selected.helperline.opacity", m_HelperlineOpacity[PF_SELECTED]);
533 node->
GetColor(m_MarkerlineColor[PF_SELECTED], NULL,
"planarfigure.selected.markerline.color");
534 node->
GetFloatProperty(
"planarfigure.selected.markerline.opacity", m_MarkerlineOpacity[PF_SELECTED]);
535 node->
GetColor(m_MarkerColor[PF_SELECTED], NULL,
"planarfigure.selected.marker.color");
536 node->
GetFloatProperty(
"planarfigure.selected.marker.opacity", m_MarkerOpacity[PF_SELECTED]);
537 if (!node->
GetColor(m_AnnotationColor[PF_SELECTED], NULL,
"planarfigure.selected.annotation.color"))
539 if (!node->
GetColor(m_AnnotationColor[PF_SELECTED], NULL,
"planarfigure.selected.line.color"))
541 node->
GetColor(m_AnnotationColor[PF_SELECTED], NULL,
"color");
546 for (
unsigned int i = 0; i < PF_COUNT; ++i)
548 m_LineOpacity[i] *= globalOpacity;
549 m_OutlineOpacity[i] *= globalOpacity;
550 m_HelperlineOpacity[i] *= globalOpacity;
551 m_MarkerlineOpacity[i] *= globalOpacity;
552 m_MarkerOpacity[i] *= globalOpacity;
558 m_NodeModified =
true;
625 bool isEditable =
true;
626 m_DataNode->GetBoolProperty(
"planarfigure.iseditable", isEditable);
633 for (
unsigned int i = 0; i < numberOfControlPoints; ++i)
639 if (i == selectedControlPointsIdx)
641 pointDisplayMode = PF_SELECTED;
643 else if (m_IsHovering && isEditable)
645 pointDisplayMode = PF_HOVER;
649 if (m_MarkerOpacity[pointDisplayMode] == 0 && m_MarkerlineOpacity[pointDisplayMode] == 0)
660 m_OutlineColor[lineDisplayMode],
661 m_MarkerlineOpacity[pointDisplayMode],
662 m_OutlineColor[lineDisplayMode],
663 m_MarkerOpacity[pointDisplayMode],
666 planarFigurePlaneGeometry,
667 rendererPlaneGeometry,
672 m_MarkerlineColor[pointDisplayMode],
673 m_MarkerlineOpacity[pointDisplayMode],
674 m_MarkerColor[pointDisplayMode],
675 m_MarkerOpacity[pointDisplayMode],
678 planarFigurePlaneGeometry,
679 rendererPlaneGeometry,
686 m_MarkerlineColor[PF_HOVER],
687 m_MarkerlineOpacity[PF_HOVER],
688 m_MarkerColor[PF_HOVER],
689 m_MarkerOpacity[PF_HOVER],
692 planarFigurePlaneGeometry,
693 rendererPlaneGeometry,
699 const std::string name,
703 double &annotationOffset)
710 m_AnnotationOverlay->SetText(name);
711 m_AnnotationOverlay->SetColor(m_AnnotationColor[lineDisplayMode][0],
712 m_AnnotationColor[lineDisplayMode][1],
713 m_AnnotationColor[lineDisplayMode][2]);
714 m_AnnotationOverlay->SetOpacity(globalOpacity);
715 m_AnnotationOverlay->SetFontSize(m_AnnotationSize * m_DevicePixelRatio);
716 m_AnnotationOverlay->SetBoolProperty(
"drawShadow", m_AnnotationsShadow);
717 m_AnnotationOverlay->SetVisibility(
true, renderer);
718 m_AnnotationOverlay->SetStringProperty(
"font.family", m_AnnotationFontFamily);
719 m_AnnotationOverlay->SetBoolProperty(
"font.bold", m_DrawAnnotationBold);
720 m_AnnotationOverlay->SetBoolProperty(
"font.italic", m_DrawAnnotationItalic);
726 scaledAnchorPoint[0] = anchorPoint[0] * m_DevicePixelRatio;
727 scaledAnchorPoint[1] = anchorPoint[1] * m_DevicePixelRatio;
729 offset[0] = offset[0] * m_DevicePixelRatio;
730 offset[1] = offset[1] * m_DevicePixelRatio;
732 m_AnnotationOverlay->SetPosition2D(scaledAnchorPoint);
733 m_AnnotationOverlay->SetOffsetVector(offset);
735 m_AnnotationOverlay->Update(renderer);
736 m_AnnotationOverlay->Paint(renderer);
737 annotationOffset -= 15.0;
744 double &annotationOffset,
753 std::stringstream quantityString;
754 quantityString.setf(ios::fixed, ios::floatfield);
755 quantityString.precision(1);
757 bool firstActiveFeature =
true;
762 if (!firstActiveFeature)
764 quantityString <<
" x ";
766 quantityString << planarFigure->
GetQuantity(i) <<
" ";
768 firstActiveFeature =
false;
772 m_QuantityOverlay->SetColor(m_AnnotationColor[lineDisplayMode][0],
773 m_AnnotationColor[lineDisplayMode][1],
774 m_AnnotationColor[lineDisplayMode][2]);
776 m_QuantityOverlay->SetOpacity(globalOpacity);
777 m_QuantityOverlay->SetFontSize(m_AnnotationSize * m_DevicePixelRatio);
778 m_QuantityOverlay->SetBoolProperty(
"drawShadow", m_DrawShadow);
779 m_QuantityOverlay->SetVisibility(
true, renderer);
781 m_AnnotationOverlay->SetStringProperty(
"font.family", m_AnnotationFontFamily);
782 m_AnnotationOverlay->SetBoolProperty(
"font.bold", m_DrawAnnotationBold);
783 m_AnnotationOverlay->SetBoolProperty(
"font.italic", m_DrawAnnotationItalic);
785 m_QuantityOverlay->SetText(quantityString.str().c_str());
788 offset[1] += annotationOffset;
791 scaledAnchorPoint[0] = anchorPoint[0] * m_DevicePixelRatio;
792 scaledAnchorPoint[1] = anchorPoint[1] * m_DevicePixelRatio;
794 offset[0] = offset[0] * m_DevicePixelRatio;
795 offset[1] = offset[1] * m_DevicePixelRatio;
797 m_QuantityOverlay->SetPosition2D(scaledAnchorPoint);
798 m_QuantityOverlay->SetOffsetVector(offset);
800 m_QuantityOverlay->Update(renderer);
801 m_QuantityOverlay->Paint(renderer);
803 annotationOffset -= 15.0;
813 glLineStipple(1, 0x00FF);
818 const float *color = m_OutlineColor[lineDisplayMode];
819 const float opacity = m_OutlineOpacity[lineDisplayMode];
822 float *colorVector =
new float[4];
823 colorVector[0] = color[0];
824 colorVector[1] = color[1];
825 colorVector[2] = color[2];
826 colorVector[3] = opacity;
829 glColor4fv(colorVector);
830 glLineWidth(m_OutlineWidth);
833 glEnable(GL_LINE_STIPPLE);
835 glDisable(GL_LINE_STIPPLE);
838 this->DrawMainLines(planarFigure, anchorPoint, planarFigurePlaneGeometry, rendererPlaneGeometry, renderer);
840 glLineWidth(m_HelperlineWidth);
842 if (m_DrawHelperDashed)
843 glEnable(GL_LINE_STIPPLE);
845 glDisable(GL_LINE_STIPPLE);
848 this->DrawHelperLines(planarFigure, anchorPoint, planarFigurePlaneGeometry, rendererPlaneGeometry, renderer);
851 delete[] colorVector;
858 const float opacity = m_OutlineOpacity[lineDisplayMode];
859 float shadowOpacity = 0.0f;
861 shadowOpacity = opacity - 0.2f;
864 float *shadow =
new float[4];
868 shadow[3] = shadowOpacity;
872 glLineWidth(m_OutlineWidth * m_ShadowWidthFactor);
875 glEnable(GL_LINE_STIPPLE);
877 glDisable(GL_LINE_STIPPLE);
880 this->DrawMainLines(planarFigure, anchorPoint, planarFigurePlaneGeometry, rendererPlaneGeometry, renderer);
882 glLineWidth(m_HelperlineWidth);
884 if (m_DrawHelperDashed)
885 glEnable(GL_LINE_STIPPLE);
887 glDisable(GL_LINE_STIPPLE);
890 this->DrawHelperLines(planarFigure, anchorPoint, planarFigurePlaneGeometry, rendererPlaneGeometry, renderer);
898 const float *color = m_LineColor[lineDisplayMode];
899 const float opacity = m_LineOpacity[lineDisplayMode];
902 float *colorVector =
new float[4];
903 colorVector[0] = color[0];
904 colorVector[1] = color[1];
905 colorVector[2] = color[2];
906 colorVector[3] = opacity;
909 glColor4fv(colorVector);
910 glLineWidth(m_LineWidth);
913 glEnable(GL_LINE_STIPPLE);
915 glDisable(GL_LINE_STIPPLE);
918 this->DrawMainLines(planarFigure, anchorPoint, planarFigurePlaneGeometry, rendererPlaneGeometry, renderer);
920 const float *helperColor = m_HelperlineColor[lineDisplayMode];
921 const float helperOpacity = m_HelperlineOpacity[lineDisplayMode];
923 float *helperColorVector =
new float[4];
924 helperColorVector[0] = helperColor[0];
925 helperColorVector[1] = helperColor[1];
926 helperColorVector[2] = helperColor[2];
927 helperColorVector[3] = helperOpacity;
930 glColor4fv(helperColorVector);
932 glLineWidth(m_HelperlineWidth);
934 if (m_DrawHelperDashed)
935 glEnable(GL_LINE_STIPPLE);
937 glDisable(GL_LINE_STIPPLE);
940 this->DrawHelperLines(planarFigure, anchorPoint, planarFigurePlaneGeometry, rendererPlaneGeometry, renderer);
943 delete[] colorVector;
944 delete[] helperColorVector;
947 if (m_DrawDashed || m_DrawHelperDashed)
948 glDisable(GL_LINE_STIPPLE);
itk::SmartPointer< Self > Pointer
double GetScaleFactorMMPerDisplayUnit() const
virtual bool Map(const mitk::Point3D &pt3d_mm, mitk::Point2D &pt2d_mm) const
Project a 3D point given in mm (pt3d_mm) onto the 2D geometry. The result is a 2D point in mm (pt2d_m...
bool GetIntProperty(const char *propertyKey, int &intValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for int properties (instances of IntProperty)
Organizes the rendering process.
bool GetName(std::string &nodeName, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="name") const
Convenience access method for accessing the name of an object (instance of StringProperty with proper...
bool GetBoolProperty(const char *propertyKey, bool &boolValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for bool properties (instances of BoolProperty)
virtual const PlaneGeometry * GetCurrentWorldPlaneGeometry()
Get the current 2D-worldgeometry (m_CurrentWorldPlaneGeometry) used for 2D-rendering.
mitk::BaseProperty * GetProperty(const char *propertyKey, const mitk::BaseRenderer *renderer=nullptr) const
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList of the rendere...
ScalarType DistanceFromPlane(const Point3D &pt3d_mm) const
Distance of the point from the plane (bounding-box not considered)
bool GetStringProperty(const char *propertyKey, std::string &string, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for string properties (instances of StringProperty)
void WorldToDisplay(const Point3D &worldIndex, Point2D &displayPoint) const
This method converts a 3D world index to the display point using the geometry of the renderWindow...
void AddProperty(const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer=nullptr, bool overwrite=false)
Add the property (instance of BaseProperty) if it does not exist (or always ifoverwrite istrue) with ...
bool IsParallel(const PlaneGeometry *plane) const
Returns whether the plane is parallel to another plane.
bool GetFloatProperty(const char *propertyKey, float &floatValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for float properties (instances of FloatProperty)
virtual int * GetViewportSize() const
MITKCORE_EXPORT const ScalarType eps
Describes a two-dimensional, rectangular plane.
ScalarType GetExtentInMM(int direction) const
Get the extent of the bounding-box in the specified direction in mm.
bool GetColor(float rgb[3], const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="color") const
Convenience access method for color properties (instances of ColorProperty)
Class for nodes of the DataTree.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.