22#include <Inventor/misc/SoRef.h>
60class CSOVisualizationSettings;
185 ml::AbstractTransformationPtr
getTransformation(
const ml::CoordinateSystemReference&
from,
const ml::CoordinateSystemReference&
to);
187 bool isSameImage(
const ml::CoordinateSystemReference&
from,
const ml::CoordinateSystemReference&
to);
207 ONLY_ON_IMAGES_THEY_WERE_CREATED_ON = 1,
208 ONLY_ON_IMAGES_THEY_WERE_NOT_CREATED_ON = 2,
209 ONLY_ON_IMAGES_THEY_CAN_BE_TRANSFORMED_TO = 3
269 bool _activeCreatorEditorDirty;
273 SbVec3f _currentPointerWorldPosition;
274 SbVec3f _startPointerWorldPosition;
275 int _currentTimePointIndex;
277 void storeCopiedCSOGroupInformation();
280 void setActionsEnabled();
281 void setKeyboardActionsEnabled();
282 void setTriggerFieldsToActions();
284 void toggleCancelCommandIsActive();
285 void togglePasteCommandIsActive();
286 void toggleCutCopyCommandIsActive();
287 void toggleUndoCommandIsActive();
288 void toggleRedoCommandIsActive();
289 void toggleDeleteCSOCommandIsActive();
290 void toggleDeleteSeedPointCommandIsActive();
291 void toggleRemoveAllCommandIsActive();
293 bool areKeyboardCommandsActive() {
return isEditingOn() && keyCommandsEnabled.getValue(); }
295 bool isInteracting();
297 void copySelectedCSOs();
299 void copySelectedCSOsToInternalList(
ml::CSOList* csoList);
300 void cutSelectedCSOs();
303 void deleteSelectedCSOs();
304 void deleteSelectedSeedPoint();
309 void removeAllCSOsAndGroups();
311 SbVec3f getMidPointSelectedCSOs();
318 void resetCreatingAndEditingFields();
319 void resetAllExtensionCaches();
320 void resetAllEditorsAndCaches();
325 ml::TransformationProvider* _transformationProvider;
339 int _interactionMode;
355 std::vector < ml::CSO* > _copiedCSOs;
356 std::map < int, std::vector< int > > _copiedCSOGroupIds;
359 unsigned int _prevWheelCode;
370 struct SlabCacheEntry
375 csoListGeometryChangeId = 0;
380 csoListGeometryChangeId = 0;
387 std::vector<CSOVoxelSlab> csoSlabs;
391 std::deque<SlabCacheEntry*> _csoSlabCache;
#define SOCSO_EXPORT
Header file for system independent resolution.
std::vector< SoRef< SoCSOEditorExtension > > ExtensionList
Extensible editor for CSOs.
View2DEventPhase
event phase for simple extensions that grab the focus, do something (motion) and are released afterwa...
Action for creating CSOs.
Extension for rendering CSOs.
Base class for an editor extension for the SoView2DCSOExtensibleEditor.
SoPointerPosition manages the current position of the mouse cursor.
The SoSFMLBase field is the interface used by Inventor Nodes to output ML Base objects to the outside...
void inTransformationProviderChanged(SoField *)
ml::CSOVisualizationSettings * getVisualizationSettings()
Returns the pointer to a optionally attached CSOVisualizationSettings object.
void transformCSO(ml::CSO *cso, const ml::AbstractTransformationPtr &transformation)
Transforms the given CSO on base of registration information.
void draw(View2DSliceList *slicelist, View2DSlice *slice, int sliceZ) override
Renders by calling the draw-method of all attached extensions.
ml::CoordinateSystemReference getCoordinateSystemReference(const CSODrawView2DInfos &view2DInfos)
bool shouldShowCSOForCurrentTimePoint(const CSODrawView2DInfos &view2DInfos, ml::CSO *cso)
Returns whether the given CSO should be rendered for the current time point.
ml::AbstractTransformationPtr getRegistrationInformation(const SoPointerPosition &pos, ml::CSO *cso)
Returns a registration if it exists for the given CSO on the given image (as a SoPointerPosition),...
bool hasRegistrationInformation(const SoPointerPosition &pos, ml::CSO *cso)
Returns whether a registration exists.
SoSFBool isCreatingNewCSO
Flag shows whether any editor is currently creating a new CSO.
ml::CSOList * getInputCSOList()
Returns a pointer to the input CSOList or NULL if nothing valid is attached.
SoSFBool renderLeftOverCSOsWithDefaultRenderer
Shall the CSOs that were not rendered by an attached editor be rendered by a default renderer?
SoSFString creatorExtensionId
The unique id of an editor extension that receives the create events.
SoSFBool alwaysModifyExistingCSOs
Shall always be selected and modified and never created?
SoCSODefaultRenderer * getDefaultRenderer()
Returns the default renderer.
int getInteractionModifier() const
Returns the interaction mode as determined by a pointing action.
void toggleCancelCommandIsActiveForModifications(bool isActive)
Toggles the activation of the cancel command without any additional checks; to be used with care and ...
void isCreatingOrEditingChanged(SoField *)
bool shouldShowCSORegardingParallelState(const CSODrawSliceInformation &sliceInfo, const CSODrawView2DInfos &view2DInfos, ml::CSO *cso)
Returns whether the given CSO should be rendered regarding its parallel state.
SoCSOEditorExtension * getActiveEditor() const
Returns the attached editor that is active for creating new CSOs (or NULL if there is not any).
bool shouldShowCSOBeyondSlice(const CSODrawSliceInformation &sliceInfo, const CSODrawView2DInfos &view2DInfos, ml::CSO *cso)
Returns whether the given CSO should be rendered beyond the current slice.
SoSFBool keyCommandsEnabled
Shall the key commands be enabled?
void resetLastActiveEditor()
Resets the active editor to the last active editor if it was set.
void startDrawing(View2DSliceList *slicelist) override
Is called before drawing to initialize editors.
SoSFBool enableRemoveAll
Shall the removeAll-key command be available?
SoCSOTransform * _csoTransform
Global transformation for visualization.
void setInteractionModifier(int mode)
Sets the interaction mode as determined by a pointing action.
void pointerPosition(const SoPointerPosition &pos) override
Is called on moving the mouse, sets the CSO id under the cursor.
SoSFBool interactOnlyWithSelectedCSO
Shall only a selected CSO be allow to be interacted with?
void notifyEditorsOfMouseWheelEvent(SoMouseWheelEvent::Orientation orientation, int turn, View2DEvent *ec)
bool isSelectionAllowedWithDefaultRenderer() const
Returns whether a CSO can be selected by the internal default renderer.
static void csoListNotificationCB(void *userData, int notificationFlag)
Is called by CSOList notifications.
SoSFNode inExtensions
Input field for extensions.
void setActiveEditor(SoCSOEditorExtension *editor, bool storeLastEditor=true)
Sets the active editor, use this only to temporarily set a modification editor.
SoSFBool isEditingExistingCSO
Flag shows whether any editor is currently editing/modifying an existing CSO.
SoSFMLBase inCSOList
Input field for CSOList.
SoSFEnum renderCSOsOnImagesDependingOnCreationMode
Defines on which images the CSOs should be rendered on, depending on where they have been created.
ml::CoordinateSystemReference getCoordinateSystemReference(ml::CSO *cso)
bool shouldShowCSOOnImageWithId(const CSODrawView2DInfos &view2DInfos, ml::CSO *cso)
Returns whether the given CSO should be rendered on a particular image, identified by its DICOM Serie...
void cancel()
Cancels the current interaction.
bool hasTransformationProvider() const
Returns if the editor has a transformation provider.
SoSFBool updateImageStatisticsOnFinishInteraction
Should the image statistics be updated for the currently active CSO on finishing an interaction (mous...
SoSFInt32 csoIdUnderMouseCursor
The id of the CSO currently under the mouse (or -1 if no CSO is under the mouse).
void buttonMaskChanged(SoField *) override
called when one of the button/modifier fields is touched:
void setCSOUnderTheMouseId(int id)
Sets the csoUnderTheMouseId field, only if the id changes.
void fillCSOSliceInformation(const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, CSODrawSliceInformation &sliceInfo, const ml::Matrix4 &worldToVoxelMatrix, const CSOVoxelSlab &csoSlab)
Fills the relation of the given CSO to the current slice.
SoView2DCSOExtensibleEditor()
Constructor.
ml::CoordinateSystemReference getCoordinateSystemReference(SoView2D *viewer)
bool isSameImage(const ml::CoordinateSystemReference &from, const ml::CoordinateSystemReference &to)
Returns whether the given coordinate references reference the same image.
void interactOnlyWithSelectedCSOChanged(SoField *)
SoSFBool allowSelectionWithDefaultRenderer
Shall the CSOs be selectable by the internal default renderer?
SoSFBool updateCSOIdUnderMouseCursor
Shall the cso id under the mouse cursor be updated?
void doAction(SoAction *action) override
Overloading to obtain and set the SoCSOTransform.
bool evalEvent(SoView2D *view2d, View2DSliceList *slicelist, View2DEvent *ec, View2DEventPhase phase) override
Called by the SoView2D for each event that happens on the viewer.
bool shouldShowCSOAtAll(ml::CSO *cso)
Returns whether the given CSO should be rendered at all, that is whether its shows state is true and ...
ml::CoordinateSystemReference getCoordinateSystemReference(const SoPointerPosition &pos)
void stopEditingCSO()
Sets the isEditingExistingCSO field to FALSE.
void cancelGenerationChanged(SoField *)
void setCreateActionTrigger(const SoPointingAction::Trigger &trigger)
Sets the CSOCreateAction trigger.
SoSFBool alwaysCreateNewCSOs
Shall always be created and never selected and modified?
void getExtensions(ExtensionList &extensions)
Collects attached extensions to the given list.
void extensionChanged(SoField *)
New field change callbacks:
CSORenderOnImagesDependingOnCreationModes
Modes to control the rendering of CSOs depending on the images they were created on.
std::string getDefaultCreatorString() const
Returns a default creator id string that indicates that the first found editor should create CSOs.
void setCreateActionTriggerToDefault()
Sets the CSOCreateAction trigger to its default, according to the trigger fields.
SoSFMLBase inVisualizationSettings
Input of visualization settings.
void startEditingCSO(const SoPointerPosition &pos, ml::CSO *cso)
Sets the isEditingExistingCSO field to TRUE and stores the current viewer's name in the CSO's userDat...
void pointerLeftWindow() override
Is called when mouse pointer leaves the window.
void editingOnChanged(SoField *) override
Inherited from SoView2DExtension:
SoSFMLBase inTransformationProvider
Input of provided transformations.
static void initClass()
Initialization of inventor stuff.
SoSFTrigger cancelGeneration
Triggers the cancellation of the current generation.
ml::AbstractTransformationPtr getTransformation(const ml::CoordinateSystemReference &from, const ml::CoordinateSystemReference &to)
Returns a transformation if existing, NULL otherwise.
~SoView2DCSOExtensibleEditor() override
Destructor.
SoView2DExtension Base class for all View2DExtensions used for drawing and event handling on the View...
virtual bool isEditingOn()
check if editing is on
SoView2D is a 2D viewer for image data.
View2DEvent stores all information on an event on a SoView2D.
a list that holds all View2DSlice objects (lazily created) of a SoView2D
a single slice that is stored in a View2DSliceList, typically created by a View2DSliceList
The CSOBoundingBox defines an axis parallel bounding box with double precision.
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...
The CSOSeedPoint can be interactively set and modified and is the framework for contours.
The CSO represents a contour segmentation object.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
UINT64 MLuint64
Introduce platform independent 64 bit unsigned integer type.
Defines the z slab of a CSO bounding box in voxel coordinates.