MeVisLab Toolbox Reference
SoView2DCSOExtensibleEditor Class Reference

#include <SoView2DCSOExtensibleEditor.h>

Inheritance diagram for SoView2DCSOExtensibleEditor:
SoView2DExtension SoInteractionProviderNode SoInteractionOwner SoInteractionProvider

Public Types

enum  CSORenderOnImagesDependingOnCreationModes { ON_ALL_IMAGES = 0 , ONLY_ON_IMAGES_THEY_WERE_CREATED_ON = 1 , ONLY_ON_IMAGES_THEY_WERE_NOT_CREATED_ON = 2 , ONLY_ON_IMAGES_THEY_CAN_BE_TRANSFORMED_TO = 3 }
 Modes to control the rendering of CSOs depending on the images they were created on. More...
 
- Public Types inherited from SoView2DExtension
enum  Sign { ZERO , NEGATIVE , POSITIVE }
 defines the sign of a number, with zero as an extra value More...
 
- Public Types inherited from SoInteractionProvider
typedef SoInteractionProvider *(* GetProviderFunc) (SoNode *)
 

Public Member Functions

 SoView2DCSOExtensibleEditor ()
 Constructor. More...
 
void getExtensions (ExtensionList &extensions)
 Collects attached extensions to the given list. More...
 
ml::CSOListgetInputCSOList ()
 Returns a pointer to the input CSOList or NULL if nothing valid is attached. More...
 
std::string getDefaultCreatorString () const
 Returns a default creator id string that indicates that the first found editor should create CSOs. More...
 
void pointerLeftWindow () override
 Is called when mouse pointer leaves the window. More...
 
void pointerPosition (const SoPointerPosition &pos) override
 Is called on moving the mouse, sets the CSO id under the cursor. More...
 
ml::CSOVisualizationSettingsgetVisualizationSettings ()
 Returns the pointer to a optionally attached CSOVisualizationSettings object. More...
 
SoCSOEditorExtensiongetActiveEditor () const
 Returns the attached editor that is active for creating new CSOs (or NULL if there is not any). More...
 
void setActiveEditor (SoCSOEditorExtension *editor, bool storeLastEditor=true)
 Sets the active editor, use this only to temporarily set a modification editor. More...
 
void resetLastActiveEditor ()
 Resets the active editor to the last active editor if it was set. More...
 
SoCSODefaultRenderergetDefaultRenderer ()
 Returns the default renderer. More...
 
void setInteractionModifier (int mode)
 Sets the interaction mode as determined by a pointing action. More...
 
int getInteractionModifier () const
 Returns the interaction mode as determined by a pointing action. More...
 
void setCSOUnderTheMouseId (int id)
 Sets the csoUnderTheMouseId field, only if the id changes. More...
 
bool shouldShowCSOAtAll (ml::CSO *cso)
 Returns whether the given CSO should be rendered at all, that is whether its shows state is true and its eventual CSOGroup's show state is true. More...
 
bool shouldShowCSOForCurrentTimePoint (const CSODrawView2DInfos &view2DInfos, ml::CSO *cso)
 Returns whether the given CSO should be rendered for the current time point. More...
 
bool shouldShowCSORegardingParallelState (const CSODrawSliceInformation &sliceInfo, const CSODrawView2DInfos &view2DInfos, ml::CSO *cso)
 Returns whether the given CSO should be rendered regarding its parallel state. More...
 
bool shouldShowCSOBeyondSlice (const CSODrawSliceInformation &sliceInfo, const CSODrawView2DInfos &view2DInfos, ml::CSO *cso)
 Returns whether the given CSO should be rendered beyond the current slice. More...
 
bool shouldShowCSOOnImageWithId (const CSODrawView2DInfos &view2DInfos, ml::CSO *cso)
 Returns whether the given CSO should be rendered on a particular image, identified by its DICOM SeriesInstanceUID. More...
 
bool hasRegistrationInformation (const SoPointerPosition &pos, ml::CSO *cso)
 Returns whether a registration exists. More...
 
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), or NULL. More...
 
bool hasTransformationProvider () const
 Returns if the editor has a transformation provider. More...
 
ml::AbstractTransformationPtr getTransformation (const ml::CoordinateSystemReference &from, const ml::CoordinateSystemReference &to)
 Returns a transformation if existing, NULL otherwise. More...
 
bool isSameImage (const ml::CoordinateSystemReference &from, const ml::CoordinateSystemReference &to)
 Returns whether the given coordinate references reference the same image. More...
 
void transformCSO (ml::CSO *cso, const ml::AbstractTransformationPtr &transformation)
 Transforms the given CSO on base of registration information. More...
 
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. More...
 
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 userData. More...
 
void stopEditingCSO ()
 Sets the isEditingExistingCSO field to FALSE. More...
 
void toggleCancelCommandIsActiveForModifications (bool isActive)
 Toggles the activation of the cancel command without any additional checks; to be used with care and for modification editors. More...
 
bool isSelectionAllowedWithDefaultRenderer () const
 Returns whether a CSO can be selected by the internal default renderer. More...
 
void setCreateActionTrigger (const SoPointingAction::Trigger &trigger)
 Sets the CSOCreateAction trigger. More...
 
