Blue Brain BioExplorer
core::ModelInstance Class Reference

A class representing an instance of a 3D model. More...

#include <Model.h>

Inheritance diagram for core::ModelInstance:
Collaboration diagram for core::ModelInstance:

Public Member Functions

PLATFORM_API ModelInstance ()=default
 Default constructor. More...
 
PLATFORM_API ModelInstance (const bool visible, const bool boundingBox, const Transformation &transformation)
 Constructor with parameters. More...
 
PLATFORM_API bool getVisible () const
 Get the value of _visible. More...
 
PLATFORM_API void setVisible (const bool visible)
 Set the value of _visible. More...
 
PLATFORM_API bool getBoundingBox () const
 Get the value of _boundingBox. More...
 
PLATFORM_API void setBoundingBox (const bool enabled)
 Set the value of _boundingBox. More...
 
PLATFORM_API const TransformationgetTransformation () const
 Get the value of _transformation. More...
 
PLATFORM_API void setTransformation (const Transformation &transformation)
 Set the value of _transformation. More...
 
PLATFORM_API void setModelID (const size_t id)
 Set the value of _modelID. More...
 
PLATFORM_API size_t getModelID () const
 Get the value of _modelID. More...
 
PLATFORM_API void setInstanceID (const size_t id)
 Set the value of _instanceID. More...
 
PLATFORM_API size_t getInstanceID () const
 Get the value of _instanceID. More...
 
- Public Member Functions inherited from core::BaseObject
 BaseObject ()=default
 
virtual ~BaseObject ()=default
 
 BaseObject (const BaseObject &)
 
BaseObjectoperator= (const BaseObject &rhs)
 
bool isModified () const
 
void resetModified ()
 
void markModified (const bool triggerCallback=true)
 
void onModified (const ModifiedCallback &callback)
 
void clearModifiedCallback ()
 

Protected Attributes

size_t _modelID {0}
 
size_t _instanceID {0}
 
bool _visible {true}
 
bool _boundingBox {false}
 
Transformation _transformation
 

Additional Inherited Members

- Public Types inherited from core::BaseObject
using ModifiedCallback = std::function< void(const BaseObject &)>
 
- Protected Member Functions inherited from core::BaseObject
template<typename T >
void _updateValue (T &member, const T &newValue, const bool triggerCallback=true)
 
template<class T >
bool _isEqual (const T &a, const T &b, typename std::enable_if< std::is_floating_point< T >::value >::type *=0)
 
template<class T >
bool _isEqual (const T &a, const T &b, typename std::enable_if<!std::is_floating_point< T >::value >::type *=0)
 

Detailed Description

A class representing an instance of a 3D model.

Definition at line 79 of file Model.h.

Constructor & Destructor Documentation

◆ ModelInstance() [1/2]

PLATFORM_API core::ModelInstance::ModelInstance ( )
default

Default constructor.

◆ ModelInstance() [2/2]

PLATFORM_API core::ModelInstance::ModelInstance ( const bool  visible,
const bool  boundingBox,
const Transformation transformation 
)
inline

Constructor with parameters.

Parameters
visibleA boolean indicating if the model instance is visible
boundingBoxA boolean indicating if the model instance has a bounding box
transformationA Transformation object representing the model's transformation

Definition at line 93 of file Model.h.

Member Function Documentation

◆ getBoundingBox()

PLATFORM_API bool core::ModelInstance::getBoundingBox ( ) const
inline

Get the value of _boundingBox.

Returns
A boolean indicating if the model instance has a bounding box

Definition at line 116 of file Model.h.

◆ getInstanceID()

PLATFORM_API size_t core::ModelInstance::getInstanceID ( ) const
inline

Get the value of _instanceID.

Returns
A size_t representing the instance ID

Definition at line 161 of file Model.h.

◆ getModelID()

PLATFORM_API size_t core::ModelInstance::getModelID ( ) const
inline

Get the value of _modelID.

Returns
A size_t representing the model ID

Definition at line 149 of file Model.h.

◆ getTransformation()

PLATFORM_API const Transformation& core::ModelInstance::getTransformation ( ) const
inline

Get the value of _transformation.

Returns
A constant reference to a Transformation object representing the model's transformation

Definition at line 128 of file Model.h.

◆ getVisible()

PLATFORM_API bool core::ModelInstance::getVisible ( ) const
inline

Get the value of _visible.

Returns
A boolean indicating if the model instance is visible

Definition at line 104 of file Model.h.

◆ setBoundingBox()

PLATFORM_API void core::ModelInstance::setBoundingBox ( const bool  enabled)
inline

Set the value of _boundingBox.

Parameters
enabledA boolean indicating if the model instance has a bounding box

Definition at line 122 of file Model.h.

◆ setInstanceID()

PLATFORM_API void core::ModelInstance::setInstanceID ( const size_t  id)
inline

Set the value of _instanceID.

Parameters
idA size_t representing the instance ID

Definition at line 155 of file Model.h.

◆ setModelID()

PLATFORM_API void core::ModelInstance::setModelID ( const size_t  id)
inline

Set the value of _modelID.

Parameters
idA size_t representing the model ID

Definition at line 143 of file Model.h.

◆ setTransformation()

PLATFORM_API void core::ModelInstance::setTransformation ( const Transformation transformation)
inline

Set the value of _transformation.

Parameters
transformationA Transformation object representing the model's transformation

Definition at line 134 of file Model.h.

◆ setVisible()

PLATFORM_API void core::ModelInstance::setVisible ( const bool  visible)
inline

Set the value of _visible.

Parameters
visibleA boolean indicating if the model instance is visible

Definition at line 110 of file Model.h.

Member Data Documentation

◆ _boundingBox

bool core::ModelInstance::_boundingBox {false}
protected

Definition at line 167 of file Model.h.

◆ _instanceID

size_t core::ModelInstance::_instanceID {0}
protected

Definition at line 165 of file Model.h.

◆ _modelID

size_t core::ModelInstance::_modelID {0}
protected

Definition at line 164 of file Model.h.

◆ _transformation

Transformation core::ModelInstance::_transformation
protected

Definition at line 168 of file Model.h.

◆ _visible

bool core::ModelInstance::_visible {true}
protected

Definition at line 166 of file Model.h.


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