Path Tracer
Public Member Functions | Static Public Member Functions | List of all members
Object3DGroup Class Reference

Group of objects. More...

#include <Object3DGroup.h>

Public Member Functions

 Object3DGroup ()
 Default constructor. More...
 
 Object3DGroup (const std::string &name, std::vector< Object3D * > objects={})
 Main constructor. More...
 
 Object3DGroup (const Object3DGroup &group)
 Copy constructor. More...
 
 ~Object3DGroup ()
 Destructor. More...
 
std::string getName () const
 Getter for the name. More...
 
std::vector< Object3D * > getObjects () const
 Getter for the objects. More...
 
DoubleVec3D getCenter () const
 Getter for the center. More...
 
void setName (const std::string &name)
 Setter for the name. More...
 
void setObjects (const std::vector< Object3D * > &newObjects)
 Setter for the objects. More...
 
void addObject (Object3D *object)
 Adds an object to the current ones. More...
 
void addObjects (const std::vector< Object3D * > &newObjects)
 Add multiple objects to the current ones. More...
 
void merge (const Object3DGroup &group)
 Merge with an other object group. More...
 
void resetObjects ()
 Resets all objects of this object group. More...
 
void resetAndDeleteObjects ()
 Deletes all pointers to the objects of this object group, then reset its objects. More...
 
void printAll () const
 Prints the whole page. More...
 
void modify ()
 Interactive modification of this object group. More...
 

Static Public Member Functions

static Object3DGroup create ()
 Interactive creation of an object group. More...
 

Detailed Description

Group of objects.

It is used to make the interface clearer. Instead of having all the objects at the same place, they are grouped and have a common name.

Constructor & Destructor Documentation

◆ Object3DGroup() [1/3]

Object3DGroup::Object3DGroup ( )

Default constructor.

The name is "none" by default.

◆ Object3DGroup() [2/3]

Object3DGroup::Object3DGroup ( const std::string &  name,
std::vector< Object3D * >  objects = {} 
)

Main constructor.

Parameters
nameThe name of this object group.
objectsThe std::vector of Object3D pointers that are in this group.

◆ Object3DGroup() [3/3]

Object3DGroup::Object3DGroup ( const Object3DGroup group)

Copy constructor.

Parameters
groupThe group that will be copied.
Warning
The pointers are not deeply copied.

◆ ~Object3DGroup()

Object3DGroup::~Object3DGroup ( )

Destructor.

Calls Object3DGroup::resetObjects().

Warning
The pointers are not deleted.
See also
Object3DGroup::resetObjects()

Member Function Documentation

◆ addObject()

void Object3DGroup::addObject ( Object3D object)

Adds an object to the current ones.

The pointer is deeply copied.

Parameters
objectThe object that will be added.

◆ addObjects()

void Object3DGroup::addObjects ( const std::vector< Object3D * > &  newObjects)

Add multiple objects to the current ones.

Parameters
newObjectsThe objects that will be added.
Warning
The pointers are not deeply copied.

◆ create()

static Object3DGroup Object3DGroup::create ( )
static

Interactive creation of an object group.

Returns
The interactively created object group.

◆ getCenter()

DoubleVec3D Object3DGroup::getCenter ( ) const

Getter for the center.

The center is computed by taking the average of the center of each object.

Returns
The center of this object group.

◆ getName()

std::string Object3DGroup::getName ( ) const

Getter for the name.

Returns
This object group's name.

◆ getObjects()

std::vector< Object3D * > Object3DGroup::getObjects ( ) const

Getter for the objects.

Returns
A std::vector of pointers to Object3D that are in this group.
Warning
The pointers are not deeply copied.

◆ merge()

void Object3DGroup::merge ( const Object3DGroup group)

Merge with an other object group.

Keeps the current name, but adds the objects of the second one.

Parameters
groupThe group from which the objects will be copied.
Warning
The pointers are not deeply copied.

◆ modify()

void Object3DGroup::modify ( )

Interactive modification of this object group.

This is a page on its own.

◆ printAll()

void Object3DGroup::printAll ( ) const

Prints the whole page.

Clears the page, prints the header, information and the available commands.

See also
clearScreenPrintHeader()

◆ resetAndDeleteObjects()

void Object3DGroup::resetAndDeleteObjects ( )

Deletes all pointers to the objects of this object group, then reset its objects.

Calls the function Object3DGroup::resetObjects().

See also
Object3DGroup::resetObjects()

◆ resetObjects()

void Object3DGroup::resetObjects ( )

Resets all objects of this object group.

See also
Object3DGroup::resetAndDeleteObjects()
Warning
The pointers are not deleted.

◆ setName()

void Object3DGroup::setName ( const std::string &  name)

Setter for the name.

Parameters
nameThe new name of this object group.

◆ setObjects()

void Object3DGroup::setObjects ( const std::vector< Object3D * > &  newObjects)

Setter for the objects.

Parameters
newObjectsThe new objects of this object group.
Warning
The pointers are not deeply copied.

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