void setCreateActionTriggerToDefault ()
 Sets the CSOCreateAction trigger to its default, according to the trigger fields. More...
 
void cancel ()
 Cancels the current interaction. More...
 
ml::CoordinateSystemReference getCoordinateSystemReference (ml::CSO *cso)
 
ml::CoordinateSystemReference getCoordinateSystemReference (SoView2D *viewer)
 
ml::CoordinateSystemReference getCoordinateSystemReference (const CSODrawView2DInfos &view2DInfos)
 
ml::CoordinateSystemReference getCoordinateSystemReference (const SoPointerPosition &pos)
 
- Public Member Functions inherited from SoView2DExtension
 SoView2DExtension ()
 Constructor. More...
 
void init ()
 setup internal state More...
 
virtual void updateValues ()
 Update fields to local variables, may be reimplemented if you want to update additional local vars. More...
 
virtual void endDrawing (View2DSliceList *)
 
virtual void overwriteDrawingSettings (SoView2DDrawingSettings &)
 
View2DEventgetEvent ()
 get the current event (when inside of evalEvent) More...
 
float getSelectDist ()
 Set the distance tolerance on hit checking in pixels. More...
 
bool isPointInsideDeviceRect (float pointX, float pointY, float centerX, float centerY, float hitRectangleSize=0.0)
 returns whether the given point is inside a rectangle around the given center. More...
 
void drawMiniRect (float xp, float yp, float ext, float lineWidth=1.f)
 Draws a small rectangle with given half side length and a line width. More...
 
void drawDashedMiniRect (float xp, float yp, float ext, float lineWidth)
 
void drawFilledMiniRect (float xp, float yp, float ext, float lineWidth=1.f)
 Draws a small filled rectangle with given half side length. More...
 
void drawMiniTriangle (float xp, float yp, float ext, float lineWidth=1.f)
 Draws a small triangle with given center point, half height and line width. More...
 
void drawFilledMiniTriangle (float xp, float yp, float ext, float lineWidth=1.f)
 Draws a small filled triangle with given center point and half height. More...
 
void drawMiniCircle (float xp, float yp, float ext, float lineWidth=1.f)
 Draws a small circle with given center point and radius. More...
 
void drawFilledMiniCircle (float xp, float yp, float ext, float lineWidth=1.f)
 Draws a small filled circle with given center point and radius. More...
 
void drawFixedSizeMiniCircleAt (float xp, float yp)
 Draws a fixed size small circle at the given position. More...
 
void drawVoxelBorder (View2DSlice *slice, float vx, float vy, float vz)
 surround the given voxel with a border More...
 
int getX ()
 get the x device position of current event, only returns valid result when called inside of evalEvent() More...
 
int getY ()
 get the y device position of current event, only returns valid result when called inside of evalEvent() More...
 
virtual bool isDrawingOn ()
 check if drawing is on More...
 
virtual bool isEditingOn ()
 check if editing is on More...
 
virtual bool isFixZOn ()
 check if z should stay fixed More...
 
virtual bool isClipToSlice ()
 check if the image is clipped to slice More...
 
virtual void fieldChanged (SoSensor *sensor)
 handle if any field has changed More...
 
bool isCreateNewMode ()
 check if extension is in createNewMode More...
 
void setCreateNewMode (bool flag)
 set this extension to create new objects More...
 
bool isCreateNewModeRequest ()
 check if extension has a request for createNewMode More...
 
void setCreateNewModeRequest (bool flag)
 set that extension want to become createNewMode More...
 
virtual bool isActive ()
 returns if the extension is active (derive this method in child) (in createNewMode or with a selected object)(called by SoView2D) More...
 
virtual void deleteSelectedObject ()
 deletes the currently active object (derive this method in child) (called by SoView2D) More...
 
virtual void getStatusString (SbString &status)
 get the current status of this extension More...
 
virtual bool evaluateEvent (SoView2D *view2d, View2DEvent *ec)
 
virtual bool ignoreEvent (View2DEvent *ec)
 Return true if ec has been handled before and if ignoreHandledEvents is True. More...
 
bool wantsMouseOverUpdates () const
 public access to _wantsMouseOverUpdateEvents More...
 
virtual void consumeEvent (View2DEvent *ec, bool handled=TRUE)
 Set handled-flag of ec to true (= consumed) if handled is True and setEventHandled is True. More...
 
int getSelectedModifierMask ()
 Get compare and ignore mask for the currently selected button/modifier combination, usable with SoPointingAction. More...
 
int getSelectedIgnoreMask ()
 
SoPointingAction::Trigger getPointingActionTriggerFromFields ()
 Get the trigger that matches the button/modifier field state. More...
 
virtual bool implementsManagedInteractionAndClassicEventHandling () const
 return true if this node is a hybrid module providing managed interaction and classic event handling - in this case SoView2D::useManagedInteraction decides which one to use More...
 
- Public Member Functions inherited from SoInteractionProviderNode
 SoInteractionProviderNode ()
 Default constructor. More...
 
 ~SoInteractionProviderNode () override
 Destructor. More...
 
std::string getID () const override
 Returns the id string for identifying the provider (and its actions) - this is usually the name of the scene node. More...
 
void objRef () override
 Memory management by reference counting; must be implemented in derived classes. More...
 
