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];
135 virtual int AddNodeAtWorldPosition(
double x,
double y,
double z);
136 virtual int AddNodeAtWorldPosition(
double worldPos[3]);
137 virtual int AddNodeAtWorldPosition(
double worldPos[3],
double worldOrient[9]);
147 virtual int AddNodeAtDisplayPosition(
double displayPos[2]);
148 virtual int AddNodeAtDisplayPosition(
int displayPos[2]);
149 virtual int AddNodeAtDisplayPosition(
int X,
int Y);
159 virtual int ActivateNode(
double displayPos[2]);
160 virtual int ActivateNode(
int displayPos[2]);
161 virtual int ActivateNode(
int X,
int Y);
169 virtual int SetActiveNodeToWorldPosition(
double pos[3]);
170 virtual int SetActiveNodeToWorldPosition(
double pos[3],
double orient[9]);
180 virtual int SetActiveNodeToDisplayPosition(
double pos[2]);
181 virtual int SetActiveNodeToDisplayPosition(
int pos[2]);
182 virtual int SetActiveNodeToDisplayPosition(
int X,
int Y);
189 virtual int ToggleActiveNodeSelected();
190 virtual int GetActiveNodeSelected();
191 virtual int GetNthNodeSelected(
int);
192 virtual int SetNthNodeSelected(
int);
199 virtual int GetActiveNodeWorldPosition(
double pos[3]);
205 virtual int GetActiveNodeWorldOrientation(
double orient[9]);
211 virtual int GetActiveNodeDisplayPosition(
double pos[2]);
216 virtual int GetNumberOfNodes();
223 virtual int GetNthNodeDisplayPosition(
int n,
double pos[2]);
230 virtual int GetNthNodeWorldPosition(
int n,
double pos[3]);
242 virtual int GetNthNodeWorldOrientation(
int n,
double orient[9]);
253 virtual int SetNthNodeDisplayPosition(
int n,
int X,
int Y);
254 virtual int SetNthNodeDisplayPosition(
int n,
int pos[2]);
255 virtual int SetNthNodeDisplayPosition(
int n,
double pos[2]);
266 virtual int SetNthNodeWorldPosition(
int n,
double pos[3]);
267 virtual int SetNthNodeWorldPosition(
int n,
double pos[3],
double orient[9]);
275 virtual int GetNthNodeSlope(
int idx,
double slope[3]);
284 virtual int GetNumberOfIntermediatePoints(
int n);
292 virtual int GetIntermediatePointWorldPosition(
int n,
int idx,
double point[3]);
299 virtual int AddIntermediatePointWorldPosition(
int n,
double point[3]);
307 virtual int AddIntermediatePointWorldPosition(
int n,
double point[3],
vtkIdType ptId);
313 virtual int DeleteLastNode();
319 virtual int DeleteActiveNode();
325 virtual int DeleteNthNode(
int n);
330 virtual void ClearAllNodes();
336 virtual int AddNodeOnContour(
int X,
int Y);
343 vtkSetClampMacro(PixelTolerance,
int, 1, 100);
344 vtkGetMacro(PixelTolerance,
int);
353 vtkGetMacro(WorldTolerance,
double);
376 vtkGetMacro(CurrentOperation,
int);
453 virtual vtkPolyData* GetContourRepresentationAsPolyData() = 0;
461 vtkSetMacro(RebuildLocator,
bool);
484 void AddNodeAtPositionInternal(
double worldPos[3],
double worldOrient[9],
int displayPos[2]);
485 void AddNodeAtPositionInternal(
double worldPos[3],
double worldOrient[9],
double displayPos[2]);
486 void SetNthNodeWorldPositionInternal(
int n,
double worldPos[3],
double worldOrient[9]);
493 void GetRendererComputedDisplayPositionFromWorldPosition(
494 double worldPos[3],
double worldOrient[9],
int displayPos[2]);
495 void GetRendererComputedDisplayPositionFromWorldPosition(
496 double worldPos[3],
double worldOrient[9],
double displayPos[2]);
499 virtual void UpdateLines(
int index);
500 void UpdateLine(
int idx1,
int idx2);
502 virtual int FindClosestPointOnContour(
int X,
int Y,
double worldPos[3],
int* idx);
504 virtual void BuildLines() = 0;
509 virtual int UpdateContour();
514 mid[0] = (p1[0] + p2[0]) / 2;
515 mid[1] = (p1[1] + p2[1]) / 2;
516 mid[2] = (p1[2] + p2[2]) / 2;
std::vector< vtkContourRepresentationNode * > Nodes
std::vector< vtkContourRepresentationPoint * > Points
void SetCurrentOperationToInactive()
Set / get the current operation.
double NormalizedDisplayPosition[2]
abstract specification for Viewports
record modification and/or execution time
void SetCurrentOperationToTranslate()
Set / get the current operation.
concrete dataset represents vertices, lines, polygons, and triangle strips
vtkIncrementalOctreePointLocator * Locator
Adding a point locator to the representation to speed up lookup of the active node when dealing with ...
double WorldOrientation[9]
represent the vtkContourWidget
void SetCurrentOperationToShift()
Set / get the current operation.
window superclass for vtkRenderWindow
a simple class to control print indentation
void ComputeMidpoint(double p1[3], double p2[3], double mid[3])
list of point or cell ids
Abstract interface to translate 2D display positions to world coordinates.
vtkTimeStamp ContourBuildTime
vtkContourRepresentationInternals * Internal
Defines API for interpolating/modifying nodes from a vtkContourRepresentation.
void SetCurrentOperationToScale()
Set / get the current operation.
double NormalizedDisplayPosition[2]
vtkPointPlacer * PointPlacer
vtkContourLineInterpolator * LineInterpolator
vtkTypeBool ShowSelectedNodes
Incremental octree in support of both point location and point insertion.