ImFusion SDK 4.3
GlPointCloud Class Reference

#include <ImFusion/GL/GlPointCloud.h>

Efficient point cloud renderer. More...

+ Inheritance diagram for GlPointCloud:

Detailed Description

Efficient point cloud renderer.

Public Types

enum  MaterialMode { Uniform = 0 , Texture , Color , Label }
 
- Public Types inherited from GlObject
enum  RenderingOrderGroup { RenderingGroupRest , RenderingGroupMesh , RenderingGroupManipulator }
 Enumeration to determine rendering order of GlObjects in GlSliceView and GlVolumeView. More...
 

Public Member Functions

 GlPointCloud (PointCloud *pointCloud, bool showIn2D=false)
 Constructor with a point cloud (that is not owned), and option to enable 2D view visibility.
 
 ~GlPointCloud () override
 Destructor.
 
PointCloudpointCloud ()
 
const PointCloudpointCloud () const
 
void setPointCloud (PointCloud *pointCloud)
 
void setShowIn2D (bool v)
 
bool showIn2D () const
 
void setVisualizeCamera (bool v)
 Specify whether the camera pose should be visualized (makes a difference if the point cloud is dense)
 
bool visualizeCamera () const
 Returns true if the camera pose should be visualized (makes a difference if the point cloud is dense)
 
void setMaterialMode (MaterialMode mode)
 Specify the material mode.
 
MaterialMode materialMode () const
 Get the material mode.
 
void setColor (const vec3 &color) override
 Specify the uniform color used in Uniform material mode.
 
bool setColors (const std::vector< vec3 > &colors)
 Specify individual colors per point used in Color material mode Returns false if the size of the color vector does not match the number of point cloud points.
 
const std::vector< vec3 > & colors () const
 Get individual point colors used in Color material mode.
 
bool hasColors () const
 Return whether per-point colors have been set.
 
void setLabel (int idx, const std::string &text)
 Specify label text to show for a point. Setting the text to an empty string clears the label.
 
void clearLabels ()
 Clear all previously set labels.
 
void setPointSize (float val)
 Specify the point size.
 
float pointSize () const
 Retrieve the point size.
 
void setDrawLines (bool flag)
 Specify whether a connected line shall be drawn instead of points.
 
bool drawLines () const
 
void setDrawNormals (bool flag)
 Specify whether the normals should be drawn as lines (if available)
 
bool drawNormals () const
 
void setDrawIds (bool flag)
 Specify whether the point ids should be displayed.
 
bool drawIds () const
 
void setColorWithNormals (bool flag)
 Specify whether the points should be colored according to their normal orientation (if available)
 
bool colorWithNormals () const
 
void enableIndexPicking (bool v)
 
bool indexPickingEnabled () const
 
void setMatrix (const mat4 &m) override
 Set the modelview matrix of this object.
 
const mat4 & matrix () const override
 Return the modelview matrix.
 
vec3 center () const override
 Return the center of the object in local coordinates without considering any matrix.
 
vec3 extent () const override
 Return the extent of the object in local coordinates without considering any matrix.
 
vec3 centerOfMass (bool withMatrix=false) const
 
bool updateBuffers ()
 
void draw (const GlView &view) override
 Draw the object in 3D space.
 
void draw3D (const GL::ViewState &state, const GL::ObjectPicking *glObjectPicking=nullptr)
 
Geometry::AlignedBox bounds () const override
 Get the axis-aligned bounding box of this GlObject in world space.
 
std::string typeName () const override
 Return unique identifier for this object class used for serialization.
 
void configure (const Properties *p) override
 Set one or multiple properties.
 
void configuration (Properties *p) const override
 Retrieve the properties of this object.
 
- Public Member Functions inherited from GlAnnotation
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 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.
 
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 GlObject
virtual Geometry::AlignedBox boundsSpherical () const
 Get the spherical bounds of this GlObject in world space.
 
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.
 
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)
 
- Public Member Functions inherited from 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
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 
- Public Member Functions inherited from SignalReceiver
 SignalReceiver ()=default
 Default constructor.
 
 SignalReceiver (const SignalReceiver &other)
 Copy constructor, does not copy any existing signal connections from other.
 
SignalReceiveroperator= (SignalReceiver rhs)
 Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs.
 
virtual ~SignalReceiver ()
 Virtual destructor disconnects from all connected signals.
 

Additional Inherited Members

- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 
- Protected Member Functions inherited from GlAnnotation
void renderLabel (const GlView &view, const vec3 &positionWorld) const
 Render the label of the annotation at the given position.
 
vec2i labelSize () const
 
- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 
- Protected Attributes inherited from GlAnnotation
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 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 Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Constructor & Destructor Documentation

◆ GlPointCloud()

GlPointCloud ( PointCloud * pointCloud,
bool showIn2D = false )
explicit

Constructor with a point cloud (that is not owned), and option to enable 2D view visibility.

The rendering in 2D views is disabled by default, since it might yield wrong results based on whether the image matrices are set to be used or not. Therefore it has to be explicitly set, typically when a rendering of a 2D point set on an image is intended.

Member Function Documentation

◆ setColor()

void setColor ( const vec3 & color)
overridevirtual

Specify the uniform color used in Uniform material mode.

Reimplemented from GlAnnotation.

◆ setMatrix()

void setMatrix ( const mat4 & m)
overridevirtual

Set the modelview matrix of this object.

Reimplemented from GlObject.

◆ matrix()

const mat4 & matrix ( ) const
overridevirtual

Return the modelview matrix.

Reimplemented from GlObject.

◆ center()

vec3 center ( ) const
overridevirtual

Return the center of the object in local coordinates without considering any matrix.

Implements Gl3DObject.

◆ extent()

vec3 extent ( ) const
overridevirtual

Return the extent of the object in local coordinates without considering any matrix.

Implements Gl3DObject.

◆ draw()

void draw ( const GlView & view)
overridevirtual

Draw the object in 3D space.

Implements GlObject.

◆ bounds()

Geometry::AlignedBox bounds ( ) const
overridevirtual

Get the axis-aligned bounding box of this GlObject in world space.

Return an empty (default-constructed) AlignedBox object if the GlObject does not reside in world space.

Implements GlObject.

◆ typeName()

std::string typeName ( ) const
overridevirtual

Return unique identifier for this object class used for serialization.

Implements GlObject.

◆ configure()

void configure ( const Properties * p)
overridevirtual

Set one or multiple properties.

Reimplemented from GlAnnotation.

◆ configuration()

void configuration ( Properties * p) const
overridevirtual

Retrieve the properties of this object.

Reimplemented from GlAnnotation.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close