21#ifndef __vtkMRMLMarkupsPlaneNode_h
22#define __vtkMRMLMarkupsPlaneNode_h
30#include "vtkMRMLExport.h"
33#include <vtkMatrix4x4.h>
61 void PrintSelf(ostream& os, vtkIndent indent)
override;
63 const char*
GetIcon()
override {
return ":/Icons/MarkupsPlane.png";}
64 const char*
GetAddIcon()
override {
return ":/Icons/MarkupsPlaneMouseModePlace.png";}
65 const char*
GetPlaceAddIcon()
override {
return ":/Icons/MarkupsPlaneMouseModePlaceAdd.png";}
98 void WriteXML(ostream& of,
int indent)
override;
106 void ApplyTransform(vtkAbstractTransform* transform,
bool applyToLockedControlPoints)
override;
197 void GetAxes(
double x[3],
double y[3],
double z[3]);
198 void SetAxes(
const double x[3],
const double y[3],
const double z[3]);
200 void SetAxesWorld(
const double x[3],
const double y[3],
const double z[3]);
260 vtkMatrix4x4* outputMatrix, vtkAbstractTransform* transform =
nullptr,
bool applyScaling =
true);
262 vtkMatrix4x4* outputMatrix, vtkAbstractTransform* transform =
nullptr,
bool applyScaling =
true);
286 void CalculateAxesFromPoints(
const double point0[3],
const double point1[3],
const double point2[3],
double x[3],
double y[3],
double z[3]);
329 double Size[2] = { 100.0, 100.0 };
void ApplyTransform(vtkAbstractTransform *transform) override
int MaximumNumberOfControlPoints
int RequiredNumberOfControlPoints
void operator=(const vtkMRMLMarkupsPlaneNode &)
virtual void UpdateControlPointsFromPlaneFit()
static vtkMRMLMarkupsPlaneNode * New()
virtual void UpdateControlPointsFrom3Points()
void SetAxes(const double x[3], const double y[3], const double z[3])
vtkSmartPointer< vtkMatrix4x4 > BaseToNodeMatrix
void UpdateInteractionHandleToWorldMatrix() override
Calculates the handle to world matrix based on the current control points.
virtual void GetBaseToWorldMatrix(vtkMatrix4x4 *baseToWorldMatrix)
Mapping from Base plane coordinates to world coordinates.
friend class vtkSlicerPlaneWidget
void CalculatePlaneBounds(vtkPoints *cornerPoints, double bounds[6])
Calculates the axis-aligned bounds defined by the corners of the plane.
virtual void UpdatePlaneFromPointNormal()
virtual void GetObjectToNodeMatrix(vtkMatrix4x4 *objectToNodeMatrix)
Mapping from XYZ plane coordinates to local coordinates.
vtkSmartPointer< vtkMatrix4x4 > ObjectToBaseMatrix
void SetSizeMode(int sizeMode)
void SetOriginWorld(const double origin[3])
vtkMRMLCopyContentMacro(vtkMRMLMarkupsPlaneNode)
virtual void UpdateControlPointsFromPlane()
Calculate the position of control points from the ROI.
void SetNormalWorld(const double normal[3])
double * GetSize() VTK_SIZEHINT(2)
virtual void GetObjectToWorldMatrix(vtkMatrix4x4 *objectToWorldMatrix)
Mapping from XYZ plane coordinates to world coordinates.
virtual void SetSize(double x, double y)
void UpdateImplicitFunction()
void SetOrigin(const double origin[3])
static const char * GetSizeModeAsString(int sizeMode)
const char * GetPlaceAddIcon() override
void GetNormal(double normal[3])
Get/Set the normal vector for the plane in object or world coordinate system.
vtkMRMLMarkupsPlaneNode()
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
bool GetClosestFitPlaneFromControlPoints(vtkMatrix4x4 *closestFitPlane)
void GetAxesWorld(double x[3], double y[3], double z[3])
void ApplyTransform(vtkAbstractTransform *transform, bool applyToLockedControlPoints) override
double * GetCenterWorld() VTK_SIZEHINT(3)
virtual void SetNormalPointRequired(bool)
~vtkMRMLMarkupsPlaneNode() override
double AutoSizeScalingFactor
void SetAxesWorld(const double x[3], const double y[3], const double z[3])
void CalculatePlaneCornerPoints(vtkPoints *points, double xAxis[3], double yAxis[3], double center[3], double size[2])
Calculates the axis-aligned bounds defined by the corners of the plane.
virtual void SetSize(double size[2])
static int GetSizeModeFromString(const char *sizeMode)
virtual void GetBaseToNodeMatrix(vtkMatrix4x4 *matrix)
Mapping from Base plane coordinates to local coordinates.
virtual void SetPlaneBounds(double x0, double x1, double y0, double y1)
void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) override
Re-implemented to react to changes in internal matrices or control points.
bool IsUpdatingPlaneFromControlPoints
void GetRASBounds(double bounds[6]) override
void GetCenter(double origin[3])
Get/Set geometric center of the plane. Currently, it is always the same as the origin of the plane.
virtual void UpdateControlPointsFromPointNormal()
void GetOrigin(double origin[3])
Get/Set the origin of the plane in object or world coordinate system.
void GetAxes(double x[3], double y[3], double z[3])
void SetCenterWorld(double x, double y, double z)
void OnTransformNodeReferenceChanged(vtkMRMLTransformNode *transformNode) override
Reimplemented to recalculate InteractionHandleToWorld matrix when parent transform is changed.
void SetCenterWorld(const double origin[3])
void GetPlaneCornerPointsWorld(vtkPoints *points_World)
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file.
void SetSizeWorld(const double normal[2])
void CreateDefaultDisplayNodes() override
Create default display node or nullptr if does not have one.
double GetClosestPointOnPlaneWorld(const double posWorld[3], double closestPosWorld[3], bool infinitePlane=true)
static void GenerateOrthogonalMatrix(vtkMatrix4x4 *inputMatrix, vtkMatrix4x4 *outputMatrix, vtkAbstractTransform *transform=nullptr, bool applyScaling=true)
void SetNormal(const double normal[3])
bool IsUpdatingControlPointsFromPlane
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
virtual void UpdatePlaneSize()
double * GetCenter() VTK_SIZEHINT(3)
virtual void UpdatePlaneFromPlaneFit()
friend class vtkSlicerPlaneRepresentation3D
static const char * GetPlaneTypeAsString(int planeType)
virtual void UpdatePlaneFromControlPoints()
Updates the plane based on plane type and control point position.
vtkMRMLMarkupsPlaneNode(const vtkMRMLMarkupsPlaneNode &)
const char * GetMarkupType() override
Get markup type internal name.
virtual vtkMatrix4x4 * GetObjectToBaseMatrix()
virtual void SetPlaneBounds(double bounds[4])
double * GetSizeWorld() VTK_SIZEHINT(2)
void SetCenter(const double origin[3])
const char * GetAddIcon() override
virtual void UpdatePlaneFrom3Points()
vtkImplicitFunction * GetImplicitFunctionWorld() override
static void GenerateOrthogonalMatrix(double xAxis[3], double yAxis[3], double zAxis[3], double origin[3], vtkMatrix4x4 *outputMatrix, vtkAbstractTransform *transform=nullptr, bool applyScaling=true)
const char * GetIcon() override
void GetCenterWorld(double origin[3])
vtkMRMLStorageNode * CreateDefaultStorageNode() override
Create default storage node or nullptr if does not have one.
static int GetPlaneTypeFromString(const char *planeType)
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
void GetNormalWorld(double normal[3])
void PrintSelf(ostream &os, vtkIndent indent) override
Print out the node information to the output stream.
void SetCenter(double x, double y, double z)
vtkSmartPointer< vtkPlane > ImplicitPlaneWorld
void SetPlaneType(int planeType)
double * GetNormal() VTK_SIZEHINT(3)
void GetBounds(double bounds[6]) override
void GetSizeWorld(double size[2])
friend class vtkSlicerPlaneRepresentation2D
void GetOriginWorld(double origin[3])
void GetSize(double size[2])
void GetPlaneCornerPoints(vtkPoints *points_Node)
Retrieves the list of points that define the corners of the plane.
virtual vtkMatrix4x4 * GetBaseToNodeMatrix()
void CalculateAxesFromPoints(const double point0[3], const double point1[3], const double point2[3], double x[3], double y[3], double z[3])
Calculates the x y and z axis of the plane from the 3 input points.
Abstract Superclass for all specific types of MRML nodes.
A superclass for other storage nodes.