SoView2DMarkerEditor Class Reference

SoView2DMarkerEditor is a geometry editor that stores markers in a XMarkerList and allows editing of these. More...

#include <SoView2DMarkerEditor.h>

Inheritance diagram for SoView2DMarkerEditor:

SoView2DExtension

List of all members.

Public Types

enum  vectorDragMode { VECTOR_DRAG_OFF = 0, VECTOR_DRAG_STARTPOINT = 1, VECTOR_DRAG_ENDPOINT = 2 }
 mode of the editor for new objects More...
enum  editorModeType { EDIT_VECTOR = 0, EDIT_MARKER = 1, EDIT_OBJECT = 2 }
 mode of the editor for new objects More...
enum  drawModeType {
  DRAW_VECTOR = 0, DRAW_MARKER, DRAW_DISC, DRAW_SPHERE,
  DRAW_VECTOR_AND_DISC
}
 draw mode of the editor More...
enum  editorColorType { COLOR_BY_INDEX = 0, COLOR_BY_TYPE = 1, COLOR_BY_ID = 2 }
 type of color used for markers More...
enum  textColorType { COLOR_LIKE_MARKER = 0, COLOR_TEXT = 1 }
 type of color for text labels More...
enum  textModeType {
  TEXT_OFF, TEXT_STYLEINDEX, TEXT_STYLENAME, TEXT_ITEMNAME,
  TEXT_ITEMID, TEXT_VOXELPOS, TEXT_WORLDPOS, TEXT_LENGTH,
  TEXT_MARKERTYPE, TEXT_MARKERLISTINDEX
}
 type of text printed at markers More...
enum  textPositionType {
  TEXT_POSITION_CENTER, TEXT_POSITION_ABOVE, TEXT_POSITION_RIGHT_ABOVE, TEXT_POSITION_RIGHT,
  TEXT_POSITION_RIGHT_BELOW, TEXT_POSITION_BELOW, TEXT_POSITION_LEFT_BELOW, TEXT_POSITION_LEFT,
  TEXT_POSITION_LEFT_ABOVE
}
 position for text printed at markers More...
enum  vectorArrowType {
  VECTOR_NO_ARROWS = 0, VECTOR_END_ARROW = 1, VECTOR_START_ARROW = 2, VECTOR_BOTH_ARROWS = 3,
  VECTOR_PLUS_MINUS = 4, VECTOR_PM_WITH_ARR = 5, BOX_START_TO_END = 6, BOX_PLUS_MINUS = 7
}
 type of drawn arrows More...
enum  depthVectorDrawType { DRAW_NONE, DRAW_DEPTH_INDICATOR, DRAW_HIGHLIGHT_SLICE_SEGMENT, DRAW_BOLD }
 type of vector drawing in depth More...

Public Member Functions

 SoView2DMarkerEditor ()
 Constructor.
void draw (View2DSliceList *dsl, View2DSlice *dslice, int slice)
 reimplemented from SoView2DExtension
bool evalEvent (SoView2D *view2d, View2DSliceList *slicelist, View2DEvent *ec, View2DEventPhase phase)
 reimplemented from SoView2DExtension
void deleteSelectedObject ()
 delete the selected object
bool isActive ()
 returns if the editor is active
void setupIcons ()
 setup the icons from an icon file
bool ignoreEvent (View2DEvent *ec)
 Overwrite ignoreEvent -> ignore the "ignoreHandledEvents"-Field.

Static Public Member Functions

static void initClass ()
 Inventor runtime type system.
static bool handleNotificationCB (void *usrData, ml::Field *field)
 callback from the XMarkerListContainer's handleNotification

Public Attributes

SoSFInt32 depthVisibility
 defines on how many voxel neighboring z voxel the markers are visible
SoSFBool snapToVoxel
 sets if the markers snap to the center of a voxel
SoSFEnum editorMode
 select the mode for creation of new object
SoSFBool deleteOnClick
 set if markers are deleted on click
