62 #ifndef vtkContourRepresentation_h 63 #define vtkContourRepresentation_h 65 #include "vtkInteractionWidgetsModule.h" 91 double WorldOrientation[9];
94 std::vector<vtkContourRepresentationPoint*>
Points;
104 std::vector<vtkContourRepresentationNode*>
Nodes;
107 for(
unsigned int i=0;i<this->Nodes.size();i++)
109 for (
unsigned int j=0;j<this->Nodes[i]->Points.size();j++)
111 delete this->Nodes[i]->Points[j];
113 this->Nodes[i]->Points.clear();
114 delete this->Nodes[i];
137 virtual int AddNodeAtWorldPosition(
double x,
double y,
double z);
138 virtual int AddNodeAtWorldPosition(
double worldPos[3] );
139 virtual int AddNodeAtWorldPosition(
double worldPos[3],
140 double worldOrient[9] );
150 virtual int AddNodeAtDisplayPosition(
double displayPos[2] );
151 virtual int AddNodeAtDisplayPosition(
int displayPos[2] );
152 virtual int AddNodeAtDisplayPosition(
int X,
int Y );
162 virtual int ActivateNode(
double displayPos[2] );
163 virtual int ActivateNode(
int displayPos[2] );
164 virtual int ActivateNode(
int X,
int Y );
172 virtual int SetActiveNodeToWorldPosition(
double pos[3] );
173 virtual int SetActiveNodeToWorldPosition(
double pos[3],
184 virtual int SetActiveNodeToDisplayPosition(
double pos[2] );
185 virtual int SetActiveNodeToDisplayPosition(
int pos[2] );
186 virtual int SetActiveNodeToDisplayPosition(
int X,
int Y );
193 virtual int ToggleActiveNodeSelected();
194 virtual int GetActiveNodeSelected();
195 virtual int GetNthNodeSelected(
int);
196 virtual int SetNthNodeSelected(
int);
203 virtual int GetActiveNodeWorldPosition(
double pos[3] );
209 virtual int GetActiveNodeWorldOrientation(
double orient[9] );
215 virtual int GetActiveNodeDisplayPosition(
double pos[2] );
220 virtual int GetNumberOfNodes();
227 virtual int GetNthNodeDisplayPosition(
int n,
double pos[2] );
234 virtual int GetNthNodeWorldPosition(
int n,
double pos[3] );
246 virtual int GetNthNodeWorldOrientation(
int n,
double orient[9] );
257 virtual int SetNthNodeDisplayPosition(
int n,
int X,
int Y );
258 virtual int SetNthNodeDisplayPosition(
int n,
int pos[2] );
259 virtual int SetNthNodeDisplayPosition(
int n,
double pos[2] );
270 virtual int SetNthNodeWorldPosition(
int n,
double pos[3] );
271 virtual int SetNthNodeWorldPosition(
int n,
double pos[3],
280 virtual int GetNthNodeSlope(
int idx,
double slope[3] );
289 virtual int GetNumberOfIntermediatePoints(
int n );
297 virtual int GetIntermediatePointWorldPosition(
int n,
298 int idx,
double point[3] );
305 virtual int AddIntermediatePointWorldPosition(
int n,
314 virtual int AddIntermediatePointWorldPosition(
int n,
321 virtual int DeleteLastNode();
327 virtual int DeleteActiveNode();
333 virtual int DeleteNthNode(
int n );
338 virtual void ClearAllNodes();
344 virtual int AddNodeOnContour(
int X,
int Y );
351 vtkSetClampMacro(PixelTolerance,
int,1,100);
352 vtkGetMacro(PixelTolerance,
int);
361 vtkGetMacro(WorldTolerance,
double);
382 vtkGetMacro( CurrentOperation,
int );
383 vtkSetClampMacro( CurrentOperation,
int,
418 void BuildRepresentation()
override =0;
419 int ComputeInteractionState(
int X,
int Y,
int modified=0)
override =0;
420 void StartWidgetInteraction(
double e[2])
override =0;
421 void WidgetInteraction(
double e[2])
override =0;
428 void ReleaseGraphicsResources(
vtkWindow *w)
override =0;
429 int RenderOverlay(
vtkViewport *viewport)
override =0;
430 int RenderOpaqueGeometry(
vtkViewport *viewport)
override =0;
431 int RenderTranslucentPolygonalGeometry(
vtkViewport *viewport)
override =0;
432 vtkTypeBool HasTranslucentPolygonalGeometry()
override =0;
458 virtual vtkPolyData* GetContourRepresentationAsPolyData() = 0;
466 vtkSetMacro(RebuildLocator,
bool);
489 void AddNodeAtPositionInternal(
double worldPos[3],
490 double worldOrient[9],
int displayPos[2] );
491 void AddNodeAtPositionInternal(
double worldPos[3],
492 double worldOrient[9],
double displayPos[2] );
493 void SetNthNodeWorldPositionInternal(
int n,
double worldPos[3],
494 double worldOrient[9] );
501 void GetRendererComputedDisplayPositionFromWorldPosition(
double worldPos[3],
502 double worldOrient[9],
int displayPos[2] );
503 void GetRendererComputedDisplayPositionFromWorldPosition(
double worldPos[3],
504 double worldOrient[9],
double displayPos[2] );
507 virtual void UpdateLines(
int index );
508 void UpdateLine(
int idx1,
int idx2 );
510 virtual int FindClosestPointOnContour(
int X,
int Y,
514 virtual void BuildLines()=0;
519 virtual int UpdateContour();
524 mid[0] = (p1[0] + p2[0])/2;
525 mid[1] = (p1[1] + p2[1])/2;
526 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 ...
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.
vtkPointPlacer * PointPlacer
vtkContourLineInterpolator * LineInterpolator
vtkTypeBool ShowSelectedNodes
Incremental octree in support of both point location and point insertion.