13 #ifndef CSOFREEHAND_PROCESSOR_H
14 #define CSOFREEHAND_PROCESSOR_H
92 virtual void setMemoryImage(
float* imageData,
int sizex,
int sizey,
int voxelPosZ,
93 float* voxelToWorldMatrix,
float* worldToVoxelMatrix,
View2DSliceList* slicelist);
155 IntField* _numInterpolationStepsFld;
180 CSO* _currentlyActiveCSO;
187 bool _isMovingSeedPoint;
189 bool _isGeneratingCSO;
191 bool _isPrevCSOFinished;
193 bool _couldCloseCurrentCSO;
195 bool _hasInsertedSeedIntoPath;
198 SbVec3f _sliceNormal0;
200 SbVec3f _sliceNormal1;
202 SbVec3f _sliceNormal2;
205 std::string _currentSubType;
217 void _configurePresets();
219 void _finishCurrentCSO();
223 float _distanceNoSqrt(
float x1,
float y1,
float z1,
float x2,
float y2,
float z2);
230 void _setCurrentSubType();
#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.
The CSOBoundingBox defines an axis parallel bounding box with double precision.
Module which allows for an interactive generation of freehand contours with linear or spline interpol...
void handleNotification(Field *field) override
Handles field changes: here, only the creation mode field change is evaluated and leads to a setting ...
bool isCurrentlyGenerating() override
Returns whether the processor is currently generating a new contour.
~CSOFreehandProcessor() override
Destructor.
void activateAttachments() override
Method is called after module creation and after setting saved field values.
bool isCurrentlyEditing() override
Returns whether the processor is currently editing an existing contour.
void triggerSetMouseCursor(SoView2D *view2d, bool shouldSetMouseCursor) override
Triggers the setting of the processor's default mouse cursor.
bool needsMemoryImage() override
Returns whether the processor need the current memory image for interpolation.
virtual void setMemoryImage(float *imageData, int sizex, int sizey, int voxelPosZ, float *voxelToWorldMatrix, float *worldToVoxelMatrix, View2DSliceList *slicelist)
Sets an image which can be used with an image based interpolation algorithm.
void resetInteractionState() override
Sets back internal interaction state.
bool couldCloseCSO() override
Returns whether the processor could close an open CSO by the processor's rules.
bool process(CSOEvalEventView2DInfos view2DInfos, CSOEvalEventCSOInfos csoInfos) override
Evaluates the interaction events and interpolates the contours accordingly.
CSOFreehandProcessor()
Constructor.
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
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.
#define ML_MODULE_CLASS_HEADER(className)
Like ML_CLASS_HEADER for the usage of derived classes from Module.
FINISHING_MODES
Enumeration of the contour finishing modes.
@ FINISH_ON_RELEASE
Contour is finished on release of active mouse button (for closing: be aware of vicinity).
@ FINISH_ON_DOUBLE_CLICK
Contour is finished on double click.
INTERPOLATION_MODES
Enumeration of available interpolation modes.
@ INTERPOLATION_MODE_SPLINE_APPROXIMATION
Spline approximation (B-Spline).
@ INTERPOLATION_MODE_LINEAR_INTERPOLATION
Linear interpolation.
@ INTERPOLATION_MODE_SPLINE_INTERPOLATION
Spline interpolation (Catmull-Rom).
SEED_POINT_PLACEMENT
Enumeration of seed point placement policy.
@ PLACE_SEED_ON_CLICK
A seed point is placed on click (event start).
@ PLACE_SEED_WHILE_DRAGGING
Seed points are placed while dragging.
GENERAL_CREATION_MODE
Enumeration of the module's general creation mode.
@ CREATION_MODE_OPEN_FREEHAND
Open spline approximation: finish on release only.
@ CREATION_MODE_CLOSED_SPLINE
Closed spline interpolation: place seed on click, double click and release for closing available.
@ CREATION_MODE_OPEN_POLYLINE
Open linear interpolation: finish on double click or number of seeds available.
@ CREATION_MODE_CLOSED_POLYLINE
Closed linear interpolation: place seed on click, double click and release for closing available.
@ CREATION_MODE_CLOSED_INTERPOLATION
Closed spline interpolation: place seed continuously, release for closing only.
@ CREATION_MODE_CLOSED_FREEHAND
Closed spline approximation: place seed continuously, release for closing only.
@ CREATION_MODE_OPEN_SPLINE
Open spline interpolation: finish on double click or number of seeds available.
@ CREATION_MODE_POINT
Point: sets a single point. The resulting CSO consists of one seed point and a circular path.