MeVisLabToolboxReference
SoView2DAnnotation Class Reference

Annotation extension for the SoView2D. More...

#include <SoView2DAnnotation.h>

Inheritance diagram for SoView2DAnnotation:
SoView2DExtension

List of all members.

Classes

struct  Margins
 Stores top/bottom/left/right margins. More...

Public Types

enum  AlignPosition {
  TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT,
  BOTTOM_CENTER, CENTER_CENTER
}
 Mode for alignment of text boxes on viewer. More...

Public Member Functions

 SoView2DAnnotation ()
 Constructor.
 ~SoView2DAnnotation ()
virtual void draw (View2DSliceList *dsl, View2DSlice *dslice, int slice)
 draw annotations on slice
virtual bool evalEvent (SoView2D *view2d, View2DSliceList *slicelist, View2DEvent *ec, View2DEventPhase phase)
 handle keyboard events
void toggleAnnotation ()
 toggle displayed information
void toggleTechnicalInfo ()
void parseString (View2DSliceList *list, View2DSlice *slice, const SbString &string, SbString &resultString, int limitToChars=-1)
 parses the given string and substitutes and
void drawAnnotation (const char *string, float dx1, float dy1, float dx2, float dy2, View2DFont *font, int fontsize, AlignPosition pos, bool drawBox, float boxColor[4], float boxEdgeColor[4], int &outBoxWidth, int &outBoxHeight)
 draws an AnnotationBox at the given position
float decimalFloor (float number, SbString &result, int &divider)
 returns the closest decimal floor and copies a printable string into the buffer
void drawVerticalRuler (View2DSliceList *dsl, View2DSlice *dslice, View2DFont *font, int marginRight, int dx1, int dy1, int dx2, int dy2)
 draws an annotated ruler
void drawHorizontalRuler (View2DSliceList *dsl, View2DSlice *dslice, View2DFont *font, int marginBottom, int dx1, int dy1, int dx2, int dy2)
virtual Margins calculateTextMargins (int width, int height)
 calculates the margin of the text annotations (to be reimplemented by a derived class)
virtual Margins calculateCenterTextMargins (int width, int height)
 margins for center text (horizontally) can be different
virtual int calculateOrientationModelSize (int width, int height)
 calculates the size of the orientation model
SbMatrix calculateOrientationModelRotationMatrix (View2DSlice *slice)
 calculates the rotation matrix for the orientation model
virtual void drawOrientationCube (const SbMatrix &rotationMatrix, int posX, int posY, int modelSize)
 draws the annotation model for the given rotation matrix at the given position and size using the built in model
virtual void drawOrientationModelUsingInventor (SoAction *action, const SbMatrix &rotationMatrix, int posX, int posY, int modelSize)
 draws the annotation model for the given rotation matrix at the given position and size using the inOrientationModel scene
virtual void drawOrientationCubeLetter (char letter, int modelSize, bool shadowPass)
 draw the given letters.
virtual bool implementsManagedInteraction () const
 also implements managed interactions
virtual bool implementsManagedInteractionAndClassicEventHandling () const
 this node is a hybrid module providing managed interaction and classic event handling
virtual void fieldChanged (SoSensor *sensor)
 handle changes to editingOn field

Static Public Member Functions

static void initClass ()
 inventor runtime type system
static void getExtOrientation (int axis, SbMatrix &matrix, float *orWeights, char *negOrientation, char *posOrientation)
 Return extended orientation letters (up to three letters for oblique views) and weights.
static void drawOrientation (const char *string, float posX, float posY, float fontSize, View2DFont *font, float relOffX, float relOffY, float *orWeights)
 Draw orientation letters.
static SbVec2f getTargetSizeInScene (SoNode *scene, int width, int height)
 Get the minimum view port size of all SoView2Ds in the given scene, provided the scene would be displayed in a viewer with size windowX * windowY.

Public Attributes

