 |
VTK
9.1.0
|
Go to the documentation of this file.
59 #ifndef vtkContourRepresentation_h
60 #define vtkContourRepresentation_h
62 #include "vtkInteractionWidgetsModule.h"
91 std::vector<vtkContourRepresentationPoint*>
Points;
101 std::vector<vtkContourRepresentationNode*>
Nodes;
104 for (
unsigned int i = 0; i < this->Nodes.size(); i++)
106 for (
unsigned int j = 0; j < this->Nodes[i]->Points.size(); j++)
108 delete this->Nodes[i]->Points[j];
110 this->Nodes[i]->Points.clear();
111 delete this->Nodes[i];
343 vtkSetClampMacro(PixelTolerance,
int, 1, 100);
344 vtkGetMacro(PixelTolerance,
int);
353 vtkGetMacro(WorldTolerance,
double);
376 vtkGetMacro(CurrentOperation,
int);
461 vtkSetMacro(RebuildLocator,
bool);
494 double worldPos[3],
double worldOrient[9],
int displayPos[2]);
496 double worldPos[3],
double worldOrient[9],
double displayPos[2]);
514 mid[0] = (p1[0] + p2[0]) / 2;
515 mid[1] = (p1[1] + p2[1]) / 2;
516 mid[2] = (p1[2] + p2[2]) / 2;
void StartWidgetInteraction(double e[2]) override=0
These are methods that satisfy vtkWidgetRepresentation's API.
void SetCurrentOperationToInactive()
Set / get the current operation.
virtual int GetNthNodeSelected(int)
Set/Get whether the active or nth node is selected.
virtual int SetActiveNodeToDisplayPosition(int pos[2])
Move the active node based on a specified display position.
virtual int GetActiveNodeDisplayPosition(double pos[2])
Get the display position of the active node.
virtual int ToggleActiveNodeSelected()
Set/Get whether the active or nth node is selected.
virtual int SetActiveNodeToDisplayPosition(double pos[2])
Move the active node based on a specified display position.
void ReleaseGraphicsResources(vtkWindow *w) override=0
Methods required by vtkProp superclass.
virtual int SetNthNodeDisplayPosition(int n, int pos[2])
Set the nth node's display position.
virtual vtkPolyData * GetContourRepresentationAsPolyData()=0
Get the points in this contour as a vtkPolyData.
void SetPointPlacer(vtkPointPlacer *)
double NormalizedDisplayPosition[2]
Abstract interface to translate 2D display positions to world coordinates.
virtual int GetActiveNodeWorldPosition(double pos[3])
Get the world position of the active node.
virtual int DeleteActiveNode()
Delete the active node.
virtual int SetNthNodeDisplayPosition(int n, int X, int Y)
Set the nth node's display position.
virtual int SetActiveNodeToDisplayPosition(int X, int Y)
Move the active node based on a specified display position.
void ResetLocator()
Deletes the previous locator if it exists and creates a new locator.
Defines API for interpolating/modifying nodes from a vtkContourRepresentation.
int RenderOverlay(vtkViewport *viewport) override=0
Methods required by vtkProp superclass.
virtual int AddNodeAtDisplayPosition(double displayPos[2])
Add a node at a specific display position.
virtual void Initialize(vtkPolyData *, vtkIdList *)
Build a contour representation from externally supplied PolyData.
~vtkContourRepresentation() override
record modification and/or execution time
represent the vtkContourWidget
void AddNodeAtPositionInternal(double worldPos[3], double worldOrient[9], double displayPos[2])
virtual int FindClosestPointOnContour(int X, int Y, double worldPos[3], int *idx)
void SetLineInterpolator(vtkContourLineInterpolator *)
Set / Get the Line Interpolator.
virtual int GetActiveNodeWorldOrientation(double orient[9])
Get the world orientation of the active node.
virtual int GetNumberOfIntermediatePoints(int n)
void SetCurrentOperationToShift()
Set / get the current operation.
void ComputeMidpoint(double p1[3], double p2[3], double mid[3])
vtkTimeStamp ContourBuildTime
void GetRendererComputedDisplayPositionFromWorldPosition(double worldPos[3], double worldOrient[9], double displayPos[2])
Given a world position and orientation, this computes the display position using the renderer of this...
virtual int AddNodeAtWorldPosition(double worldPos[3], double worldOrient[9])
Add a node at a specific world position.
virtual int SetNthNodeDisplayPosition(int n, double pos[2])
Set the nth node's display position.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
virtual int GetIntermediatePointWorldPosition(int n, int idx, double point[3])
Get the world position of the intermediate point at index idx between nodes n and (n+1) (or n and 0 i...
window superclass for vtkRenderWindow
void GetNodePolyData(vtkPolyData *poly)
Get the nodes and not the intermediate points in this contour as a vtkPolyData.
std::vector< vtkContourRepresentationNode * > Nodes
void GetRendererComputedDisplayPositionFromWorldPosition(double worldPos[3], double worldOrient[9], int displayPos[2])
Given a world position and orientation, this computes the display position using the renderer of this...
void AddNodeAtPositionInternal(double worldPos[3], double worldOrient[9], int displayPos[2])
std::vector< vtkContourRepresentationPoint * > Points
virtual vtkContourRepresentationNode * GetNthNode(int n)
Get the nth node.
Incremental octree in support of both point location and point insertion.
void SetCurrentOperationToTranslate()
Set / get the current operation.
virtual int ActivateNode(int displayPos[2])
Given a display position, activate a node.
virtual int SetNthNodeWorldPosition(int n, double pos[3], double orient[9])
Set the nth node's world position.
virtual int AddNodeAtWorldPosition(double x, double y, double z)
Add a node at a specific world position.
virtual int GetNumberOfNodes()
Get the number of nodes.
vtkTypeBool HasTranslucentPolygonalGeometry() override=0
Methods required by vtkProp superclass.
virtual int AddNodeAtDisplayPosition(int displayPos[2])
Add a node at a specific display position.
vtkContourRepresentation()
vtkIncrementalOctreePointLocator * Locator
Adding a point locator to the representation to speed up lookup of the active node when dealing with ...
void WidgetInteraction(double e[2]) override=0
These are methods that satisfy vtkWidgetRepresentation's API.
void UpdateLine(int idx1, int idx2)
a simple class to control print indentation
virtual int SetNthNodeSelected(int)
Set/Get whether the active or nth node is selected.
vtkPointPlacer * PointPlacer
list of point or cell ids
virtual int ActivateNode(double displayPos[2])
Given a display position, activate a node.
virtual int SetActiveNodeToWorldPosition(double pos[3], double orient[9])
virtual int SetNthNodeWorldPosition(int n, double pos[3])
Set the nth node's world position.
void SetClosedLoop(vtkTypeBool val)
Set / Get the ClosedLoop value.
abstract specification for Viewports
virtual int GetNthNodeWorldOrientation(int n, double orient[9])
Get the nth node's world orientation.
virtual void BuildLines()=0
virtual void InitializeContour(vtkPolyData *, vtkIdList *)
Internal implementation, delegated to another method, so that users who override the method Initializ...
double WorldOrientation[9]
vtkContourRepresentationInternals * Internal
virtual int ActivateNode(int X, int Y)
Given a display position, activate a node.
vtkTypeBool ShowSelectedNodes
virtual int DeleteNthNode(int n)
Delete the nth node.
virtual int GetNthNodeSlope(int idx, double slope[3])
Get the nth node's slope.
virtual int AddIntermediatePointWorldPosition(int n, double point[3], vtkIdType ptId)
Add an intermediate point between node n and n+1 (or n and 0 if n is the last node and the loop is cl...
virtual int AddNodeOnContour(int X, int Y)
Given a specific X, Y pixel location, add a new node on the contour at this location.
concrete dataset represents vertices, lines, polygons, and triangle strips
virtual void ClearAllNodes()
Delete all nodes.
virtual int SetActiveNodeToWorldPosition(double pos[3])
virtual int GetActiveNodeSelected()
Set/Get whether the active or nth node is selected.
int ComputeInteractionState(int X, int Y, int modified=0) override=0
These are methods that satisfy vtkWidgetRepresentation's API.
virtual int UpdateContour()
int RenderOpaqueGeometry(vtkViewport *viewport) override=0
Methods required by vtkProp superclass.
virtual int DeleteLastNode()
Delete the last node.
virtual void Initialize(vtkPolyData *)
Overloaded initialize method, that is called when the vtkIdList is nullptr to maintain backwards comp...
virtual int GetNthNodeWorldPosition(int n, double pos[3])
Get the nth node's world position.
vtkContourLineInterpolator * LineInterpolator
void SetCurrentOperationToScale()
Set / get the current operation.
void SetNthNodeWorldPositionInternal(int n, double worldPos[3], double worldOrient[9])
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override=0
Methods required by vtkProp superclass.
virtual void UpdateLines(int index)
virtual int AddNodeAtDisplayPosition(int X, int Y)
Add a node at a specific display position.
virtual int AddIntermediatePointWorldPosition(int n, double point[3])
Add an intermediate point between node n and n+1 (or n and 0 if n is the last node and the loop is cl...
virtual int AddNodeAtWorldPosition(double worldPos[3])
Add a node at a specific world position.
double NormalizedDisplayPosition[2]
virtual int GetNthNodeDisplayPosition(int n, double pos[2])
Get the nth node's display position.
virtual void SetShowSelectedNodes(vtkTypeBool)
A flag to indicate whether to show the Selected nodes Default is to set it to false.
void BuildRepresentation() override=0
These are methods that satisfy vtkWidgetRepresentation's API.