void objUnref () override
 
- Public Member Functions inherited from SoInteractionOwner
 SoInteractionOwner ()
 Default constructor. More...
 
 ~SoInteractionOwner () override
 The destructor will destroy all interactions created with this object as owner. More...
 
std::list< SoInteraction * > getInteractions (SoState *state) override
 Returns the list of all interactions of this provider. More...
 
void pointerPosition (SoState *state, const SoPointerPosition &pos) override
 Same as below, with additional SoState argument. Be defaults simply calls the below version. More...
 
void pointerLeftWindow (SoState *state) override
 Same as below, with additional SoState argument. Be defaults simply calls the below version. More...
 
void addListener (SoInteractionOwnerListenerInterface *listener)
 Add a listener object that is notified of changes in the interaction list. More...
 
void removeListener (SoInteractionOwnerListenerInterface *listener)
 Remove a listener object that was notified of changes in the interaction list. More...
 
- Public Member Functions inherited from SoInteractionProvider
 SoInteractionProvider ()
 Default constructor. More...
 
virtual ~SoInteractionProvider ()
 
template<class T >
std::list< T * > getInteractionsOfType (SoState *state)
 Returns list of interactions of a specific type: More...
 
virtual std::list< SoCommandAction * > getCommandActions (SoState *state)
 
virtual std::list< SoPointingAction * > getPointingActions (SoState *state)
 
virtual std::list< SoOffsetAction * > getOffsetActions (SoState *state)
 

Static Public Member Functions

static void initClass ()
 Initialization of inventor stuff. More...
 
- Static Public Member Functions inherited from SoView2DExtension
static void initClass ()
 Initializes this class. More...
 
static float snapToPixelCenter (float coordinateComponent)
 Snaps the coordinate component to the pixel center. More...
 
static void fieldChangedCB (void *data, SoSensor *sensor)
 inventor callbacks if any field has changed, calls fieldChanged More...
 
static bool isImageParallel (SoSFMLImage *image, View2DSliceList *dsl)
 Return true if image is parallel to the image of the slice list up to slice thickness. More...
 
static void enableLineStippling (const SoSFEnum &lineStyleField)
 Set/reset stippling pattern. More...
 
static void disableLineStippling (const SoSFEnum &lineStyleField)
 
static void getAxisOrientation (int axis, SbMatrix &matrix, char &negativeResult, char &positiveResult)
 Geometry helpers. More...
 
static float pointToLineDistance (SbVec3f point, SbVec3f line1, SbVec3f line2)
 calculate 3D point to line distance More...
 
static float pointToLineDistance (SbVec2f point, SbVec2f line1, SbVec2f line2)
 calculate 2D point to line distance More...
 
static Sign edgeIntersectWithPlane (const SbVec3f &v1, const SbVec3f &v2, const SbPlane &plane, SbVec3f &intersect)
 intersect given edge from v1 to v2 with given plane, returns sign and intersect point More...
 
- Static Public Member Functions inherited from SoInteractionProviderNode
static void initClass ()
 Initializes this class. More...
 
- Static Public Member Functions inherited from SoInteractionProvider
static void registerInteractionProviderNode (SoType type, GetProviderFunc func)
 Register a function to obtain a SoInteractionProvider from a SoNode. More...
 
static SoInteractionProvidergetInteractionProvider (SoNode *node)
 Get a SoInteractionProvider from a SoNode if registered, else NULL. More...
 

Public Attributes

SoSFMLBase inCSOList
 Input field for CSOList. More...
 
SoSFNode inExtensions
 Input field for extensions. More...
 
SoSFMLBase inVisualizationSettings
 Input of visualization settings. More...
 
SoSFMLBase inTransformationProvider
 Input of provided transformations. More...
 
SoSFString creatorExtensionId
 The unique id of an editor extension that receives the create events. More...
 
SoSFBool interactOnlyWithSelectedCSO
 Shall only a selected CSO be allow to be interacted with? More...
 
SoSFBool alwaysCreateNewCSOs
 Shall always be created and never selected and modified? More...
 
SoSFBool alwaysModifyExistingCSOs
 Shall always be selected and modified and never created? More...
 
SoSFBool keyCommandsEnabled
 Shall the key commands be enabled? More...
 
SoSFBool enableRemoveAll
 Shall the removeAll-key command be available? More...
 
SoSFBool renderLeftOverCSOsWithDefaultRenderer
 Shall the CSOs that were not rendered by an attached editor be rendered by a default renderer? More...
 
SoSFBool allowSelectionWithDefaultRenderer
 Shall the CSOs be selectable by the internal default renderer? More...
 
SoSFEnum renderCSOsOnImagesDependingOnCreationMode
 Defines on which images the CSOs should be rendered on, depending on where they have been created. More...
 
SoSFBool updateCSOIdUnderMouseCursor
 Shall the cso id under the mouse cursor be updated? More...
 
SoSFInt32 csoIdUnderMouseCursor
 The id of the CSO currently under the mouse (or -1 if no CSO is under the mouse). More...
 
SoSFBool isCreatingNewCSO
 Flag shows whether any editor is currently creating a new CSO. More...
 
SoSFBool isEditingExistingCSO
 Flag shows whether any editor is currently editing/modifying an existing CSO. More...
 