SoSFString annotationUserTopLeft
SoSFString annotationUserTopRight
SoSFString annotationUserBottomLeft
SoSFString annotationUserBottomRight
SoSFString annotationUserBottomCenter
SoSFString annotationCTTopLeft
SoSFString annotationCTTopRight
SoSFString annotationCTBottomLeft
SoSFString annotationCTBottomRight
SoSFString annotationCTBottomCenter
SoSFString annotationMRTopLeft
SoSFString annotationMRTopRight
SoSFString annotationMRBottomLeft
SoSFString annotationMRBottomRight
SoSFString annotationMRBottomCenter
SoSFString shortTopLeft
SoSFString shortTopRight
SoSFString shortBottomLeft
SoSFString shortBottomRight
SoSFString shortBottomCenter
SoSFInt32 minDetailFontSize
SoSFInt32 maxDetailFontSize
SoSFInt32 minShortFontSize
SoSFInt32 maxShortFontSize
SoSFInt32 userDetailFontSize
SoSFInt32 userShortFontSize
SoSFEnum annotationMode
SoSFEnum showAnnotation
SoSFEnum annotationFontSize
SoSFBool textShadow
SoSFString fontWidthDummyString
SoSFInt32 targetWidth
SoSFInt32 targetHeight
SoSFInt32 abreviateChars
SoSFInt32 abreviateShortChars
SoSFEnum showOrientation
SoSFBool drawNegativeOrientation
SoSFBool drawPositiveOrientation
SoSFBool verticalRuler
SoSFBool horizontalRuler
SoSFInt32 verticalRulerMarginRight
SoSFInt32 horizontalRulerMarginBottom
SoSFBool orientationModel
SoSFEnum orientationModelPosition
SoSFFloat orientationModelRelativeSize
SoSFInt32 orientationModelMinSize
SoSFInt32 orientationModelMaxSize
SoSFColor orientationModelColor
SoSFBool showTechnicalInfo
SoSFString input00
SoSFString input01
SoSFString input02
SoSFString input03
SoSFString input04
SoSFString input05
SoSFString input06
SoSFString input07
SoSFString input08
SoSFString input09
SoSFDouble numInput00
SoSFDouble numInput01
SoSFDouble numInput02
SoSFDouble numInput03
SoSFDouble numInput04
SoSFDouble numInput05
SoSFDouble numInput06
SoSFDouble numInput07
SoSFDouble numInput08
SoSFDouble numInput09
SoSFBool drawBackgroundBox
SoSFColor backgroundColor
SoSFFloat backgroundOpacity
SoSFColor backgroundEdgeColor
SoSFFloat backgroundEdgeOpacity
SoSFNode inOrientationModel
SoSFBool orientationAndScaleFromCamera
 field that enables getting the orientation matrix from the Inventor scene instead of the input image

Protected Member Functions

virtual SbString restrict (const SbString &value, int maxLength) const
 restrict string to maximum length, appending "..." if string was truncated
virtual SbString asString (int value) const
 return numeric value formatted as string derived classes might e.g.
virtual SbString asString (double value, int precision) const
virtual SbString getDicomTagValueAsString (DCMTree::Const_TagPtr tagPtr, unsigned int index, unsigned int precision) const
 get the value of a dicom tag for display purposes; derived classes might e.g.

Detailed Description

Annotation extension for the SoView2D.

For a detailed description of the module and its fields, see the MeVisLab html documentation

Author:
Florian Link

Definition at line 80 of file SoView2DAnnotation.h.


Member Enumeration Documentation

Mode for alignment of text boxes on viewer.

Enumerator:
TOP_LEFT 
TOP_RIGHT 
BOTTOM_LEFT 
BOTTOM_RIGHT 
BOTTOM_CENTER 
CENTER_CENTER 

Definition at line 87 of file SoView2DAnnotation.h.


Constructor & Destructor Documentation

SoView2DAnnotation::SoView2DAnnotation ( )

Constructor.

SoView2DAnnotation::~SoView2DAnnotation ( )

Member Function Documentation

virtual SbString SoView2DAnnotation::asString ( int  value) const [protected, virtual]

return numeric value formatted as string derived classes might e.g.

override the formatting

virtual SbString SoView2DAnnotation::asString ( double  value,
int  precision 
) const [protected, virtual]
virtual Margins SoView2DAnnotation::calculateCenterTextMargins ( int  width,
int  height 
) [virtual]

margins for center text (horizontally) can be different

SbMatrix SoView2DAnnotation::calculateOrientationModelRotationMatrix ( View2DSlice slice)

