6#if !defined(AFX_3DBASEOBJECT_H__31D6A935_B14E_11D2_A1E5_000000000000__INCLUDED_)
7#define AFX_3DBASEOBJECT_H__31D6A935_B14E_11D2_A1E5_000000000000__INCLUDED_
17BEGIN_MOOTOOLS_NAMESPACE
20#define OBJECT_REFERENCE_OBJECT MAKE_CUSTOM_ID('R', 'F', 'O', 'B')
22#define OBJECT_GUID_CLASS MAKE_CUSTOM_ID('O', 'B', 'J', 'C')
42 OBJECT_PRIVATE_TYPE = 0xFF000000,
43 OBJECT_POI_CAMERA = 0x01000000,
51typedef enum _OBJECT_PROPERTIES XEnumType(
unsigned int)
54 OBJECT_IS_INVALID = 0x10,
55 OBJECT_RENDER_WIREFRAME = 0x20,
57 OBJECT_USER_PROPERTIES1 = 0x01000000,
58 OBJECT_USER_PROPERTIES2 = 0x02000000,
59 OBJECT_USER_PROPERTIES3 = 0x04000000,
60 OBJECT_USER_PROPERTIES4 = 0x08000000,
68 OBJECT_INV_FLAGS = 0xFFFF,
69 OBJECT_INV_ALL = OBJECT_INV_FLAGS,
81 OBJECT_UPDATE_NONE = 0x00000000,
82 OBJECT_UPDATE_ALL = 0x0FFF0000,
93 OBJECT_COPY_DEFAULT = 0x00,
113 virtual bool DeleteFromNode();
116 virtual void PostSerialize(
CXArchive& ar,
bool lastCall);
152 virtual bool NeedUpdate()
const;
154 virtual void Invalidate(
unsigned int objectInvalidationFlags,
bool set =
true);
171 virtual bool IsFinalObject()
const
195 void SetFlag(OBJECT_PROPERTIES flag,
bool set);
196 void SetFlags(
unsigned int flags,
bool set);
197 bool IsFlagSet(OBJECT_PROPERTIES flag)
const;
198 bool IsOneFlagSet(
unsigned int flags)
const;
199 bool CheckFlags(
unsigned int checkflags,
bool allSetOrNoneSet)
const;
225 virtual void Dump(
unsigned int flags);
226 virtual unsigned int MemoryStats()
const;
232 void SetUpdateFlags(
unsigned int flag,
bool set);
238 unsigned int updateFlags;
241 BaseObjectID objectGUID;
250END_MOOTOOLS_NAMESPACE
OBJECT_KINDOF
Definition 3DBaseObject.h:28
@ OBJECT_DUMMY
C3DDummy.
Definition 3DBaseObject.h:37
@ OBJECT_PATCH
C3DPatch.
Definition 3DBaseObject.h:35
@ OBJECT_GEOM_WITH_FACES
These flags can be used in C3DScene::GetFirstNode/GetNextNode or to perform a bitwise operation on C3...
Definition 3DBaseObject.h:46
@ OBJECT_CAMERA
C3DCamera.
Definition 3DBaseObject.h:38
@ OBJECT_ALL_KINDOF
This also include private type for copy and other specific operations.
Definition 3DBaseObject.h:48
@ OBJECT_MESH
C3DObject.
Definition 3DBaseObject.h:33
@ OBJECT_GROUP
C3DGroup.
Definition 3DBaseObject.h:36
@ OBJECT_CURVE
C3DCurve.
Definition 3DBaseObject.h:34
@ OBJECT_LIGHT
C3DLight.
Definition 3DBaseObject.h:39
OBJECT_UPDATE_PROPERTIES
Definition 3DBaseObject.h:67
@ OBJECT_INV_DATA
Custom data associated to object changed.
Definition 3DBaseObject.h:76
@ OBJECT_INV_DISPLAY
The object drawing should be updated.
Definition 3DBaseObject.h:78
@ OBJECT_INV_MATERIALS
Face materials changes.
Definition 3DBaseObject.h:73
@ OBJECT_INV_MATERIAL_ATTR
A material related to object changed.
Definition 3DBaseObject.h:75
@ OBJECT_INV_FACE_FLAG
Face properties changed (ie HIDDEN flag of face changed)
Definition 3DBaseObject.h:72
@ OBJECT_INV_CHANNELS
Channel changed, autogenerated channels need to be recomputed...
Definition 3DBaseObject.h:74
@ OBJECT_INV_TOPO
Faces indexes size, indexes changes.
Definition 3DBaseObject.h:71
@ OBJECT_UPDATE_BBOX
Bounding box will be recomputed next time we ask for the BBox.
Definition 3DBaseObject.h:84
@ OBJECT_INV_GEOM
Points position or number changed.
Definition 3DBaseObject.h:70
@ OBJECT_UPDATE_GEOM
Geometry need to be recomputed or updated. This should be done in the C3DBaseObject::Update.
Definition 3DBaseObject.h:85
@ OBJECT_UPDATE_CHANNELS
Update autogenerated channels (normals or projected UV for example)
Definition 3DBaseObject.h:86
@ OBJECT_UPDATE_FIRST_VALUE
For intenal offset.
Definition 3DBaseObject.h:83
OBJECT_COPY_FLAGS
Definition 3DBaseObject.h:92
@ OBJECT_COPY_ALL_CHANNELS
If not defined, only CHANNEL_COPY_USEFUL_ONLY are copied (channels than are not auto generated.
Definition 3DBaseObject.h:96
@ OBJECT_COPY_CREATE_INSTANCE
Create an instance copy of the object that should be affected to a node.
Definition 3DBaseObject.h:94
@ OBJECT_PREVENT_OBJECT_COPY
Used internally. Prevent a node to copy its object (creating an empty node)
Definition 3DBaseObject.h:95
C3DTPoint template class definition for handling x, y, z 3D point coordinate.
@ CHECKSUM_ALL
All is used for computing checksum.
Definition 3DType.h:433
CDependentChannels class definition which handles a CChannel array.
This is the base class for any kind of object.
Definition 3DBaseObject.h:106
virtual bool InvalidateChannels(unsigned int channelType)
Notify that channels that have cache should be recomputed (ie, UVW channel or normal channel for exam...
longint GetUpdateStamp(OBJECT_UPDATE_PROPERTIES flags) const
Allow to know if the given flag changed between two call.
virtual void InheritFlags(const C3DBaseObject &srcObject, int copyflags=OBJECT_COPY_DEFAULT)
This methods only inherits srcObject flags and custom data and optionaly objectGUID / instanceID if s...
virtual bool Update(C3DScene *scene, unsigned int updateMode)
Information that have been invalidated are recomputed when calling this method.IsInstanciated.
virtual bool MatrixTransform(const C4x4Matrix &matrix)
Transform the 3D information with the given matrix. The object should not be instanciated or all inst...
bool IsGeomObject() const
return true if the object is an OBJECT_GEOM. Cf. OBJECT_KINDOF
virtual unsigned int GetChecksum(unsigned int checksumFlags=CHECKSUM_ALL) const
When not overriden, the checksum is only made on the kind of object. When overidden,...
OBJECT_KINDOF GetKindOf() const
return OBJECT_KINDOF, which defines the kind of object.
BaseObjectID GetObjectID() const
Return the node GUID depending on the scene. If no scene defined, CGuidMgr::UNDEFINED_GUID is returne...
virtual void Invalidate(unsigned int objectInvalidationFlags, bool set=true)
Notify that some information changed (combination of OBJECT_UPDATE_PROPERTIES invalidation flags) and...
CXString GetTypeString() const
return a string containing the kind of the object ("curve", "camera"...)
static C3DBaseObject * Create(OBJECT_KINDOF kindOf)
Allocates and creates a new empty object of the given type OBJECT_KINDOF. Uses xNew internally.
bool IsInvalidate(OBJECT_UPDATE_PROPERTIES flag) const
Allow to know if an invalidate flag has been set. Invalidate flag is reset when Update is called.
int GetInstanceCount() const
Return the instance count. If the count then this is a single object that is referenced only one time...
bool IsInstanciated() const
return true if several instance of the object exists. The C3DSceneNode that reference these instances...
virtual void SetScene(C3DScene *scene)
Associate the object to a scene. a GUID for that object in the scene is assigned.
C3DScene * GetScene() const
Get the associated object scene.
virtual C3DBaseObject * GetFinalObject(bool detach=false, bool computeIfNeeded=true)
Returns the object itself or any kind of object. For example for a patch it can returns a C3DObject o...
Definition 3DBaseObject.h:177
unsigned int GetCustomDataChecksum(unsigned int ignoreCustomID,...) const
For object which are not geometric object, the checksum could be made on CustomData,...
unsigned int GetInvalidateFlags() const
Return the flags that have been invalidated.
C3DCamera handles camera object.
Definition 3DCamera.h:61
A 3D curve is a list of C3DPoint. It has specific flags and material.
Definition 3DCurve.h:20
A dummy is a void object that does not contains geometry.
Definition 3DDummy.h:21
This is the base class for any object containing geometry (curve, polygonal object,...
Definition 3DGeomObject.h:49
C3DGroup class is an object without geometry. C3DGroup allows to organize the scene hierarchically.
Definition 3DGroup.h:22
This class implements a light object in the scene (OBJECT_LIGHT)
Definition 3DLight.h:50
This class can be provided in C3DScene::Copy operations and allows to modify the created kind of clas...
Definition 3DScene.h:47
C3DObject handles polygonal mesh.
Definition 3DObject.h:24
C3DPatch handles handles patch object smoothed using a subdivision algorithm.
Definition 3DPatch.h:34
The class allows to get access to the scene graph, node hierarchy, material.
Definition 3DScene.h:306
CCustomData is a handly class for storing any kind of data.
Definition CustomData.h:106
CGeomInfo is an helper class oftenly required by different methods.
Definition GeomInfo.h:71
Definition InstanciatedObject.h:16