SoSFTrigger cancelGeneration
 Triggers the cancellation of the current generation. More...
 
SoSFBool updateImageStatisticsOnFinishInteraction
 Should the image statistics be updated for the currently active CSO on finishing an interaction (mouse up)? More...
 
- Public Attributes inherited from SoView2DExtension
SoSFColor color
 color that should be used for drawing More...
 
SoSFBool drawingOn
 flag if the extension should draw, needs to be checked inside of the draw() method More...
 
SoSFBool editingOn
 flag if the extension should edit objects on mouse events, needs to be checked inside of the evalEvent() method More...
 
SoSFBool maskValid
 flag if the event mask is valid. More...
 
SoSFFloat selectionTolerance
 the selection tolerance in pixels More...
 
SoSFBool wantsAllEvents
 flag if ALL events should be passed to evalEvent(), if disabled, events are only passed to evalEvent when the mouse mask gets valid More...
 
SoSFBool wantsKeyEvents
 flag if keyboard events should be passed to evalEvent() More...
 
SoSFBool wantsMouseWheelEvents
 flag if MouseWheel events should be passed to evalEvent() More...
 
SoSFBool setEventHandled
 Set event handled if it is indeed handled by this extension. More...
 
SoSFBool ignoreHandledEvents
 Ignore events, that have been handled by previous extensions. More...
 
SoSFEnum button1
 mouse mask for button1 More...
 
SoSFEnum button2
 mouse mask for button2 More...
 
SoSFEnum button3
 mouse mask for button3 More...
 
SoSFEnum shift
 shift modifier for mouse mask More...
 
SoSFEnum control
 shift control for mouse mask More...
 
SoSFEnum alt
 shift alt for mouse mask More...
 
SoSFBool needsValidVoxel
 sets if a valid voxel must be hit to get evalEvent() calls More...
 
SoSFBool renderOnSlab
 defines if the extension should be rendered on all slab slices More...
 
SoSFBool createNewMode
 flag if extension is in createNewMode More...
 
SoSFTrigger createNewModeRequest
 
SoSFBool clipToSlice
 Flag to clip drawing to slice. More...
 
SoSFEnum cursorShape
 Set cursor shape if the mouse mask fits and mouseEvents are effectively sent to evalEvent for editing. More...
 
SoSFBool fixZOn
 DEPRECATED flag that indicates that the extension should fix the z value, only used in SoView2DRectangle. More...
 
- Public Attributes inherited from SoInteractionProviderNode
SoSFString instanceName
 Defines interface field to store the instance name. More...
 
SoSFString interactionProviderID
 This field overrides the instanceName as providerID if specified. More...
 

Protected Member Functions

 ~SoView2DCSOExtensibleEditor () override
 Destructor. More...
 
void startDrawing (View2DSliceList *slicelist) override
 Is called before drawing to initialize editors. More...
 
void draw (View2DSliceList *slicelist, View2DSlice *slice, int sliceZ) override
 Renders by calling the draw-method of all attached extensions. More...
 
bool evalEvent (SoView2D *view2d, View2DSliceList *slicelist, View2DEvent *ec, View2DEventPhase phase) override
 Called by the SoView2D for each event that happens on the viewer. More...
 
void notifyEditorsOfMouseWheelEvent (SoMouseWheelEvent::Orientation orientation, int turn, View2DEvent *ec)
 
void editingOnChanged (SoField *) override
 Inherited from SoView2DExtension: More...
 
void buttonMaskChanged (SoField *) override
 called when one of the button/modifier fields is touched: More...
 
void extensionChanged (SoField *)
 New field change callbacks: More...
 
void interactOnlyWithSelectedCSOChanged (SoField *)
 
void inTransformationProviderChanged (SoField *)
 
void cancelGenerationChanged (SoField *)
 
void isCreatingOrEditingChanged (SoField *)
 
void doAction (SoAction *action) override
 Overloading to obtain and set the SoCSOTransform. More...
 
- Protected Member Functions inherited from SoView2DExtension
virtual void createNewModeRequestTriggered (SoField *)
 called when createNewModeRequest field ist touched: More...
 
 ~SoView2DExtension () override
 destructor More...
 
void GLRender (SoGLRenderAction *action) override
 Inventor actions. More...
 
void callback (SoCallbackAction *action) override
 
void handleEvent (SoHandleEventAction *action) override
 
void getMatrix (SoGetMatrixAction *action) override
 
void getBoundingBox (SoGetBoundingBoxAction *action) override
 
void pick (SoPickAction *action) override
 
void doAction (SoAction *action) override
 
- Protected Member Functions inherited from SoInteractionOwner
bool hasInteractions () const
 Returns whether there are any actions defined by this owner. More...
 
template<class T >
bool hasInteractionsOfType () const
 Same as above, but asking for a specific type of interaction. More...
 
void addPointingAction (SoPointingAction *)
 
void addCommandAction (SoCommandAction *)
 
void addOffsetAction (SoOffsetAction *)
 

Static Protected Member Functions

static void csoListNotificationCB (void *userData, int notificationFlag)
 Is called by CSOList notifications. More...
 

Protected Attributes

SoCSOTransform_csoTransform
 Global transformation for visualization. More...
 