calculates the rotation matrix for the orientation model

virtual int SoView2DAnnotation::calculateOrientationModelSize ( int  width,
int  height 
) [virtual]

calculates the size of the orientation model

virtual Margins SoView2DAnnotation::calculateTextMargins ( int  width,
int  height 
) [virtual]

calculates the margin of the text annotations (to be reimplemented by a derived class)

float SoView2DAnnotation::decimalFloor ( float  number,
SbString &  result,
int &  divider 
)

returns the closest decimal floor and copies a printable string into the buffer

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

draw annotations on slice

Reimplemented from SoView2DExtension.

void SoView2DAnnotation::drawAnnotation ( const char *  string,
float  dx1,
float  dy1,
float  dx2,
float  dy2,
View2DFont font,
int  fontsize,
AlignPosition  pos,
bool  drawBox,
float  boxColor[4],
float  boxEdgeColor[4],
int &  outBoxWidth,
int &  outBoxHeight 
)

draws an AnnotationBox at the given position

void SoView2DAnnotation::drawHorizontalRuler ( View2DSliceList dsl,
View2DSlice dslice,
View2DFont font,
int  marginBottom,
int  dx1,
int  dy1,
int  dx2,
int  dy2 
)
static void SoView2DAnnotation::drawOrientation ( const char *  string,
float  posX,
float  posY,
float  fontSize,
View2DFont font,
float  relOffX,
float  relOffY,
float *  orWeights 
) [static]

Draw orientation letters.

virtual void SoView2DAnnotation::drawOrientationCube ( const SbMatrix &  rotationMatrix,
int  posX,
int  posY,
int  modelSize 
) [virtual]

draws the annotation model for the given rotation matrix at the given position and size using the built in model

virtual void SoView2DAnnotation::drawOrientationCubeLetter ( char  letter,
int  modelSize,
bool  shadowPass 
) [virtual]

draw the given letters.

The letter should be drawn at [0.,0.] and may draw from [-0.5,-0.5] to [0.5, 0.5] to fill the side of the model. (Rotation and translation are done in the outer code).

virtual void SoView2DAnnotation::drawOrientationModelUsingInventor ( SoAction *  action,
const SbMatrix &  rotationMatrix,
int  posX,
int  posY,
int  modelSize 
) [virtual]

draws the annotation model for the given rotation matrix at the given position and size using the inOrientationModel scene

void SoView2DAnnotation::drawVerticalRuler ( View2DSliceList dsl,
View2DSlice dslice,
View2DFont font,
int  marginRight,
int  dx1,
int  dy1,
int  dx2,
int  dy2 
)

draws an annotated ruler

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

handle keyboard events

Reimplemented from SoView2DExtension.

virtual void SoView2DAnnotation::fieldChanged ( SoSensor *  sensor) [virtual]

handle changes to editingOn field

Reimplemented from SoView2DExtension.

virtual SbString SoView2DAnnotation::getDicomTagValueAsString ( DCMTree::Const_TagPtr  tagPtr,
unsigned int  index,
unsigned int  precision 
) const [protected, virtual]

get the value of a dicom tag for display purposes; derived classes might e.g.

override the formatting

static void SoView2DAnnotation::getExtOrientation ( int  axis,
SbMatrix &  matrix,
float *  orWeights,
char *  negOrientation,
char *  posOrientation 
) [static]

Return extended orientation letters (up to three letters for oblique views) and weights.

static SbVec2f SoView2DAnnotation::getTargetSizeInScene ( SoNode *  scene,
int  width,
int  height 
) [static]

Get the minimum view port size of all SoView2Ds in the given scene, provided the scene would be displayed in a viewer with size windowX * windowY.

virtual bool SoView2DAnnotation::implementsManagedInteraction ( ) const [inline, virtual]

also implements managed interactions

Definition at line 289 of file SoView2DAnnotation.h.

virtual bool SoView2DAnnotation::implementsManagedInteractionAndClassicEventHandling ( ) const [inline, virtual]

this node is a hybrid module providing managed interaction and classic event handling

Reimplemented from SoView2DExtension.

Definition at line 293 of file SoView2DAnnotation.h.