SoSFBool addOnClick
 flag for permitting adding of markers
SoSFBool selectingOn
 flag to set if it is possible to select a marker
SoSFBool actOnReleaseOnly
 flag to add a marker on mouse release only, not on mouse press
SoSFEnum colorMode
 choose the mode of the color for markers
SoSFEnum textMode
 choose the mode of the text for markers
SoSFEnum textPosition
 choose the position mode of the text for markers
SoSFEnum textColorMode
 choose the color of the text for markers
SoSFColor textColor
 extra text color, depends on textColorMode if it is used
SoSFBool textShadow
 flag if text shadow should be drawn
SoSFInt32 textFontSize
 font size of text
SoSFBool showTextOnlyForSelectedMarker
 show text only for selected marker;
SoSFBool cutText
 cut text after a maximum number of lines (defined by "maxNumberOfLines")
SoSFInt32 maxNumberOfLines
 choose the maximum number of lines of text, if "cutText" is turned on
SoSFEnum vectorArrow
 choose how vector arrows are drawn
SoSFFloat alphaFactor
 alpha factor applied to all markers
SoSFInt32 currentType
 current type of marker (used for new markers)
SoSFMLBase outputMLModule
 hybrid ML module requires a field named "outputMLModule" for MeVisLab to be able to use the ML module
SoSFMLBase stylePalette
 input style palette
SoSFBool useIconFile
 set if the icon file should be used
SoSFInt32 iconIdx
 set the initial index inside of the icon file
SoSFString iconFile
 name of the icon file (with $() vars)
SoSFString internalIconFile
 expanded (real) icon file path
SoSFInt32 currentStyleIndex
 styleindex of the activated object referring to the stylepalette
SoSFEnum depthVectorDrawMode
 defines certain draw modes
SoSFEnum drawMode
 defines the visualization mode of the marker
SoSFBool useAntiAlias
 toggles the use of anti aliasing (openGL).
SoSFBool selectiveDrawing
 if this option is turned on, only the current marker is drawn in the selected draw mode All other markers are drawn as simple markers (this may be useful if there are too many markers lying together)
SoSFBool selectionBoxesForCurrentOnly
 If this option is turned on, selection boxes are only drawn for the current marker (Requested in support forum: UsingMevisLab->"Turning off selection markers of arrows in SoView2DMarkerEditor").
SoSFBool cooperative
 If "cooperative"-mode is turned on clicks besides the current markers (+ "Selection Tolerance") are ignored, except when "CreateMode" is turned on This can be used to handle the parallel editing of more than one marker editor (or other view2d extensions reacting on mouse events -> SoView2dPosition, SoView2dRectangle).
