22#include <Inventor/misc/SoRef.h>
60class CSOVisualizationSettings;
189 ml::AbstractTransformationPtr
getTransformation(
const ml::CoordinateSystemReference& from,
const ml::CoordinateSystemReference& to);
191 bool isSameImage(
const ml::CoordinateSystemReference& from,
const ml::CoordinateSystemReference& to);
273 SoRef<SoCSODefaultRenderer> _defaultRenderer;
275 bool _activeCreatorEditorDirty;
277 void _inCSOListCB(SoField*);
279 SbVec3f _currentPointerWorldPosition;
280 SbVec3f _startPointerWorldPosition;
281 int _currentTimePointIndex;
283 void storeCopiedCSOGroupInformation();
286 void setActionsEnabled();
287 void setKeyboardActionsEnabled();
288 void setTriggerFieldsToActions();
290 void toggleCancelCommandIsActive();
291 void togglePasteCommandIsActive();
292 void toggleCutCopyCommandIsActive();
293 void toggleUndoCommandIsActive();
294 void toggleRedoCommandIsActive();
295 void toggleDeleteCSOCommandIsActive();
296 void toggleDeleteSeedPointCommandIsActive();
297 void toggleRemoveAllCommandIsActive();
301 bool isInteracting();
303 void copySelectedCSOs();
305 void copySelectedCSOsToInternalList(
ml::CSOList* csoList);
306 void cutSelectedCSOs();
309 void deleteSelectedCSOs();
310 void deleteSelectedSeedPoint();
315 void removeAllCSOsAndGroups();
317 SbVec3f getMidPointSelectedCSOs();
319 void getNonActiveEditorExtensionIds(std::vector <std::string>& nonActiveEditorExtensions);
324 void resetCreatingAndEditingFields();
325 void resetAllExtensionCaches();
326 void resetAllEditorsAndCaches();
331 ml::TransformationProvider* _transformationProvider;
334 SoRef<SoCSOEditorExtension> _activeEditor;
335 SoRef<SoCSOEditorExtension> _lastActiveEditor;
345 int _interactionMode;
361 std::vector < ml::CSO* > _copiedCSOs;
362 std::map < int, std::vector< int > > _copiedCSOGroupIds;
365 unsigned int _prevWheelCode;
376 struct SlabCacheEntry
381 csoListGeometryChangeId = 0;
386 csoListGeometryChangeId = 0;
393 std::vector<CSOVoxelSlab> csoSlabs;
397 std::deque<SlabCacheEntry*> _csoSlabCache;
399 const SlabCacheEntry& findOrCreateSlabCache(
const ml::Matrix4& worldToVoxelMatrix,
size_t matrixHashKey, ml::CSOList* list);
402 void notifyCSOListObservers(ml::CSOList* csoList);
#define SOCSO_EXPORT
Header file for system independent resolution.
std::vector< SoRef< SoCSOEditorExtension > > ExtensionList
Extensible editor for CSOs.
Action for creating CSOs.
Extension for rendering CSOs.
void pointerPosition(SoState *state, const SoPointerPosition &pos) override
Same as below, with additional SoState argument. By default, simply calls the below version.
void pointerLeftWindow(SoState *state) override
Same as below, with additional SoState argument. By defaults, simply calls the below version.
SoPointerPosition manages the current position of the mouse cursor.
ManagedMouseButtonTrigger Trigger
void inTransformationProviderChanged(SoField *)
ml::CSOVisualizationSettings * getVisualizationSettings()
Returns the pointer to a optionally attached CSOVisualizationSettings object.
friend class CSORemoveAllCommandAction
friend class CSODeleteCSOCommandAction
void transformCSO(ml::CSO *cso, const ml::AbstractTransformationPtr &transformation)
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)
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),...
friend class CSOCopyCommandAction
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
SoSFString creatorExtensionId
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)
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 accumulateTransformations
Flag to decide whether CSOTransform modules in the secene graph should be accumulated (or the last on...
SoSFBool keyCommandsEnabled
Shall the key commands be enabled?
void resetLastActiveEditor()
void startDrawing(View2DSliceList *slicelist) override
Is called before drawing to initialize editors.
SoSFBool enableRemoveAll
Shall the removeAll-key command be available?
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)
SoSFBool isEditingExistingCSO
Flag shows whether any editor is currently editing/modifying an existing CSO.
SoSFMLBase inCSOList
Input field for CSOList.
SoSFEnum renderCSOsOnImagesDependingOnCreationMode
friend class CSOUndoCommandAction
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.
friend class CSOPasteCommandAction
SoSFBool updateImageStatisticsOnFinishInteraction
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)
std::vector< SoCSOTransform * > _csoTransforms
Global transformation for visualization.
ml::CoordinateSystemReference getCoordinateSystemReference(const SoPointerPosition &pos)
friend class CSOCutCommandAction
bool shouldShowCSOOnViewerWithId(const CSODrawView2DInfos &view2DInfos, ml::CSO *cso)
Return whether the given CSO should be rendered on a particular viewer, identified by its viewerId.
void stopEditingCSO()
Sets the isEditingExistingCSO field to FALSE.
friend class CSODeleteSeedPointCommandAction
void cancelGenerationChanged(SoField *)
friend class CSORedoCommandAction
void setCreateActionTrigger(const SoPointingAction::Trigger &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
@ ON_ALL_IMAGES
Render CSOs on all images.
@ ONLY_ON_IMAGES_THEY_CAN_BE_TRANSFORMED_TO
Render CSOs only on images they can be transformed to.
@ ONLY_ON_IMAGES_THEY_WERE_CREATED_ON
Render CSOs on only image with the same imageInstanceSOP id that is stored in the CSO user data.
@ ONLY_ON_IMAGES_THEY_WERE_NOT_CREATED_ON
Render CSOs only on images with a different imageInstaceSOP id.
std::string getDefaultCreatorString() const
void setCreateActionTriggerToDefault()
SoSFMLBase inVisualizationSettings
Input of visualization settings.
void startEditingCSO(const SoPointerPosition &pos, ml::CSO *cso)
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.
virtual bool isActive()
returns if the extension is active (derive this method in child) (in createNewMode or with a selected...
SoView2DExtension()
Constructor.
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.
UINT64 MLuint64
Introduce platform-independent 64-bit unsigned integer type.
Tmat4< MLdouble > Matrix4
The standard 4x4 matrix of type double.
Tvec3< MLdouble > Vector3
A vector with three components of type double.
Defines the z slab of a CSO bounding box in voxel coordinates.