static void SoView2DAnnotation::initClass ( ) [static]

inventor runtime type system

Reimplemented from SoView2DExtension.

void SoView2DAnnotation::parseString ( View2DSliceList list,
View2DSlice slice,
const SbString &  string,
SbString &  resultString,
int  limitToChars = -1 
)

parses the given string and substitutes and

virtual SbString SoView2DAnnotation::restrict ( const SbString &  value,
int  maxLength 
) const [protected, virtual]

restrict string to maximum length, appending "..." if string was truncated

void SoView2DAnnotation::toggleAnnotation ( )

toggle displayed information

void SoView2DAnnotation::toggleTechnicalInfo ( )

Member Data Documentation

Definition at line 138 of file SoView2DAnnotation.h.

Definition at line 139 of file SoView2DAnnotation.h.

Definition at line 104 of file SoView2DAnnotation.h.

Definition at line 105 of file SoView2DAnnotation.h.

Definition at line 131 of file SoView2DAnnotation.h.

Definition at line 129 of file SoView2DAnnotation.h.

Definition at line 110 of file SoView2DAnnotation.h.

Definition at line 111 of file SoView2DAnnotation.h.

Definition at line 98 of file SoView2DAnnotation.h.

Definition at line 99 of file SoView2DAnnotation.h.

Definition at line 183 of file SoView2DAnnotation.h.

Definition at line 185 of file SoView2DAnnotation.h.

Definition at line 184 of file SoView2DAnnotation.h.

Definition at line 182 of file SoView2DAnnotation.h.

Definition at line 134 of file SoView2DAnnotation.h.

Definition at line 146 of file SoView2DAnnotation.h.

Definition at line 188 of file SoView2DAnnotation.h.

Definition at line 159 of file SoView2DAnnotation.h.

Definition at line 160 of file SoView2DAnnotation.h.

Definition at line 161 of file SoView2DAnnotation.h.

Definition at line 162 of file SoView2DAnnotation.h.

Definition at line 163 of file SoView2DAnnotation.h.

Definition at line 164 of file SoView2DAnnotation.h.

Definition at line 165 of file SoView2DAnnotation.h.

Definition at line 166 of file SoView2DAnnotation.h.

Definition at line 167 of file SoView2DAnnotation.h.

Definition at line 168 of file SoView2DAnnotation.h.

Definition at line 123 of file SoView2DAnnotation.h.

Definition at line 125 of file SoView2DAnnotation.h.

Definition at line 122 of file SoView2DAnnotation.h.

Definition at line 124 of file SoView2DAnnotation.h.

Definition at line 170 of file SoView2DAnnotation.h.

Definition at line 171 of file SoView2DAnnotation.h.

Definition at line 172 of file SoView2DAnnotation.h.

Definition at line 173 of file SoView2DAnnotation.h.

Definition at line 174 of file SoView2DAnnotation.h.

Definition at line 175 of file SoView2DAnnotation.h.

Definition at line 176 of file SoView2DAnnotation.h.

Definition at line 177 of file SoView2DAnnotation.h.

Definition at line 178 of file SoView2DAnnotation.h.

Definition at line 179 of file SoView2DAnnotation.h.

field that enables getting the orientation matrix from the Inventor scene instead of the input image

Definition at line 192 of file SoView2DAnnotation.h.

Definition at line 150 of file SoView2DAnnotation.h.

Definition at line 120 of file SoView2DAnnotation.h.

Definition at line 118 of file SoView2DAnnotation.h.

Definition at line 119 of file SoView2DAnnotation.h.

Definition at line 116 of file SoView2DAnnotation.h.

Definition at line 117 of file SoView2DAnnotation.h.

Definition at line 130 of file SoView2DAnnotation.h.

Definition at line 141 of file SoView2DAnnotation.h.

Definition at line 157 of file SoView2DAnnotation.h.

Definition at line 136 of file SoView2DAnnotation.h.

Definition at line 135 of file SoView2DAnnotation.h.

Definition at line 132 of file SoView2DAnnotation.h.

Definition at line 126 of file SoView2DAnnotation.h.

Definition at line 127 of file SoView2DAnnotation.h.

Definition at line 145 of file SoView2DAnnotation.h.


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