- Protected Attributes inherited from SoView2DExtension
SoNodeSensor * _nodeSensor
 node sensor that is used to notice field changes More...
 
float _rgbColor [4]
 Color of the object, update on each field change by _nodeSensor. More...
 
bool _wantsMouseOverUpdateEvents
 set this flag to receive mouse over events while the extension is active More...
 

Friends

class CSOCopyCommandAction
 
class CSOCutCommandAction
 
class CSOPasteCommandAction
 
class CSODeleteSeedPointCommandAction
 
class CSODeleteCSOCommandAction
 
class CSOUndoCommandAction
 
class CSORedoCommandAction
 
class CSORemoveAllCommandAction
 
bool SoCSOEditorTools::evaluateHitPoint (const ml::Vector3 &worldPosition, View2DSliceList *slicelist, ml::CSOList *csoList, const ml::CSOBoundingBox &slabBB, const std::string &subType, SoView2DCSOExtensibleEditor *editor, bool testSeedPoints, ml::CSO *&localHitCSO, ml::CSOSeedPoint *&localHitSeedPoint, ml::CSOPathPoints *&localHitPathPoints, float &distance)
 

Detailed Description

Definition at line 73 of file SoView2DCSOExtensibleEditor.h.

Member Enumeration Documentation

◆ CSORenderOnImagesDependingOnCreationModes

Modes to control the rendering of CSOs depending on the images they were created on.

Enumerator
ON_ALL_IMAGES 

Render CSOs on all images.

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.

ONLY_ON_IMAGES_THEY_CAN_BE_TRANSFORMED_TO 

Render CSOs only on images they can be transformed to.

Definition at line 204 of file SoView2DCSOExtensibleEditor.h.

Constructor & Destructor Documentation

◆ SoView2DCSOExtensibleEditor()

SoView2DCSOExtensibleEditor::SoView2DCSOExtensibleEditor ( )

Constructor.

◆ ~SoView2DCSOExtensibleEditor()

SoView2DCSOExtensibleEditor::~SoView2DCSOExtensibleEditor ( )
overrideprotected

Destructor.

Member Function Documentation

◆ buttonMaskChanged()

void SoView2DCSOExtensibleEditor::buttonMaskChanged ( SoField *  )
overrideprotectedvirtual

called when one of the button/modifier fields is touched:

Reimplemented from SoView2DExtension.

◆ cancel()

void SoView2DCSOExtensibleEditor::cancel ( )

Cancels the current interaction.

◆ cancelGenerationChanged()

void SoView2DCSOExtensibleEditor::cancelGenerationChanged ( SoField *  )
protected

◆ csoListNotificationCB()

static void SoView2DCSOExtensibleEditor::csoListNotificationCB ( void *  userData,
int  notificationFlag 
)
staticprotected

Is called by CSOList notifications.

◆ doAction()

void SoView2DCSOExtensibleEditor::doAction ( SoAction *  action)
overrideprotected

Overloading to obtain and set the SoCSOTransform.

◆ draw()

void SoView2DCSOExtensibleEditor::draw ( View2DSliceList slicelist,
View2DSlice slice,
int  sliceZ 
)
overrideprotectedvirtual

Renders by calling the draw-method of all attached extensions.

Reimplemented from SoView2DExtension.

◆ editingOnChanged()

void SoView2DCSOExtensibleEditor::editingOnChanged ( SoField *  )
overrideprotectedvirtual

Inherited from SoView2DExtension:

Reimplemented from SoView2DExtension.

◆ evalEvent()

bool SoView2DCSOExtensibleEditor::evalEvent ( SoView2D view2d,
View2DSliceList slicelist,
View2DEvent ec,
View2DEventPhase  phase 
)
overrideprotectedvirtual

Called by the SoView2D for each event that happens on the viewer.

Implement this method if you want to handle events. If this method is called depends on the fields wantsAllEvents, wantsKeyEvents, wantsMouseWheelEvents and the mouse mask given by button1, button2, button3, shift, control, alt. When using the mouse mask (when wantsAllEvents is set to false), the View2DEventPhase indicates in which phase of the mouse mask you are in.

Reimplemented from SoView2DExtension.

◆ extensionChanged()

void SoView2DCSOExtensibleEditor::extensionChanged ( SoField *  )
protected

New field change callbacks:

◆ fillCSOSliceInformation()

void SoView2DCSOExtensibleEditor::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.

◆ getActiveEditor()

SoCSOEditorExtension* SoView2DCSOExtensibleEditor::getActiveEditor ( ) const

Returns the attached editor that is active for creating new CSOs (or NULL if there is not any).

◆ getCoordinateSystemReference() [1/4]

ml::CoordinateSystemReference SoView2DCSOExtensibleEditor::getCoordinateSystemReference ( const CSODrawView2DInfos view2DInfos)

◆ getCoordinateSystemReference() [2/4]

ml::CoordinateSystemReference SoView2DCSOExtensibleEditor::getCoordinateSystemReference ( const SoPointerPosition pos)

◆ getCoordinateSystemReference() [3/4]

ml::CoordinateSystemReference SoView2DCSOExtensibleEditor::getCoordinateSystemReference ( ml::CSO cso)

Returns a coordinate system reference for the given object.

◆ getCoordinateSystemReference() [4/4]

