1 #ifndef DEF_OBJECT3DGROUP
2 #define DEF_OBJECT3DGROUP
124 static const unsigned int MIN_OBJECTS_HIDE = 20;
128 std::vector<Object3D*> objects;
133 Object3DGroup(
const std::string& name, std::vector<Object3D*> objects = {});
141 void setName(
const std::string& name);
142 void setObjects(
const std::vector<Object3D*>& newObjects);
145 void addObjects(
const std::vector<Object3D*>& newObjects);
157 std::vector<Object3D*>
split(
const std::vector<Object3DGroup>& groups);
Defines functions that are used to ask for values to the user, and to interactively create 3D objects...
nlohmann::json json
Definition: InterfaceGestion.h:14
std::ostream & operator<<(std::ostream &stream, const Object3DGroup &group)
Ostream operator.
Definition: Object3DGroup.cpp:201
void to_json(json &j, const Object3DGroup &group)
Conversion to json.
Definition: Object3DGroup.cpp:232
std::vector< Object3D * > split(const std::vector< Object3DGroup > &groups)
Takes the std::vector of each object group and merge them.
Definition: Object3DGroup.cpp:219
void from_json(const json &j, Object3DGroup &group)
Conversion from json.
Definition: Object3DGroup.cpp:242
A three-dimensional vector using double values.
Definition: DoubleVec3D.h:190
Group of objects.
Definition: Object3DGroup.h:122
void modify()
Interactive modification of this object group.
Definition: Object3DGroup.cpp:97
void addObjects(const std::vector< Object3D * > &newObjects)
Add multiple objects to the current ones.
Definition: Object3DGroup.cpp:43
void setName(const std::string &name)
Setter for the name.
Definition: Object3DGroup.cpp:28
std::vector< Object3D * > getObjects() const
Getter for the objects.
Definition: Object3DGroup.cpp:23
void setObjects(const std::vector< Object3D * > &newObjects)
Setter for the objects.
Definition: Object3DGroup.cpp:30
DoubleVec3D getCenter() const
Getter for the center.
Definition: Object3DGroup.cpp:24
void resetObjects()
Resets all objects of this object group.
Definition: Object3DGroup.cpp:56
void resetAndDeleteObjects()
Deletes all pointers to the objects of this object group, then reset its objects.
Definition: Object3DGroup.cpp:60
std::string getName() const
Getter for the name.
Definition: Object3DGroup.cpp:22
~Object3DGroup()
Destructor.
Definition: Object3DGroup.cpp:16
void merge(const Object3DGroup &group)
Merge with an other object group.
Definition: Object3DGroup.cpp:54
static Object3DGroup create()
Interactive creation of an object group.
Definition: Object3DGroup.cpp:68
void printAll() const
Prints the whole page.
Definition: Object3DGroup.cpp:74
void addObject(Object3D *object)
Adds an object to the current ones.
Definition: Object3DGroup.cpp:37
Object3DGroup()
Default constructor.
Definition: Object3DGroup.cpp:4
Abstract class for a three-dimentional object.
Definition: Object3D.h:121