13 #ifndef CSOLIVE_WIRE_PROCESSOR_H
14 #define CSOLIVE_WIRE_PROCESSOR_H
70 const Matrix4& voxelToWorldMatrix,
const Matrix4& worldToVoxelMatrix,
162 float _currentHitXPos;
164 float _currentHitYPos;
166 float _currentHitZPos;
168 float _lastRecentHitXPos;
170 float _lastRecentHitYPos;
172 float _lastRecentHitZPos;
184 CSO* _currentlyActiveCSO;
194 std::vector<Vector3>_draggedPositions;
206 bool _isMovingSeedPoint;
208 bool _isGeneratingCSO;
210 bool _isDrawingInMotion;
212 bool _couldCloseCurrentCSO;
215 bool _bUseInputImage;
219 bool _bUseInputCosts;
224 unsigned int _imageSizeX;
226 unsigned int _imageSizeY;
237 bool _optionalImgIsValid;
242 SbVec3f _sliceNormal0;
244 SbVec3f _sliceNormal1;
246 SbVec3f _sliceNormal2;
254 void _removeSeedPointFromMiddle();
257 CSO* _addAndInitCSO();
261 void _setInputImageSlice();
268 void _findLiveWirePathsAroundActiveSeedPoint(
const Vector3& currentHitPoint);
271 void _transformWorldToVoxel(
const Vector3& worldPos,
Vector3& voxelPos);
274 void _transformVoxelToWorld(
const Vector3& voxelPos,
Vector3& worldPos);
278 void _fillPoints(
CSOPathPoints* pathPoints,
const std::vector<VoxelPos>& positions);
#define SOCSO_EXPORT
Header file for system independent resolution.
SoView2D is a 2D viewer for image data.
a list that holds all View2DSlice objects (lazily created) of a SoView2D
Field to encapsulate a boolean value.
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
The class maintains a graph for applying a shortest path algorithm on.
Module which allows for an half-automatic generation of contours along image edges,...
void activateAttachments() override
Initialize module after loading.
void handleNotification(Field *field) override
Called when input changes.
bool couldCloseCSO() override
Returns whether the processor could close an open CSO by the processor's rules.
void resetInteractionState() override
Sets back internal interaction state.
bool isCurrentlyGenerating() override
Returns whether the processor is currently generating a new contour.
bool needsMemoryImage() override
Returns whether the processor need the current memory image for interpolation.
void setMemoryImage(float *imageData, int sizex, int sizey, int voxelPosZ, const Matrix4 &voxelToWorldMatrix, const Matrix4 &worldToVoxelMatrix, View2DSliceList *slicelist) override
Sets an image which can be used with an image based interpolation algorithm.
~CSOLiveWireProcessor() override
Standard destructor.
bool process(CSOEvalEventView2DInfos view2DInfos, CSOEvalEventCSOInfos csoInfos) override
Processes the interaction events and interpolates the contours accordingly.
CSOLiveWireProcessor()
Standard constructor.
void triggerSetMouseCursor(SoView2D *view2d, bool shouldSetMouseCursor) override
Triggers the setting of the processors default mouse cursor.
bool isCurrentlyEditing() override
Returns whether the processor is currently editing an existing contour.
The CSOPathPoints is a list of world coordinates which are interpolated by a certain interpolation sc...
Base class for processor modules; those provide mechanisms for an interactive generation of seed poin...
The CSOSeedPoint can be interactively set and modified and is the framework for contours.
The CSO represents a contour segmentation object.
Base class for all fields used in the ML.
Field to encapsulate a float value.
Field to encapsulate an integer value.
Class which represents an image, which manages properties of an image and image data which is located...
Field to encapsulate a vector of 4 double values representing a plane with all properties of Vector4F...
Field to encapsulate a string value.
#define ML_MODULE_CLASS_HEADER(className)
Like ML_CLASS_HEADER for the usage of derived classes from Module.
SliceErrorHandlingMode
Enumeration of modes to handle CSOs over more than one slice (slicing while generating).
@ CSO_SLICE_ERROR_HANDLING_REMOVE_CSO
Remove the whole CSO.
@ CSO_SLICE_ERROR_HANDLING_REMOVE_LAST_SEEDPOINT
Remove the last seedpoint which lead to this error.
@ CSO_SLICE_ERROR_HANDLING_PRINT_WARNING
Just print a warning to the console.
CSOLiveWireFinishingMode
Enumeration of finishing modes to test against.
@ CSO_LIVE_WIRE_FINISH_ON_DISTANCE
Current CSO finishes if a seed point is placed in the vicinity of its starting seed point.
@ CSO_LIVE_WIRE_FINISH_ON_DOUBLE_CLICK
Current CSO finishes on double click.
Structure holding a 2D voxel position.