ml::CoordinateSystemReference SoView2DCSOExtensibleEditor::getCoordinateSystemReference ( SoView2D viewer)

◆ getDefaultCreatorString()

std::string SoView2DCSOExtensibleEditor::getDefaultCreatorString ( ) const
inline

Returns a default creator id string that indicates that the first found editor should create CSOs.

Definition at line 131 of file SoView2DCSOExtensibleEditor.h.

◆ getDefaultRenderer()

SoCSODefaultRenderer* SoView2DCSOExtensibleEditor::getDefaultRenderer ( )

Returns the default renderer.

◆ getExtensions()

void SoView2DCSOExtensibleEditor::getExtensions ( ExtensionList extensions)

Collects attached extensions to the given list.

◆ getInputCSOList()

ml::CSOList* SoView2DCSOExtensibleEditor::getInputCSOList ( )

Returns a pointer to the input CSOList or NULL if nothing valid is attached.

◆ getInteractionModifier()

int SoView2DCSOExtensibleEditor::getInteractionModifier ( ) const
inline

Returns the interaction mode as determined by a pointing action.

Definition at line 154 of file SoView2DCSOExtensibleEditor.h.

◆ getRegistrationInformation()

ml::AbstractTransformationPtr SoView2DCSOExtensibleEditor::getRegistrationInformation ( const SoPointerPosition pos,
ml::CSO cso 
)

Returns a registration if it exists for the given CSO on the given image (as a SoPointerPosition), or NULL.

◆ getTransformation()

ml::AbstractTransformationPtr SoView2DCSOExtensibleEditor::getTransformation ( const ml::CoordinateSystemReference &  from,
const ml::CoordinateSystemReference &  to 
)

Returns a transformation if existing, NULL otherwise.

◆ getVisualizationSettings()

ml::CSOVisualizationSettings* SoView2DCSOExtensibleEditor::getVisualizationSettings ( )

Returns the pointer to a optionally attached CSOVisualizationSettings object.

◆ hasRegistrationInformation()

bool SoView2DCSOExtensibleEditor::hasRegistrationInformation ( const SoPointerPosition pos,
ml::CSO cso 
)

Returns whether a registration exists.

◆ hasTransformationProvider()

bool SoView2DCSOExtensibleEditor::hasTransformationProvider ( ) const
inline

Returns if the editor has a transformation provider.

Definition at line 183 of file SoView2DCSOExtensibleEditor.h.

◆ initClass()

static void SoView2DCSOExtensibleEditor::initClass ( )
static

Initialization of inventor stuff.

◆ interactOnlyWithSelectedCSOChanged()

void SoView2DCSOExtensibleEditor::interactOnlyWithSelectedCSOChanged ( SoField *  )
protected

◆ inTransformationProviderChanged()

void SoView2DCSOExtensibleEditor::inTransformationProviderChanged ( SoField *  )
protected

◆ isCreatingOrEditingChanged()

void SoView2DCSOExtensibleEditor::isCreatingOrEditingChanged ( SoField *  )
protected

◆ isSameImage()

bool SoView2DCSOExtensibleEditor::isSameImage ( const ml::CoordinateSystemReference &  from,
const ml::CoordinateSystemReference &  to 
)

Returns whether the given coordinate references reference the same image.

◆ isSelectionAllowedWithDefaultRenderer()

bool SoView2DCSOExtensibleEditor::isSelectionAllowedWithDefaultRenderer ( ) const
inline

Returns whether a CSO can be selected by the internal default renderer.

Definition at line 217 of file SoView2DCSOExtensibleEditor.h.

◆ notifyEditorsOfMouseWheelEvent()

void SoView2DCSOExtensibleEditor::notifyEditorsOfMouseWheelEvent ( SoMouseWheelEvent::Orientation  orientation,
int  turn,
View2DEvent ec 
)
protected

◆ pointerLeftWindow()

void SoView2DCSOExtensibleEditor::pointerLeftWindow ( )
overridevirtual

Is called when mouse pointer leaves the window.

Reimplemented from SoInteractionOwner.

◆ pointerPosition()

void SoView2DCSOExtensibleEditor::pointerPosition ( const SoPointerPosition pos)
overridevirtual

Is called on moving the mouse, sets the CSO id under the cursor.

Reimplemented from SoInteractionOwner.

◆ resetLastActiveEditor()

void SoView2DCSOExtensibleEditor::resetLastActiveEditor ( )

Resets the active editor to the last active editor if it was set.

Use this after a modification editor had set the active editor (with storeLastEditor=true) and is now done.

◆ setActiveEditor()

void SoView2DCSOExtensibleEditor::setActiveEditor ( SoCSOEditorExtension editor,
bool  storeLastEditor = true 
)

Sets the active editor, use this only to temporarily set a modification editor.

The currently active editor is saved and can be reset by calling resetLastActiveEditor.

◆ setCreateActionTrigger()

void SoView2DCSOExtensibleEditor::setCreateActionTrigger ( const SoPointingAction::Trigger trigger)

Sets the CSOCreateAction trigger.

This should be used by SoCSOEditorExtensions which define an additional CSOAbstractCreateAction when being activated.

◆ setCreateActionTriggerToDefault()

void SoView2DCSOExtensibleEditor::setCreateActionTriggerToDefault ( )

