27#ifndef EASY3D_CORE_MODEL_H
28#define EASY3D_CORE_MODEL_H
34#include <easy3d/core/types.h>
53 explicit Model(
const std::string&
name =
"unknown");
54 virtual ~Model() =
default;
58 void set_name(
const std::string& n) { name_ = n; }
60 const std::string&
name()
const {
return name_; }
78 virtual std::vector<vec3>&
points() = 0;
80 virtual const std::vector<vec3>&
points()
const = 0;
A manipulator is for manipulation of an object.
Definition: manipulator.h:62
The base class of renderable 3D models.
Definition: model.h:49
virtual std::vector< vec3 > & points()=0
The vertices of the model.
Manipulator * manipulator()
Gets the manipulator attached to this model.
Definition: model.h:105
void set_renderer(Renderer *r)
Sets the renderer of this model.
Definition: model.h:92
const std::string & name() const
The name of a model.
Definition: model.h:60
const Renderer * renderer() const
Gets the constant renderer of this model.
Definition: model.h:96
void set_manipulator(Manipulator *manip)
Attaches a manipulator to this model.
Definition: model.h:102
bool empty() const
Tests if the model is empty.
Definition: model.h:83
void invalidate_bounding_box()
Invalidates the bounding box of the model. So when bounding_box() is called, the bounding box will be...
Definition: model.cpp:57
const Manipulator * manipulator() const
Gets the manipulator attached to this model.
Definition: model.h:107
virtual void property_stats(std::ostream &output) const
Prints the names of all properties to an output stream (e.g., std::cout).
Definition: model.h:86
Renderer * renderer()
Gets the renderer of this model.
Definition: model.h:94
Model(const std::string &name="unknown")
Default constructor. The parameter name is optional, but it is useful for handling multiple models wi...
Definition: model.cpp:32
virtual const std::vector< vec3 > & points() const =0
The vertices of the model.
const Box3 & bounding_box(bool recompute=false) const
The bounding box of the model.
Definition: model.cpp:41
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 handl...
Definition: model.h:58
A Renderer manages the drawables (and thus the rendering) of a model.
Definition: renderer.h:61
Definition: collider.cpp:182