27#ifndef EASY3D_CORE_MODEL_H
28#define EASY3D_CORE_MODEL_H
35#include <easy3d/core/types.h>
54 explicit Model(
const std::string&
name =
"unknown");
59 void set_name(
const std::string& n) { name_ = n; }
61 const std::string&
name()
const {
return name_; }
79 virtual std::vector<vec3>&
points() = 0;
81 virtual const std::vector<vec3>&
points()
const = 0;
116 std::shared_ptr<Renderer> renderer_;
117 std::shared_ptr<Manipulator> manipulator_;
A manipulator is for manipulation of an object.
Definition manipulator.h:58
virtual std::vector< vec3 > & points()=0
The vertices of the model.
Manipulator * manipulator()
Gets the manipulator attached to this model.
Definition model.h:106
const std::string & name() const
The name of a model.
Definition model.h:61
void set_manipulator(std::shared_ptr< Manipulator > manip)
Attaches a manipulator to this model.
Definition model.h:103
bool empty() const
Tests if the model is empty.
Definition model.h:84
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:60
const Manipulator * manipulator() const
Gets the manipulator attached to this model.
Definition model.h:108
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:87
void set_renderer(std::shared_ptr< Renderer > r)
Sets the renderer of this model.
Definition model.h:93
Renderer * renderer()
Gets the renderer of this model.
Definition model.cpp:66
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:33
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:44
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:59
A Renderer manages the drawables (and thus the rendering) of a model.
Definition renderer.h:58
Definition collider.cpp:182
GenericBox< 3, float > Box3
A 3D axis-aligned bounding box of float type.
Definition types.h:108