Sets the CSOCreateAction trigger to its default, according to the trigger fields.

This should be used by SoCSOEditorExtensions which define an additional CSOAbstractCreateAction when being deactivated.

◆ setCSOUnderTheMouseId()

void SoView2DCSOExtensibleEditor::setCSOUnderTheMouseId ( int  id)

Sets the csoUnderTheMouseId field, only if the id changes.

◆ setInteractionModifier()

void SoView2DCSOExtensibleEditor::setInteractionModifier ( int  mode)
inline

Sets the interaction mode as determined by a pointing action.

Definition at line 152 of file SoView2DCSOExtensibleEditor.h.

◆ shouldShowCSOAtAll()

bool SoView2DCSOExtensibleEditor::shouldShowCSOAtAll ( ml::CSO cso)

Returns whether the given CSO should be rendered at all, that is whether its shows state is true and its eventual CSOGroup's show state is true.

◆ shouldShowCSOBeyondSlice()

bool SoView2DCSOExtensibleEditor::shouldShowCSOBeyondSlice ( const CSODrawSliceInformation sliceInfo,
const CSODrawView2DInfos view2DInfos,
ml::CSO cso 
)

Returns whether the given CSO should be rendered beyond the current slice.

◆ shouldShowCSOForCurrentTimePoint()

bool SoView2DCSOExtensibleEditor::shouldShowCSOForCurrentTimePoint ( const CSODrawView2DInfos view2DInfos,
ml::CSO cso 
)

Returns whether the given CSO should be rendered for the current time point.

The decision depends on the visualization settings.

◆ shouldShowCSOOnImageWithId()

bool SoView2DCSOExtensibleEditor::shouldShowCSOOnImageWithId ( const CSODrawView2DInfos view2DInfos,
ml::CSO cso 
)

Returns whether the given CSO should be rendered on a particular image, identified by its DICOM SeriesInstanceUID.

◆ shouldShowCSORegardingParallelState()

bool SoView2DCSOExtensibleEditor::shouldShowCSORegardingParallelState ( const CSODrawSliceInformation sliceInfo,
const CSODrawView2DInfos view2DInfos,
ml::CSO cso 
)

Returns whether the given CSO should be rendered regarding its parallel state.

◆ startDrawing()

void SoView2DCSOExtensibleEditor::startDrawing ( View2DSliceList slicelist)
overrideprotectedvirtual

Is called before drawing to initialize editors.

Reimplemented from SoView2DExtension.

◆ startEditingCSO()

void SoView2DCSOExtensibleEditor::startEditingCSO ( const SoPointerPosition pos,
ml::CSO cso 
)

Sets the isEditingExistingCSO field to TRUE and stores the current viewer's name in the CSO's userData.

◆ stopEditingCSO()

void SoView2DCSOExtensibleEditor::stopEditingCSO ( )

Sets the isEditingExistingCSO field to FALSE.

◆ toggleCancelCommandIsActiveForModifications()

void SoView2DCSOExtensibleEditor::toggleCancelCommandIsActiveForModifications ( bool  isActive)

Toggles the activation of the cancel command without any additional checks; to be used with care and for modification editors.

◆ transformCSO()

void SoView2DCSOExtensibleEditor::transformCSO ( ml::CSO cso,
const ml::AbstractTransformationPtr &  transformation 
)

Transforms the given CSO on base of registration information.

Note that the original coordinate information gets lost by transforming.

Friends And Related Function Documentation

◆ CSOCopyCommandAction

friend class CSOCopyCommandAction
friend

Definition at line 400 of file SoView2DCSOExtensibleEditor.h.

◆ CSOCutCommandAction

friend class CSOCutCommandAction
friend

Definition at line 401 of file SoView2DCSOExtensibleEditor.h.

◆ CSODeleteCSOCommandAction

friend class CSODeleteCSOCommandAction
friend

Definition at line 405 of file SoView2DCSOExtensibleEditor.h.

◆ CSODeleteSeedPointCommandAction

friend class CSODeleteSeedPointCommandAction
friend

Definition at line 404 of file SoView2DCSOExtensibleEditor.h.

◆ CSOPasteCommandAction

friend class CSOPasteCommandAction
friend

Definition at line 402 of file SoView2DCSOExtensibleEditor.h.

◆ CSORedoCommandAction

friend class CSORedoCommandAction
friend

Definition at line 408 of file SoView2DCSOExtensibleEditor.h.

◆ CSORemoveAllCommandAction

friend class CSORemoveAllCommandAction
friend

Definition at line 410 of file SoView2DCSOExtensibleEditor.h.

◆ CSOUndoCommandAction

friend class CSOUndoCommandAction
friend

Definition at line 407 of file SoView2DCSOExtensibleEditor.h.

◆ SoCSOEditorTools::evaluateHitPoint

bool SoCSOEditorTools::evaluateHitPoint ( const ml::Vector3 worldPosition,
View2DSliceList slicelist,
ml::CSOList csoList,
const ml::CSOBoundingBox slabBB,
const std::string &  subType,
SoView2DCSOExtensibleEditor editor,
bool  testSeedPoints,
ml::CSO *&  localHitCSO,
ml::CSOSeedPoint *&  localHitSeedPoint,
ml::CSOPathPoints *&  localHitPathPoints,
float &  distance 
)
friend

