8#ifndef META_OCEAN_RENDERING_OBJECT_H
9#define META_OCEAN_RENDERING_OBJECT_H
180 TYPE_WINDOW_FRAMEBUFFER
200 inline std::string name()
const;
206 virtual void setName(
const std::string& name);
274 inline void registerParent(
const ObjectId parentId);
280 inline void unregisterParent(
const ObjectId parentId);
341 const ObjectIdMap::iterator iParent =
objectParents_.find(parentId);
344 ocean_assert(iParent->second != 0u);
346 if (--iParent->second == 0u)
360 stream <<
object.descriptiveInformation();
372template <
bool tActive>
375 return messageObject <<
object.descriptiveInformation();
385template <
bool tActive>
388 return messageObject <<
object.descriptiveInformation();
This class implements a recursive lock object.
Definition Lock.h:31
Messenger object, one object for each message.
Definition Messenger.h:448
This class is the base class for all rendering engines like.
Definition Engine.h:46
This class is the base class for all rendering objects.
Definition Object.h:53
Lock objectLock_
Lock for the object.
Definition Object.h:304
std::string name() const
Returns the name of this object.
Definition Object.h:323
ObjectRefSet parentNodes() const
Returns all parent nodes.
ObjectId objectId_
Unique object id.
Definition Object.h:309
virtual std::string descriptiveInformation() const
Returns descriptive information about the object as string.
std::string objectName_
Object name.
Definition Object.h:312
virtual ~Object()
Destructs an object.
std::unordered_map< ObjectId, unsigned int > ObjectIdMap
Definition of a map holding object ids to reference counters.
Definition Object.h:186
static std::string translateObjectType(const ObjectType objectType)
Translates an object type to a readable string.
Object()
Creates a new object.
virtual void setName(const std::string &name)
Sets or changes the name of this object.
Engine & engine() const
Returns the render engine which is owner of this object.
void unregisterThisObjectAsParent(const ObjectRef &child)
Unregisters this object from a child as parent.
void unregisterParent(const ObjectId parentId)
Unregisters a parent node for this (child) node.
Definition Object.h:337
ObjectRefs parentObjects() const
Returns all parent objects.
ObjectId id() const
Returns the unique object id of this object.
Definition Object.h:318
ObjectType
Definition of different object type.
Definition Object.h:62
@ TYPE_PRIMITIVE_ATTRIBUTE
PrimitiveAttribute type.
Definition Object.h:126
@ TYPE_DIRECTIONAL_LIGHT
DirectionalLight type.
Definition Object.h:88
@ TYPE_ATTRIBUTE
Attribute type.
Definition Object.h:68
@ TYPE_ABSOLUTE_TRANSFORM
Absolute transform type.
Definition Object.h:66
@ TYPE_MATERIAL
Material type.
Definition Object.h:108
@ TYPE_FRAMEBUFFER
Framebuffer type.
Definition Object.h:90
@ TYPE_OBJECT
Object type.
Definition Object.h:112
@ TYPE_BLEND_ATTRIBUTE
BlendAttribute type.
Definition Object.h:78
@ TYPE_BITMAP_FRAMEBUFFER
BitmapFramebuffer type.
Definition Object.h:76
@ TYPE_FRAME_TEXTURE_2D
FrameTexture2D type.
Definition Object.h:92
@ TYPE_SHADER_PROGRAM
ShaderProgram type.
Definition Object.h:136
@ TYPE_UNDISTORTED_BACKGROUND
UndistortedBackground type.
Definition Object.h:174
@ TYPE_SCENE
Scene type.
Definition Object.h:134
@ TYPE_POINTS
Points type.
Definition Object.h:122
@ TYPE_TEXTURES
Textures type.
Definition Object.h:164
@ TYPE_UNKNOWN
Unknown type.
Definition Object.h:64
@ TYPE_LINE_STRIPS
Line strips type.
Definition Object.h:104
@ TYPE_TEXTURE_2D
Texture2D type.
Definition Object.h:158
@ TYPE_LIGHT_SOURCE
LightSource type.
Definition Object.h:100
@ TYPE_SKY_BACKGROUND
SkyBackground type.
Definition Object.h:140
@ TYPE_QUAD_STRIPS
QuadStrips type.
Definition Object.h:128
@ TYPE_POINT_LIGHT
PointLight type.
Definition Object.h:120
@ TYPE_STEREO_ATTRIBUTE
StereoAttribute type.
Definition Object.h:146
@ TYPE_RENDERABLE
Renderable type.
Definition Object.h:132
@ TYPE_PRIMITIVE
Primitive type.
Definition Object.h:124
@ TYPE_DEPTH_ATTRIBUTE
DepthAttribute type.
Definition Object.h:86
@ TYPE_SPHERE
Sphere type.
Definition Object.h:142
@ TYPE_LOD
LOD type.
Definition Object.h:106
@ TYPE_LINES
Lines type.
Definition Object.h:102
@ TYPE_MEDIA_TEXTURE_2D
MediaTexture2D type.
Definition Object.h:160
@ TYPE_PARALLEL_VIEW
ParallelView type.
Definition Object.h:114
@ TYPE_TRIANGLE_FANS
TriangleFans type.
Definition Object.h:168
@ TYPE_STRIP_PRIMITIVE
StripPrimitive type.
Definition Object.h:150
@ TYPE_CYLINDER
Cylinder type.
Definition Object.h:84
@ TYPE_TEXTURE
Texture type.
Definition Object.h:156
@ TYPE_PHANTOM_ATTRIBUTE
PhantomAttribute type.
Definition Object.h:118
@ TYPE_SHAPE
Shape type.
Definition Object.h:138
@ TYPE_GEOMETRY
Geometry type.
Definition Object.h:94
@ TYPE_VIEW
View type.
Definition Object.h:178
@ TYPE_TRIANGLES
Triangles type.
Definition Object.h:170
@ TYPE_SWITCH
Switch type.
Definition Object.h:152
@ TYPE_INDEPENDENT_PRIMITIVE
IndependentPrimitive type.
Definition Object.h:98
@ TYPE_NODE
Node type.
Definition Object.h:110
@ TYPE_BOX
Box type.
Definition Object.h:80
@ TYPE_CONE
Cone type.
Definition Object.h:82
@ TYPE_GROUP
Group type.
Definition Object.h:96
@ TYPE_PERSPECTIVE_VIEW
PerspectiveView type.
Definition Object.h:116
@ TYPE_STEREO_VIEW
StereoView type.
Definition Object.h:148
@ TYPE_TRIANGLE_STRIPS
TriangleStrips type.
Definition Object.h:172
@ TYPE_ATTRIBUTE_SET
AttributeSet type.
Definition Object.h:70
@ TYPE_BACKGROUND
Background type.
Definition Object.h:72
@ TYPE_BILLBOARD
Billboard type.
Definition Object.h:74
@ TYPE_TEXT
Text type.
Definition Object.h:154
@ TYPE_TEXTURE_FRAMEBUFFER
TextureFramebuffer type.
Definition Object.h:162
@ TYPE_SPOT_LIGHT
SpotLight type.
Definition Object.h:144
@ TYPE_QUADS
Quads type.
Definition Object.h:130
@ TYPE_TRANSFORM
Transform type.
Definition Object.h:166
@ TYPE_VERTEX_SET
VertexSet type.
Definition Object.h:176
virtual const std::string & engineName() const =0
Returns the name of the owner engine.
ObjectIdMap objectParents_
Object ids of parent objects, with the number of times each parent has registered itself.
Definition Object.h:315
Object(const Object &object)=delete
Disabled copy constructor.
void registerParent(const ObjectId parentId)
Registers a parent node for this (child) node.
Definition Object.h:330
virtual ObjectType type() const
Returns the type of this object.
void registerThisObjectAsParent(const ObjectRef &child)
Registers this object at a child as parent object.
Object & operator=(const Object &object)=delete
Disabled copy operator.
This class implements a scoped lock object for recursive lock objects.
Definition Lock.h:147
std::vector< ObjectRef > ObjectRefs
Definition of a vector holding rendering object references.
Definition Object.h:40
const ObjectId invalidObjectId
Definition of an invalid object id.
Definition rendering/Rendering.h:65
std::ostream & operator<<(std::ostream &stream, const Object &object)
Write the descriptive information of an object to a stream.
Definition Object.h:358
std::set< ObjectRef > ObjectRefSet
Definition of a set holding rendering object references.
Definition Object.h:46
The namespace covering the entire Ocean framework.
Definition Accessor.h:15