18#ifndef __vtkMRMLMarkupsCurveNode_h
19#define __vtkMRMLMarkupsCurveNode_h
26#include "vtkMRMLExport.h"
31#include <vtkStringArray.h>
36class vtkArrayCalculator;
37class vtkAssignAttribute;
38class vtkCallbackCommand;
39class vtkCleanPolyData;
44class vtkTransformPolyDataFilter;
45class vtkTriangleFilter;
94 void PrintSelf(ostream& os, vtkIndent indent)
override;
96 const char*
GetIcon()
override {
return ":/Icons/MarkupsOpenCurve.png";}
97 const char*
GetAddIcon()
override {
return ":/Icons/MarkupsCurveMouseModePlace.png";}
98 const char*
GetPlaceAddIcon()
override {
return ":/Icons/MarkupsCurveMouseModePlaceAdd.png";}
137 static double GetCurveLength(vtkPoints* curvePoints,
bool closedCurve, vtkIdType startCurvePointIndex=0, vtkIdType numberOfCurvePoints=-1);
157 vtkPoints* surfacePoints,
double maximumSearchRadius=.25);
166 static bool ResamplePoints(vtkPoints* originalPoints, vtkPoints* interpolatedPoints,
167 double samplingDistance,
bool closedCurve, vtkDoubleArray* pedigreeIdsArray=
nullptr);
171 int curvePointsPerControlPoint,
bool closedCurve);
176 double samplingDistance, vtkIdType startCurvePointIndex, vtkIdType endCurvePointIndex);
215 vtkIdType startCurvePointId,
double distanceFromStartPoint, vtkPoints* curvePoints,
bool closedCurve);
362 vtkSmartPointer<vtkProjectMarkupsCurvePointsFilter> ProjectPointsFilter;
int GetNumberOfPointsPerInterpolatingSegment()
static void OnCurvatureMeasurementEnabledModified(vtkObject *caller, unsigned long eid, void *clientData, void *callData)
Callback function observing curvature measurement modified events to propagate enabled state.
vtkSmartPointer< vtkTransformPolyDataFilter > SurfaceToLocalTransformer
double GetSurfaceConstraintMaximumSearchRadiusTolerance() const
void SetCurveTypeToShortestDistanceOnSurface(vtkMRMLModelNode *modelNode=nullptr)
static void OnTorsionMeasurementEnabledModified(vtkObject *caller, unsigned long eid, void *clientData, void *callData)
Callback function observing torsion measurement modified events to propagate enabled state.
int GetCurveTypeFromString(const char *name)
void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference) override
Called after a node reference ID is removed (list size decreased).
const char * GetCurveTypeAsString(int id)
vtkIdType GetCurvePointIndexFromControlPointIndex(int controlPointIndex)
const char * GetAddIcon() override
vtkIdType GetFarthestCurvePointIndexToPositionWorld(const double posWorld[3])
const char * GetShortestDistanceSurfaceNodeReferenceRole()
void SetCurveTypeToPolynomial()
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file.
virtual void OnSurfaceModelTransformChanged()
vtkCallbackCommand * TorsionMeasurementModifiedCallbackCommand
Command handling torsion measurement modified events to propagate enabled state.
const char * GetSurfaceConstraintNodeReferenceMRMLAttributeName()
bool SetControlPointLabels(vtkStringArray *labels, vtkPoints *points)
Provides access to protected vtkMRMLMarkupsNode::SetControlPointLabelsWorld.
vtkMRMLModelNode * GetShortestDistanceSurfaceNode()
const char * GetMarkupType() override
Get markup type internal name.
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
vtkIdType GetClosestCurvePointIndexToPositionWorld(const double posWorld[3])
Get the index of the closest curve point to the world coordinates.
vtkMRMLMarkupsCurveNode()
void SetSurfaceDistanceWeightingFunction(const char *function)
virtual void UpdateSurfaceScalarVariables()
vtkPolyData * GetCurveWorld() override
void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) override
alternative method to propagate events generated in Display nodes
bool GetCurveDirectionAtPointIndexWorld(vtkIdType curvePointIndex, double directionVectorWorld[3])
int GetSurfaceCostFunctionType()
static bool ConstrainPointsToSurface(vtkPoints *originalPoints, vtkPoints *normalVectors, vtkPolyData *surfacePolydata, vtkPoints *surfacePoints, double maximumSearchRadius=.25)
const char * GetShortestDistanceSurfaceNodeReferenceMRMLAttributeName()
void SetSurfaceCostFunctionType(int surfaceCostFunctionType)
vtkSmartPointer< vtkPassThrough > WorldOutput
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
vtkPoints * GetCurvePointsWorld() override
int GetCurveType()
Type of curve to generate.
const char * ShortestDistanceSurfaceActiveScalar
void UpdateMeasurementsInternal() override
void SetCurveTypeToKochanekSpline()
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
vtkIdType GetCurvePointIndexAlongCurveWorld(vtkIdType startCurvePointId, double distanceFromStartPoint)
vtkCallbackCommand * CurvatureMeasurementModifiedCallbackCommand
Command handling curvature measurement modified events to propagate enabled state.
static vtkIdType GetClosestPointPositionAlongCurve(vtkPoints *points, const double pos[3], double closestPos[3], vtkPointLocator *pointLocator=nullptr)
const char * GetSurfaceDistanceWeightingFunction()
vtkAlgorithmOutput * GetCurveWorldConnection() override
static vtkIdType GetFarthestCurvePointIndexToPosition(vtkPoints *points, const double posWorld[3])
void PrintSelf(ostream &os, vtkIndent indent) override
Print out the node information to the output stream.
void operator=(const vtkMRMLMarkupsCurveNode &)
void SetCurveTypeToLinear()
static vtkMRMLMarkupsCurveNode * New()
void SetAndObserveShortestDistanceSurfaceNode(vtkMRMLModelNode *modelNode)
void OnNodeReferenceAdded(vtkMRMLNodeReference *reference) override
Called when a node reference ID is added (list size increased).
vtkMRMLMarkupsCurveNode(const vtkMRMLMarkupsCurveNode &)
void ResampleCurveWorld(double controlPointDistance)
Resample control points to have equal distances in the world coordinate system.
vtkSmartPointer< vtkCurveMeasurementsCalculator > CurveMeasurementsCalculator
vtkSmartPointer< vtkCleanPolyData > CleanFilter
const char * GetSurfaceConstraintNodeReferenceRole()
Node reference role for the surface that is used to project the curve onto.
void SetAndObserveSurfaceConstraintNode(vtkMRMLModelNode *modelNode)
vtkSmartPointer< vtkArrayCalculator > SurfaceScalarCalculator
const char * GetPlaceAddIcon() override
void SetCurveType(int type)
virtual void OnSurfaceModelNodeChanged()
bool GetCurvePointToWorldTransformAtPointIndex(vtkIdType curvePointIndex, vtkMatrix4x4 *curvePointToWorld)
vtkMRMLCopyContentMacro(vtkMRMLMarkupsCurveNode)
void SetNumberOfPointsPerInterpolatingSegment(int pointsPerSegment)
bool GetPositionAlongCurveWorld(double foundCurvePosition[3], vtkIdType startCurvePointId, double distanceFromStartPoint)
void OnNodeReferenceModified(vtkMRMLNodeReference *reference) override
Called when a node reference ID is modified.
static double GetCurveLength(vtkPoints *curvePoints, bool closedCurve, vtkIdType startCurvePointIndex=0, vtkIdType numberOfCurvePoints=-1)
void SetSurfaceConstraintMaximumSearchRadiusTolerance(double tolerance)
virtual void UpdateAssignedAttribute() override
Update scalar range and update markups pipeline when the active scalar array is changed.
~vtkMRMLMarkupsCurveNode() override
vtkSmartPointer< vtkPassThrough > SurfaceScalarPassThroughFilter
static bool GetPositionAndClosestPointIndexAlongCurve(double foundCurvePosition[3], vtkIdType &foundClosestPointIndex, vtkIdType startCurvePointId, double distanceFromStartPoint, vtkPoints *curvePoints, bool closedCurve)
Get point position along curve. Position is found along the curve and not snapped to closest curve po...
const char * GetIcon() override
bool GetSampledCurvePointsBetweenStartEndPointsWorld(vtkPoints *sampledPoints, double samplingDistance, vtkIdType startCurvePointIndex, vtkIdType endCurvePointIndex)
double GetCurveLengthBetweenStartEndPointsWorld(vtkIdType startCurvePointIndex, vtkIdType endCurvePointIndex)
vtkSmartPointer< vtkTriangleFilter > TriangleFilter
bool GetPointsOnPlaneWorld(vtkPlane *plane, vtkPoints *intersectionPoints)
static vtkIdType GetCurvePointIndexAlongCurve(vtkPoints *points, vtkIdType startCurvePointId, double distanceFromStartPoint, bool curveClosed)
void SetCurveTypeToCardinalSpline()
static const char * GetSurfaceCostFunctionTypeAsString(int surfaceCostFunctionType)
vtkIdType GetClosestPointPositionAlongCurveWorld(const double posWorld[3], double closestPosWorld[3])
vtkSmartPointer< vtkAssignAttribute > ScalarDisplayAssignAttribute
static bool ResampleStaticControlPointMeasurements(vtkCollection *measurements, vtkDoubleArray *curvePointsPedigreeIdsArray, int curvePointsPerControlPoint, bool closedCurve)
Resample static control point measurements using linear interpolation, based on fractional pedigreeId...
static bool ResamplePoints(vtkPoints *originalPoints, vtkPoints *interpolatedPoints, double samplingDistance, bool closedCurve, vtkDoubleArray *pedigreeIdsArray=nullptr)
Resample control points to have equal distances in the node's coordinate system.
static int GetSurfaceCostFunctionTypeFromString(const char *name)
double GetCurveLengthWorld(vtkIdType startCurvePointIndex=0, vtkIdType numberOfCurvePoints=-1)
vtkMRMLModelNode * GetSurfaceConstraintNode()
MRML node to represent a 3D surface model.
Class to hold information about a node reference.
Abstract Superclass for all specific types of MRML nodes.
Projects curve points from a vtkMRMLMarkupsCurveNode to the surface of a model.