Member Data Documentation

◆ _csoTransform

SoCSOTransform* SoView2DCSOExtensibleEditor::_csoTransform
protected

Global transformation for visualization.

Definition at line 262 of file SoView2DCSOExtensibleEditor.h.

◆ allowSelectionWithDefaultRenderer

SoSFBool SoView2DCSOExtensibleEditor::allowSelectionWithDefaultRenderer

Shall the CSOs be selectable by the internal default renderer?

Definition at line 107 of file SoView2DCSOExtensibleEditor.h.

◆ alwaysCreateNewCSOs

SoSFBool SoView2DCSOExtensibleEditor::alwaysCreateNewCSOs

Shall always be created and never selected and modified?

Definition at line 96 of file SoView2DCSOExtensibleEditor.h.

◆ alwaysModifyExistingCSOs

SoSFBool SoView2DCSOExtensibleEditor::alwaysModifyExistingCSOs

Shall always be selected and modified and never created?

Definition at line 98 of file SoView2DCSOExtensibleEditor.h.

◆ cancelGeneration

SoSFTrigger SoView2DCSOExtensibleEditor::cancelGeneration

Triggers the cancellation of the current generation.

Definition at line 120 of file SoView2DCSOExtensibleEditor.h.

◆ creatorExtensionId

SoSFString SoView2DCSOExtensibleEditor::creatorExtensionId

The unique id of an editor extension that receives the create events.

Definition at line 92 of file SoView2DCSOExtensibleEditor.h.

◆ csoIdUnderMouseCursor

SoSFInt32 SoView2DCSOExtensibleEditor::csoIdUnderMouseCursor

The id of the CSO currently under the mouse (or -1 if no CSO is under the mouse).

Definition at line 114 of file SoView2DCSOExtensibleEditor.h.

◆ enableRemoveAll

SoSFBool SoView2DCSOExtensibleEditor::enableRemoveAll

Shall the removeAll-key command be available?

Definition at line 102 of file SoView2DCSOExtensibleEditor.h.

◆ inCSOList

SoSFMLBase SoView2DCSOExtensibleEditor::inCSOList

Input field for CSOList.

Definition at line 83 of file SoView2DCSOExtensibleEditor.h.

◆ inExtensions

SoSFNode SoView2DCSOExtensibleEditor::inExtensions

Input field for extensions.

Definition at line 85 of file SoView2DCSOExtensibleEditor.h.

◆ interactOnlyWithSelectedCSO

SoSFBool SoView2DCSOExtensibleEditor::interactOnlyWithSelectedCSO

Shall only a selected CSO be allow to be interacted with?

Definition at line 94 of file SoView2DCSOExtensibleEditor.h.

◆ inTransformationProvider

SoSFMLBase SoView2DCSOExtensibleEditor::inTransformationProvider

Input of provided transformations.

Definition at line 89 of file SoView2DCSOExtensibleEditor.h.

◆ inVisualizationSettings

SoSFMLBase SoView2DCSOExtensibleEditor::inVisualizationSettings

Input of visualization settings.

Definition at line 87 of file SoView2DCSOExtensibleEditor.h.

◆ isCreatingNewCSO

SoSFBool SoView2DCSOExtensibleEditor::isCreatingNewCSO

Flag shows whether any editor is currently creating a new CSO.

Definition at line 116 of file SoView2DCSOExtensibleEditor.h.

◆ isEditingExistingCSO

SoSFBool SoView2DCSOExtensibleEditor::isEditingExistingCSO

Flag shows whether any editor is currently editing/modifying an existing CSO.

Definition at line 118 of file SoView2DCSOExtensibleEditor.h.

◆ keyCommandsEnabled

SoSFBool SoView2DCSOExtensibleEditor::keyCommandsEnabled

Shall the key commands be enabled?

Definition at line 100 of file SoView2DCSOExtensibleEditor.h.

◆ renderCSOsOnImagesDependingOnCreationMode

SoSFEnum SoView2DCSOExtensibleEditor::renderCSOsOnImagesDependingOnCreationMode

Defines on which images the CSOs should be rendered on, depending on where they have been created.

Definition at line 110 of file SoView2DCSOExtensibleEditor.h.

◆ renderLeftOverCSOsWithDefaultRenderer

SoSFBool SoView2DCSOExtensibleEditor::renderLeftOverCSOsWithDefaultRenderer

Shall the CSOs that were not rendered by an attached editor be rendered by a default renderer?

Definition at line 105 of file SoView2DCSOExtensibleEditor.h.

◆ updateCSOIdUnderMouseCursor

SoSFBool SoView2DCSOExtensibleEditor::updateCSOIdUnderMouseCursor

Shall the cso id under the mouse cursor be updated?

Definition at line 112 of file SoView2DCSOExtensibleEditor.h.

◆ updateImageStatisticsOnFinishInteraction

SoSFBool SoView2DCSOExtensibleEditor::updateImageStatisticsOnFinishInteraction

Should the image statistics be updated for the currently active CSO on finishing an interaction (mouse up)?

Definition at line 123 of file SoView2DCSOExtensibleEditor.h.


The documentation for this class was generated from the following file: