ImFusion C++ SDK 4.4.0
ImFusion::GlAnnotation Class Reference

#include <ImFusion/GL/GlAnnotation.h>

Base class for implementing annotations. More...

Inheritance diagram for ImFusion::GlAnnotation:

Detailed Description

Base class for implementing annotations.

Public Member Functions

virtual void setView (const GlView *view)
 Set the view through which this annotation is currently being manipulated.
virtual const GlViewview () const
 Get the view through which this annotation is currently being manipulated.
virtual bool hitTest (int, int, const GlView &) const
 Perform hit test with points of underlying object. Return true if object is hit, false otherwise.
virtual void setEditable (bool editable)
 When a GlAnnotation is editable it may alter its visualization and render UI elements for its manipulation.
virtual bool editable () const
 When a GlAnnotation is editable it may alter its visualization and render UI elements for its manipulation.
virtual void setColor (const vec3 &color)
 Set annotation color.
virtual vec3 color () const
 Return annotation color.
virtual void setAlpha (double v)
 Set alpha channel.
virtual double alpha () const
 Get alpha channel.
virtual void setLineWidth (float lineWidth)
 Set annotation line width.
virtual float lineWidth () const
 Return annotation line width.
virtual void setLabelVisible (bool visible)
 Set annotation label visibility.
virtual bool labelVisible () const
 Return annotation label visibility.
virtual void setLabelBackgroundVisible (bool visible)
 Set annotation label background visibility.
virtual bool labelBackgroundVisible () const
 Return annotation label background visibility.
virtual void setLabelBackgroundColor (vec4 color)
 Set annotation label background color.
virtual vec4 labelBackgroundColor () const
 Return annotation label background color.
virtual void setLabelBackgroundMargin (int margin)
 Set annotation label background margin in pixels.
virtual int labelBackgroundMargin () const
 Return annotation label background margin in pixels.
virtual void setLabelDepthTest (bool depthTest)
 Set annotation label depth test flag.
virtual bool labelDepthTest () const
 Return annotation label depth test flag.
virtual void setLabelColor (const vec3 &color)
 Set annotation label color.
virtual vec3 labelColor () const
 Return annotation label color.
virtual void setLabelText (const std::string &label)
 Set annotation label text.
virtual std::string labelText () const
 Return annotation label text.
virtual void setLabelTextPrefix (const std::string &labelPrefix)
 Set annotation label text prefix.
std::string labelTextPrefix () const
 Return annotation label text prefix.
virtual void setLabelTextSuffix (const std::string &labelSuffix)
 Set annotation label text suffix.
std::string labelTextSuffix () const
 Return annotation label text suffix.
virtual void setName (const std::string &name)
 Set annotation name.
virtual std::string name () const
 Return annotation name.
void configure (const Properties *p) override
 Set one or multiple properties.
void configuration (Properties *p) const override
 Retrieve the properties of this object.
virtual void setSelected (bool m)
 When a GlAnnotation is selected, it may be rendered differently to distinguish it from non-selected annotations.
bool selected () const
 When a GlAnnotation is selected, it may be rendered differently to distinguish it from non-selected annotations.
virtual void setMatrixWithoutMoving (const mat4 &m)
 Change the matrix without moving the annotation, e.g. for linking it with an image transformation.
void copyStyle (const GlAnnotation &other)
 Copies the settable parameters from another GlAnnotation.
Public Member Functions inherited from ImFusion::GlObject
virtual void draw (const GlView &view)=0
 Draw the object in 3D space.
virtual Geometry::AlignedBox bounds () const =0
 Get the axis-aligned bounding box of this GlObject in world space.
virtual Geometry::AlignedBox boundsSpherical () const
 Get the spherical bounds of this GlObject in world space.
virtual void setMatrix (const mat4 &m)
 Set the modelview matrix of this object.
virtual const mat4 & matrix () const
 Return the modelview matrix.
virtual void setVisible (bool visible)
 Set object visibility.
virtual bool visible () const
 Return object visibility.
virtual void setAlwaysVisible (bool alwaysVisible)
 Set if object is always visible.
virtual bool alwaysVisible () const
 Return if object is always visible.
virtual std::string typeName () const =0
 Return unique identifier for this object class used for serialization.
RenderingOrderGroup renderingOrder () const
 Return current rendering order value for this GlObject.
void setRenderingOrder (RenderingOrderGroup group)
 Set rendering order value for this GlObject.
void setDraw3DIn2DView (bool draw3DIn2DView)
void configure (const Properties *p) override
 Configure this object instance by de-serializing the given Properties.
void configuration (Properties *p) const override
 Serialize the current object configuration into the given Properties object.
Public Member Functions inherited from ImFusion::Configurable
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 Configurable (const Configurable &rhs)
 Configurable (Configurable &&rhs) noexcept
Configurable & operator= (const Configurable &)
Configurable & operator= (Configurable &&) noexcept

Protected Member Functions

void renderLabel (const GlView &view, const vec3 &positionWorld) const
 Render the label of the annotation at the given position.
vec2i labelSize () const

Protected Attributes

bool m_editable = true
vec4 m_color {1, 1, 0, 1}
float m_lineWidth = 1
bool m_labelVisible = true
bool m_labelBackgroundVisible = false
vec4 m_labelBackgroundColor {0.3, 0.3, 0.3, 0.7}
int m_labelBackgroundMargin = 3
bool m_labelDepthTest = true
bool m_selected = false
vec3 m_labelColor {0, 1, 1}
std::string m_labelText
std::string m_labelTextPrefix
std::string m_labelTextSuffix
const GlViewm_view = nullptr
std::string m_name
Protected Attributes inherited from ImFusion::GlObject
mat4 m_matrix = mat4::Identity()
 Modelview transformation matrix of this object.
bool m_visible = true
 Object visibility.
bool m_alwaysVisible = false
 Object always visible.
bool m_draw3DIn2DView
 Draw 3D objects in 2D views. This is to render 3D objects in projective 2D views. Property is not serialized.
RenderingOrderGroup m_renderingOrder = RenderingGroupRest
Protected Attributes inherited from ImFusion::Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.

Additional Inherited Members

Public Types inherited from ImFusion::GlObject
enum  RenderingOrderGroup { RenderingGroupRest , RenderingGroupMesh , RenderingGroupManipulator }
 Enumeration to determine rendering order of GlObjects in GlSliceView and GlVolumeView. More...
Public Attributes inherited from ImFusion::Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.

Member Function Documentation

◆ setView()

virtual void ImFusion::GlAnnotation::setView ( const GlView * view)
inlinevirtual

Set the view through which this annotation is currently being manipulated.

Reimplemented in ImFusion::GlPointBasedAnnotation.

◆ hitTest()

virtual bool ImFusion::GlAnnotation::hitTest ( int ,
int ,
const GlView &  ) const
inlinevirtual

Perform hit test with points of underlying object. Return true if object is hit, false otherwise.

Reimplemented in ImFusion::GlLoop, and ImFusion::GlPointBasedAnnotation.

◆ setEditable()

virtual void ImFusion::GlAnnotation::setEditable ( bool editable)
virtual

When a GlAnnotation is editable it may alter its visualization and render UI elements for its manipulation.

Reimplemented in ImFusion::GlBall, ImFusion::GlLoop, and ImFusion::GlPointBasedAnnotation.

◆ editable()

virtual bool ImFusion::GlAnnotation::editable ( ) const
virtual

When a GlAnnotation is editable it may alter its visualization and render UI elements for its manipulation.

Reimplemented in ImFusion::GlBall.

◆ setColor()

virtual void ImFusion::GlAnnotation::setColor ( const vec3 & color)
virtual

◆ color()

virtual vec3 ImFusion::GlAnnotation::color ( ) const
virtual

Return annotation color.

Reimplemented in ImFusion::CT::GlProjectiveAnnotation.

◆ setAlpha()

virtual void ImFusion::GlAnnotation::setAlpha ( double v)
virtual

Set alpha channel.

Reimplemented in ImFusion::GlLoop, and ImFusion::GlMesh.

◆ alpha()

virtual double ImFusion::GlAnnotation::alpha ( ) const
virtual

Get alpha channel.

Reimplemented in ImFusion::CT::GlProjectiveAnnotation.

◆ setLineWidth()

virtual void ImFusion::GlAnnotation::setLineWidth ( float lineWidth)
virtual

◆ lineWidth()

virtual float ImFusion::GlAnnotation::lineWidth ( ) const
virtual

Return annotation line width.

Reimplemented in ImFusion::CT::GlProjectiveAnnotation, and ImFusion::GlMesh.

◆ setLabelVisible()

virtual void ImFusion::GlAnnotation::setLabelVisible ( bool visible)
virtual

Set annotation label visibility.

Reimplemented in ImFusion::GlLoop, and ImFusion::GlTrackingSequenceLegacy.

◆ labelVisible()

virtual bool ImFusion::GlAnnotation::labelVisible ( ) const
virtual

Return annotation label visibility.

Reimplemented in ImFusion::CT::GlProjectiveAnnotation, and ImFusion::GlTrackingSequenceLegacy.

◆ setLabelDepthTest()

virtual void ImFusion::GlAnnotation::setLabelDepthTest ( bool depthTest)
virtual

Set annotation label depth test flag.

Parameters
depthTestFlag whether apply depth test during label rendering in 3D views.

Reimplemented in ImFusion::GlLoop.

◆ labelDepthTest()

virtual bool ImFusion::GlAnnotation::labelDepthTest ( ) const
virtual

Return annotation label depth test flag.

Returns
Flag whether apply depth test during label rendering in 3D views.

Reimplemented in ImFusion::CT::GlProjectiveAnnotation.

◆ setLabelColor()

virtual void ImFusion::GlAnnotation::setLabelColor ( const vec3 & color)
virtual

Set annotation label color.

Reimplemented in ImFusion::GlLoop.

◆ labelColor()

virtual vec3 ImFusion::GlAnnotation::labelColor ( ) const
virtual

Return annotation label color.

Reimplemented in ImFusion::CT::GlProjectiveAnnotation.

◆ setLabelText()

virtual void ImFusion::GlAnnotation::setLabelText ( const std::string & label)
virtual

Set annotation label text.

Reimplemented in ImFusion::GlLoop.

◆ labelText()

virtual std::string ImFusion::GlAnnotation::labelText ( ) const
virtual

Return annotation label text.

Reimplemented in ImFusion::CT::GlProjectiveAnnotation.

◆ setLabelTextPrefix()

virtual void ImFusion::GlAnnotation::setLabelTextPrefix ( const std::string & labelPrefix)
virtual

Set annotation label text prefix.

Reimplemented in ImFusion::GlLoop.

◆ setLabelTextSuffix()

virtual void ImFusion::GlAnnotation::setLabelTextSuffix ( const std::string & labelSuffix)
virtual

Set annotation label text suffix.

Reimplemented in ImFusion::GlLoop.

◆ name()

virtual std::string ImFusion::GlAnnotation::name ( ) const
virtual

Return annotation name.

Reimplemented in ImFusion::CT::GlProjectiveAnnotation.

◆ configure()

◆ configuration()

◆ setSelected()

virtual void ImFusion::GlAnnotation::setSelected ( bool m)
inlinevirtual

When a GlAnnotation is selected, it may be rendered differently to distinguish it from non-selected annotations.

Reimplemented in ImFusion::GlLoop, and ImFusion::GlPointBasedAnnotation.

◆ setMatrixWithoutMoving()

virtual void ImFusion::GlAnnotation::setMatrixWithoutMoving ( const mat4 & m)
virtual

Change the matrix without moving the annotation, e.g. for linking it with an image transformation.

Reimplemented in ImFusion::GlLoop, and ImFusion::GlPointBasedAnnotation.


The documentation for this class was generated from the following file:
  • ImFusion/GL/GlAnnotation.h
Search Tab / S to search, Esc to close