Easy3D 2.5.3
Model Class Referenceabstract

The base class of renderable 3D models. More...

#include <easy3d/core/model.h>

Inheritance diagram for Model:
Graph PointCloud PolyMesh SurfaceMesh

Public Member Functions

 Model (const std::string &name="unknown")
 Default constructor. The parameter name is optional, but it is useful for handling multiple models with the same viewer.
 
void set_name (const std::string &n)
 Sets/Changes the name of a model. Assigning a name to a model is optional, but it is useful for handling multiple models with the same viewer.
 
const std::string & name () const
 The name of a model.
 
const Box3bounding_box (bool recompute=false) const
 The bounding box of the model. More...
 
void invalidate_bounding_box ()
 Invalidates the bounding box of the model. So when bounding_box() is called, the bounding box will be re-computed. This function is typically called when the geometry of a model is changed.
 
virtual std::vector< vec3 > & points ()=0
 The vertices of the model. More...
 
virtual const std::vector< vec3 > & points () const =0
 The vertices of the model. More...
 
bool empty () const
 Tests if the model is empty.
 
virtual void property_stats (std::ostream &output) const
 Prints the names of all properties to an output stream (e.g., std::cout). More...
 
void set_renderer (Renderer *r)
 Sets the renderer of this model. More...
 
Rendererrenderer ()
 Gets the renderer of this model.
 
const Rendererrenderer () const
 Gets the constant renderer of this model.
 
void set_manipulator (Manipulator *manip)
 Attaches a manipulator to this model. More...
 
Manipulatormanipulator ()
 Gets the manipulator attached to this model.
 
const Manipulatormanipulator () const
 Gets the manipulator attached to this model.
 

Detailed Description

Member Function Documentation

◆ bounding_box()

const Box3 & bounding_box ( bool  recompute = false) const

The bounding box of the model.

Parameters
recomputeIf true, or if the bounding box is not known, it computes and returns the bounding box of the model. Otherwise, it returns the known bounding box.
Note
Manipulation transformation is not handled.
See also
invalidate_bounding_box().
Examples
Tutorial_302_Imposters.

◆ points() [1/2]

virtual const std::vector< vec3 > & points ( ) const
pure virtual

The vertices of the model.

Implemented in Graph, PointCloud, PolyMesh, and SurfaceMesh.

◆ points() [2/2]

virtual std::vector< vec3 > & points ( )
pure virtual

The vertices of the model.

Implemented in Graph, PointCloud, PolyMesh, and SurfaceMesh.

◆ property_stats()

virtual void property_stats ( std::ostream &  output) const
inlinevirtual

Prints the names of all properties to an output stream (e.g., std::cout).

Reimplemented in Graph, PointCloud, PolyMesh, and SurfaceMesh.

Examples
Tutorial_203_Viewer_wxWidgets.

◆ set_manipulator()

void set_manipulator ( Manipulator manip)
inline

Attaches a manipulator to this model.

Note
Memory management of the manipulator is the user's responsibility.
Examples
Tutorial_405_ObjectManipulation, and Tutorial_406_CollisionDetection.

◆ set_renderer()

void set_renderer ( Renderer r)
inline

Sets the renderer of this model.

Note
Memory management of the renderer is the user's responsibility.
Examples
Tutorial_203_Viewer_wxWidgets.

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