SoSFBool busy
 This field shows if an operation like moving a marker around is finished (e.g.
SoSFBool snapToSlice
 sets if the markers snap to the current slice when they are moved

Protected Member Functions

int calculateCurrentStyleIndex ()
 Calculates and returns the current style index for the selected marker depending on the colormode.
bool evalEventForDrawnObject (SoView2D *view2d, View2DSliceList *slicelist, View2DEvent *ec, View2DEventPhase phase)
 Evaluates mouse events for the more complex visualizations of marker like spheres and discs.
int isDiscHit (SoView2D *view2D, const ml::vec3 &cursorPosition, View2DSliceList *slicelist)
 Checks if any of the markers interpreted as discs is hit by the "cursorPosition".
int isSphereHit (SoView2D *view2D, const ml::vec3 &cursorPosition, View2DSliceList *slicelist)
 Checks if any of the markers interpreted as spheres is hit by the "cursorPosition".
int isBoxHit (SoView2D *view2D, const ml::vec3 &cursorPosition, View2DSliceList *slicelist)
 Checks if any of the markers interpreted as boxes is hit by the "cursorPosition".
void resizeObject (const ml::vec3 &startCursorPosition, const ml::vec3 &endCursorPosition, ml::XMarkerList *markers)
 Resizes the selected marker depending on the mouse movement from "startCursorPosition" to "endCursorPosition".
void moveObject (const ml::vec3 &startCursorPosition, const ml::vec3 &endCursorPosition, ml::XMarkerList *markers)
 Moves the selected marker depending on the mouse movement from "startCursorPosition" to "endCursorPosition".
bool isDepthVisible (float depthValue)
 Checks if the given value is within the depthVisibility.
bool isDiscVisible (ml::Disc *disc, View2DSliceList *slicelist, int slice)
 Checks if the given "disc" is visible in the given slice.
bool isSphereVisible (View2DSliceList *slicelist, const ml::vec3 &center, float radius, int slice)
 Checks if the sphere defined by "center" and "radius" is visible in the given slice.
void drawVector (const ml::vec3 &vec1, const ml::vec3 &vec2, View2DSliceList *dsl, View2DSlice *dslice, int slice, bool selected, int iconindex, int index=0)
 Draws a single vector defined by "vec1", "vec2".
void drawMarker (float px, float py, int size, bool selected, int iconindex)
 Draws a single marker, defined by "(px,py)" and "size".
void drawSphere (ml::Sphere *s, View2DSliceList *dsl, View2DSlice *dslice, int slice, float r, float g, float b, bool bHighlight, float alphaFactor=1.0f)
 Draws a single sphere "s".
void drawDisc (ml::Disc *d, View2DSliceList *dsl, View2DSlice *dslice, int slice, float r, float g, float b, bool bHighlight, float alphaFactor=1.0f)
 Draws a single disc "d".
void updatePalette ()
 updates the stylepalette depending on the currently connected stylepalette

Protected Attributes

ml::vec3 _eventStartposition
MLssize_t _selectedObjectIndex
int _objectEdited
bool _pointDragged
 flag if a point is dragged
vectorDragMode _vectorDragged
 mode of the current drag
ml::ListBase::ActionClass _currAction
 The current (last) action performed on the associated markerlist.
long _currIndex
 current selected marker index in the associated markerlist
ml::XMarker _currItem
 current selected marker object in the associated markerlist
View2DIcons_icons
 texture icons used for markers
ml::XMarkerListContainer _container
 internal XMarkerListContainer used to store markers
ml::StylePalette_palette
 input style palette


Detailed Description

SoView2DMarkerEditor is a geometry editor that stores markers in a XMarkerList and allows editing of these.

This module is a hybrid module which inherits the fields from the ml::XMarkerList container inside of MeVisLab

Author:
Lars Borneman

Definition at line 59 of file SoView2DMarkerEditor.h.


Member Enumeration Documentation

type of vector drawing in depth

Enumerator:
DRAW_NONE 
DRAW_DEPTH_INDICATOR 
DRAW_HIGHLIGHT_SLICE_SEGMENT 
DRAW_BOLD  DRAW_BOLD added to draw e.g.

thick boxes suitable for screenshots used for presentation / publications

Definition at line 161 of file SoView2DMarkerEditor.h.

draw mode of the editor

Enumerator:
DRAW_VECTOR 
DRAW_MARKER 
DRAW_DISC 
DRAW_SPHERE 
DRAW_VECTOR_AND_DISC 

Definition at line 80 of file SoView2DMarkerEditor.h.

type of color used for markers

Enumerator:
COLOR_BY_INDEX 
COLOR_BY_TYPE 
COLOR_BY_ID 

Definition at line 90 of file SoView2DMarkerEditor.h.

mode of the editor for new objects

Enumerator:
EDIT_VECTOR 
EDIT_MARKER 
EDIT_OBJECT 

Definition at line 73 of file SoView2DMarkerEditor.h.

type of color for text labels

Enumerator:
COLOR_LIKE_MARKER 
COLOR_TEXT 

Definition at line 97 of file SoView2DMarkerEditor.h.

type of text printed at markers

Enumerator:
TEXT_OFF 
TEXT_STYLEINDEX 
TEXT_STYLENAME 
TEXT_ITEMNAME 
TEXT_ITEMID 
TEXT_VOXELPOS 
TEXT_WORLDPOS 
TEXT_LENGTH 
TEXT_MARKERTYPE 
TEXT_MARKERLISTINDEX 

Definition at line 103 of file SoView2DMarkerEditor.h.

position for text printed at markers

Enumerator:
TEXT_POSITION_CENTER 
TEXT_POSITION_ABOVE 
TEXT_POSITION_RIGHT_ABOVE 
TEXT_POSITION_RIGHT 
TEXT_POSITION_RIGHT_BELOW 
TEXT_POSITION_BELOW 
TEXT_POSITION_LEFT_BELOW 
TEXT_POSITION_LEFT 
TEXT_POSITION_LEFT_ABOVE 

Definition at line 117 of file SoView2DMarkerEditor.h.

type of drawn arrows

Enumerator:
VECTOR_NO_ARROWS 
VECTOR_END_ARROW 
VECTOR_START_ARROW 
VECTOR_BOTH_ARROWS 
VECTOR_PLUS_MINUS 
VECTOR_PM_WITH_ARR 
BOX_START_TO_END 
BOX_PLUS_MINUS 

Definition at line 130 of file SoView2DMarkerEditor.h.

mode of the editor for new objects

Enumerator:
VECTOR_DRAG_OFF 
VECTOR_DRAG_STARTPOINT 
VECTOR_DRAG_ENDPOINT 

Definition at line 66 of file SoView2DMarkerEditor.h.


Constructor & Destructor Documentation

SoView2DMarkerEditor::SoView2DMarkerEditor (  ) 

Constructor.


Member Function Documentation

int SoView2DMarkerEditor::calculateCurrentStyleIndex (  )  [protected]

Calculates and returns the current style index for the selected marker depending on the colormode.

void SoView2DMarkerEditor::deleteSelectedObject (  )  [virtual]

delete the selected object

Reimplemented from SoView2DExtension.

void SoView2DMarkerEditor::draw ( View2DSliceList dsl,
View2DSlice dslice,
int  slice 
) [virtual]

reimplemented from SoView2DExtension

Reimplemented from SoView2DExtension.

void SoView2DMarkerEditor::drawDisc ( ml::Disc d,
View2DSliceList dsl,
View2DSlice dslice,
int  slice,
float  r,
float  g,
float  b,
bool  bHighlight,
float  alphaFactor = 1.0f 
) [protected]

Draws a single disc "d".

void SoView2DMarkerEditor::drawMarker ( float  px,
float  py,
int  size,
bool  selected,
int  iconindex 
) [protected]

Draws a single marker, defined by "(px,py)" and "size".

void SoView2DMarkerEditor::drawSphere ( ml::Sphere s,
View2DSliceList dsl,
View2DSlice dslice,
int  slice,
float  r,
float  g,
float  b,
bool  bHighlight,
float  alphaFactor = 1.0f 
) [protected]

Draws a single sphere "s".

void SoView2DMarkerEditor::drawVector ( const ml::vec3 vec1,
const ml::vec3 vec2,
View2DSliceList dsl,
View2DSlice dslice,
int  slice,
bool  selected,
int  iconindex,
int  index = 0 
) [protected]

Draws a single vector defined by "vec1", "vec2".

bool SoView2DMarkerEditor::evalEvent ( SoView2D view2d,
View2DSliceList slicelist,
View2DEvent ec,
View2DEventPhase  phase 
) [virtual]

reimplemented from SoView2DExtension

Reimplemented from SoView2DExtension.

bool SoView2DMarkerEditor::evalEventForDrawnObject ( SoView2D view2d,
View2DSliceList slicelist,
View2DEvent ec,
View2DEventPhase  phase 
) [protected]

Evaluates mouse events for the more complex visualizations of marker like spheres and discs.

static bool SoView2DMarkerEditor::handleNotificationCB ( void *  usrData,
ml::Field field 
) [static]

callback from the XMarkerListContainer's handleNotification

bool SoView2DMarkerEditor::ignoreEvent ( View2DEvent ec  )  [virtual]

Overwrite ignoreEvent -> ignore the "ignoreHandledEvents"-Field.

Reimplemented from SoView2DExtension.

static void SoView2DMarkerEditor::initClass (  )  [static]

Inventor runtime type system.

Reimplemented from SoView2DExtension.

bool SoView2DMarkerEditor::isActive (  )  [virtual]

returns if the editor is active

Reimplemented from SoView2DExtension.

int SoView2DMarkerEditor::isBoxHit ( SoView2D view2D,
const ml::vec3 cursorPosition,
View2DSliceList slicelist 
) [protected]

Checks if any of the markers interpreted as boxes is hit by the "cursorPosition".

bool SoView2DMarkerEditor::isDepthVisible ( float  depthValue  )  [protected]

Checks if the given value is within the depthVisibility.

int SoView2DMarkerEditor::isDiscHit ( SoView2D view2D,
const ml::vec3 cursorPosition,
View2DSliceList slicelist 
) [protected]

Checks if any of the markers interpreted as discs is hit by the "cursorPosition".

bool SoView2DMarkerEditor::isDiscVisible ( ml::Disc disc,
View2DSliceList slicelist,
int  slice 
) [protected]

Checks if the given "disc" is visible in the given slice.

int SoView2DMarkerEditor::isSphereHit ( SoView2D view2D,
const ml::vec3 cursorPosition,
View2DSliceList slicelist 
) [protected]

Checks if any of the markers interpreted as spheres is hit by the "cursorPosition".

bool SoView2DMarkerEditor::isSphereVisible ( View2DSliceList slicelist,
const ml::vec3 center,
float  radius,
int  slice 
) [protected]

Checks if the sphere defined by "center" and "radius" is visible in the given slice.

void SoView2DMarkerEditor::moveObject ( const ml::vec3 startCursorPosition,
const ml::vec3 endCursorPosition,
ml::XMarkerList markers 
) [protected]

Moves the selected marker depending on the mouse movement from "startCursorPosition" to "endCursorPosition".

void SoView2DMarkerEditor::resizeObject ( const ml::vec3 startCursorPosition,
const ml::vec3 endCursorPosition,
ml::XMarkerList markers 
) [protected]

Resizes the selected marker depending on the mouse movement from "startCursorPosition" to "endCursorPosition".

void SoView2DMarkerEditor::setupIcons (  ) 

setup the icons from an icon file

void SoView2DMarkerEditor::updatePalette (  )  [protected]

updates the stylepalette depending on the currently connected stylepalette


Member Data Documentation

internal XMarkerListContainer used to store markers

Definition at line 329 of file SoView2DMarkerEditor.h.

The current (last) action performed on the associated markerlist.

Definition at line 319 of file SoView2DMarkerEditor.h.

current selected marker index in the associated markerlist

Definition at line 321 of file SoView2DMarkerEditor.h.

current selected marker object in the associated markerlist

Definition at line 323 of file SoView2DMarkerEditor.h.

Definition at line 307 of file SoView2DMarkerEditor.h.

texture icons used for markers

Definition at line 326 of file SoView2DMarkerEditor.h.

Definition at line 311 of file SoView2DMarkerEditor.h.

input style palette

Definition at line 331 of file SoView2DMarkerEditor.h.

flag if a point is dragged

Definition at line 314 of file SoView2DMarkerEditor.h.

Definition at line 309 of file SoView2DMarkerEditor.h.

mode of the current drag

Definition at line 316 of file SoView2DMarkerEditor.h.

flag to add a marker on mouse release only, not on mouse press

Definition at line 192 of file SoView2DMarkerEditor.h.

flag for permitting adding of markers

Definition at line 186 of file SoView2DMarkerEditor.h.

alpha factor applied to all markers

Definition at line 221 of file SoView2DMarkerEditor.h.

This field shows if an operation like moving a marker around is finished (e.g.

after a RELEASE event) or not This information can be used to avoid reacting on every change of the positions when a marker is moved around

Definition at line 270 of file SoView2DMarkerEditor.h.

choose the mode of the color for markers

Definition at line 195 of file SoView2DMarkerEditor.h.

If "cooperative"-mode is turned on clicks besides the current markers (+ "Selection Tolerance") are ignored, except when "CreateMode" is turned on This can be used to handle the parallel editing of more than one marker editor (or other view2d extensions reacting on mouse events -> SoView2dPosition, SoView2dRectangle).

Definition at line 266 of file SoView2DMarkerEditor.h.

styleindex of the activated object referring to the stylepalette

Definition at line 243 of file SoView2DMarkerEditor.h.

current type of marker (used for new markers)

Definition at line 224 of file SoView2DMarkerEditor.h.

cut text after a maximum number of lines (defined by "maxNumberOfLines")

Definition at line 212 of file SoView2DMarkerEditor.h.

set if markers are deleted on click

Definition at line 183 of file SoView2DMarkerEditor.h.

defines certain draw modes

Definition at line 246 of file SoView2DMarkerEditor.h.

defines on how many voxel neighboring z voxel the markers are visible

Definition at line 174 of file SoView2DMarkerEditor.h.

defines the visualization mode of the marker

Definition at line 249 of file SoView2DMarkerEditor.h.

select the mode for creation of new object

Definition at line 180 of file SoView2DMarkerEditor.h.

name of the icon file (with $() vars)

Definition at line 238 of file SoView2DMarkerEditor.h.

set the initial index inside of the icon file

Definition at line 236 of file SoView2DMarkerEditor.h.

expanded (real) icon file path

Definition at line 240 of file SoView2DMarkerEditor.h.

choose the maximum number of lines of text, if "cutText" is turned on

Definition at line 214 of file SoView2DMarkerEditor.h.

hybrid ML module requires a field named "outputMLModule" for MeVisLab to be able to use the ML module

Definition at line 228 of file SoView2DMarkerEditor.h.

flag to set if it is possible to select a marker

Definition at line 189 of file SoView2DMarkerEditor.h.

If this option is turned on, selection boxes are only drawn for the current marker (Requested in support forum: UsingMevisLab->"Turning off selection markers of arrows in SoView2DMarkerEditor").

Definition at line 260 of file SoView2DMarkerEditor.h.

if this option is turned on, only the current marker is drawn in the selected draw mode All other markers are drawn as simple markers (this may be useful if there are too many markers lying together)

Definition at line 256 of file SoView2DMarkerEditor.h.

show text only for selected marker;

Definition at line 210 of file SoView2DMarkerEditor.h.

sets if the markers snap to the current slice when they are moved

Definition at line 273 of file SoView2DMarkerEditor.h.

sets if the markers snap to the center of a voxel

Definition at line 177 of file SoView2DMarkerEditor.h.

input style palette

Definition at line 231 of file SoView2DMarkerEditor.h.

extra text color, depends on textColorMode if it is used

Definition at line 204 of file SoView2DMarkerEditor.h.

choose the color of the text for markers

Definition at line 202 of file SoView2DMarkerEditor.h.

font size of text

Definition at line 208 of file SoView2DMarkerEditor.h.

choose the mode of the text for markers

Definition at line 198 of file SoView2DMarkerEditor.h.

choose the position mode of the text for markers

Definition at line 200 of file SoView2DMarkerEditor.h.

flag if text shadow should be drawn

Definition at line 206 of file SoView2DMarkerEditor.h.

toggles the use of anti aliasing (openGL).

Definition at line 252 of file SoView2DMarkerEditor.h.

set if the icon file should be used

Definition at line 234 of file SoView2DMarkerEditor.h.

choose how vector arrows are drawn

Definition at line 217 of file SoView2DMarkerEditor.h.


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

Generated on Sat Sep 3 18:39:33 2011 for MeVisLab Toolbox Reference by  doxygen 1.5.8