Polygon Crucher SDK - Documentation
Documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
3DGeomObject.h
Go to the documentation of this file.
1//! @file 3DGeomObject.h
2//! The file contains definition related to C3DGeomObject which is the common object type for any geometrical object
3//!
4//////////////////////////////////////////////////////////////////////
5
6#if !defined(AFX_3DGEOMOBJECT_H__31D6A935_B14E_11D2_A1E5_000000000000__INCLUDED_)
7#define AFX_3DGEOMOBJECT_H__31D6A935_B14E_11D2_A1E5_000000000000__INCLUDED_
8
9#ifdef _MSC_VER
10#pragma once
11#endif // _MSC_VER
12
13#include "3DBaseObject.h"
14#include "3DBBox.h"
15#include "MaterialMap.h"
16
17BEGIN_MOOTOOLS_NAMESPACE
18
19//! @enum SUBOBJECT_MODE
20//! @brief Mode defining the subobject to return for C3DGeomObject::SubOject
21typedef enum SUBOBJECT_MODE XEnumType(unsigned int)
22{
23 SUBOBJECT_NONE = 0x00,
24 SUBOBJECT_FACE_EQUAL = 0x01, //!< The returned subobject will contain faces which have the specified number of index
25 SUBOBJECT_FACE_NOTEQUAL = 0x02, //!< The returned subobject will contain faces which have less than the specified number of index
26 SUBOBJECT_FACE_GREATER = 0x03, //!< The returned subobject will contain faces which have more than specified number of index
28
29//! @enum GENNORMAL_MODE
30//! @brief Flags for C3DGeomObject::GenerateNormals
31typedef enum GENNORMAL_MODE
32{
33 GENNORMAL_NONE = 0x00,
34 GENNORMAL_ALL_FACES = 0x01, //!< Generate normals for the whole object (this flag implies GENNORMAL_INCOMPLETE_FACE_ONLY)
35 GENNORMAL_INCOMPLETE_FACE_ONLY = 0x02, //!< Generates normals for faces that are incomplete (one of whose points has the POINT_IS_UNUSED flag)
36 GENNORMAL_PER_VERTEX = 0x04, //!< Generate per vertex normal (CPointNormalChannel smooth normals)
37 GENNORMAL_PER_FACE = 0x08, //!< Generate per face normal (CFaceNormalChannel flat normals)
38 GENNORMAL_SPEC_CHANNEL = 0x10, //!< Generate a spec normal channel. GENNORMAL_ALL_FACES or GENNORMAL_INCOMPLETE_FACE_ONLY must used
40
42class CMapChannelID;
43
44//! @class C3DGeomObject
45//! @brief This is the base class for any object containing geometry (curve, polygonal object, patch...)
46//! @details Such kind of objects have a C3DPointList and/or C3DFaceList and some additional channel information.
47//! Cf. @ref OBJECTS to get more details on objects and particularly C3DGeomObject.
48class DLL_3DFUNCTION C3DGeomObject : public C3DBaseObject
49{
50 DECLARE_SERIAL_XOBJECT(C3DGeomObject);
51
52 friend CGeomInfo;
53
54public:
55 //! @enum GENNORMAL_MODE
56 //! @brief Flags defining the rendering face mode
57 typedef enum faceModeEnum XEnumType(unsigned int)
58 {
59 FACE_DEFAULT_MODE = 0,
60 SINGLE_SIDE,
61 DOUBLE_SIDE,
62 } faceModeEnum;
63
64 typedef enum weldMode XEnumType(unsigned int)
65 {
66 WELD_NONE = 0, //!< Any points could be welded
67 WELD_SRC_CANT_HAVE_FLAGS = 0x01, //!< A point will not move if it has the specified flags
68 WELD_SRC_MUST_HAVE_FLAGS = 0x02, //!< A point will move only if it has the specified flags
69 WELD_TARGET_CANT_HAVE_FLAGS = 0x04, //!< A point can't be a target if it has the specified flags (a target is a point that can be welded to)
70 WELD_TARGET_MUST_HAVE_FLAGS = 0x08, //!< A point can be a target only if it has the specified flags
71 } WeldMode;
72
74 C3DGeomObject(C3DPointList *points, C3DFaceList *faces = NULL, CDependentChannels *channels = NULL); //!< Creates a new C3DGeomObject which uses provided points, faces and channels. These data will be released by the object when it is destroyed
75 virtual ~C3DGeomObject();
76
77 virtual void Serialize( CXArchive& ar );
78
79 int GetPointNbr() const; //!< Return the object point number
80 int GetFaceNbr() const; //!< Return the object face number
81
82 //! @details Computes the bounding box, on different way.
83 //! BBOX_FACES or BBOX_POINTS must be at least set, depending on wether you want a bounding box on points, or on faces. elmtflags can be optionnaly used to ignore points or faces based on their attributes (hidden face...)
84 //! @param bboxflags is combination of BBOX_MODE flags. BBOX_FACES or BBOX_POINTS must be at least set, depending on wether you want a bounding box on points, or on faces.
85 //! @param elmtflags is one or more POINT_PROPERTIES or FACE_PROPERTIES flags. elmtflags can be optionnaly used to ignore some points or some faces based on their attributes (hidden face...)
86 //! @param node The reference node must be provided if BBOX_EXACT is set.
87
88 //! @return If successful, it returns true with point1 and point2 containing the required bounding box limits.
89 bool GetBoundingBox(C3DPoint& point1, C3DPoint& point2, unsigned int bboxflags, unsigned int elmtflags = 0, bool set = false, const C3DSceneNode *node = NULL);
90 //! @see C3DGeomObject::GetBoundingBox
91 //! @return If successful, it returns true with bbox containing the required bounding box.
92 bool GetBoundingBox(C3DBBox& bbox, unsigned int bboxflags, unsigned int elmtflags = 0, bool set = false, const C3DSceneNode* node = NULL);
93
94 bool GetCG(C3DPoint& point);
95
96 //! @name Face smoothing
97 //! these methods does not generates normals, they only predefined the smooth angle to be used when point normals are generated.
98 //! To generates point normals, use CPointNormalChannel *GetPointNormalChannel() or GenerateNormals
99 //! @{
100 void SetSmoothAngle(float radianAngle); //!< Set the smooth angle for the specific object. It is used, for example, when calling GetPointNormalChannel() to generate normal breaks.
101 float GetSmoothAngle(bool *globalRadianAngle = NULL) const; //!< Get the smooth angle in radian. If object has no specific angle, it will return the C3DScene::GetSmoothAngle. globalRadianAngle, if provided, is set to true, if the object used the global scene smooth angle.
102 void SetSmoothMode(NormalSmoothMode mode); //!< Set way normals are generated. Cf. NormalSmoothMode to learn more about the differences.
103 NormalSmoothMode GetSmoothMode(bool *globalMode = NULL) const; //!< Get the smooth method used for the object. If object has no specific method, it will return the C3DScene::GetSmoothMode. globalMode, if provided, is set to true, if the object used the global normal mode.
104
105 //! @}
106
107 //! @name Face culling
108 //! @{
109 void SetFaceMode(faceModeEnum mode);
110 faceModeEnum GetFaceMode(void) const;
111
112 //! @}
113
114 C3DFaceList* GetFaceList(); //!< Get the object face list
115 C3DPointList* GetPointList(); //!< Get the object point list
116 CDependentChannels *GetChannels(); //!< Get the object channels
117 const CDependentChannels* GetChannels() const; //!< Get const object channels
118
119 virtual void SetFaceList(C3DFaceList *faceslist, bool deletePrevious = true); //!< Set the object face list and delete existing one, unless deletePrevious = false
120 virtual void SetPointList(C3DPointList *pointslist, bool deletePrevious = true); //!< Set the object point list and delete existing one, unless deletePrevious = false
121 virtual void SetChannels(CDependentChannels *channels, bool deletePrevious = true); //!< Set the object channellist and delete existing one, unless deletePrevious = false
122
123 void FreeExtra(); //!< Release any extra memory attached to the object
124
125 //! @name Channel information
126 //! @{
127 CChannel *GetChannelByID(ChannelID id, Channel3DType type);
128 CChannel *GetChannelByIndex(int index, Channel3DType type = CHANNEL_TYPE_UNDEFINED, bool onlyValid = true);
129 CPointNormalChannel *GetPointNormalChannel();
130 CFaceNormalChannel *GetFaceNormalChannel();
131 ChannelID AddChannel(CChannel *channel, ChannelID id = CHANNELID_UNDEFINED); //!< If id = CHANNELID_UNDEFINED, the id is automatically assigned when adding the channel to object channels. If id != CHANNELID_UNDEFINED, the id might be modified if it already exists in object channels
132
133 ChannelID GetGlobalVCChannel(float& modulate) const; //!< The global VC channel is a VC channel ID shared by all faces whatever their materials. The method can return CHANNELID_UNDEFINED, because it is usually defined in C3DMaterial::GetVertexColor
134 void SetGlobalVCChannel(ChannelID id, float modulate = 1.0f); //!< Set a global VC channel which will superseed, the particular channel defined in the face materials
135 ChannelID GetGlobalUVWChannel() const; //!< The global UV channel is a UV channel ID shared by all faces whatever their materials and maps. The method can return CHANNELID_UNDEFINED, because it is usually defined in CMaterialMap::GetChannelID
136 void SetGlobalUVWChannel(ChannelID id); //!< Set a global UVW channel which will superseed, the particular channel defined in the face material maps
137 bool GenerateUVW(C3DScene *scene, CHANNEL_PROPERTIES tagChannelFlag = CHANNEL_NONE, bool setTagChannelFlag = true); //!< Generate UV when the object contains materials with planar / cylindrical / cubic projection (...)
138 ChannelID GlobalizeChannels(C3DScene *scene, bool removeOthers); //!< Gather UVW to a single channel from the different face material maps. If GetGlobalUVWChannel is defined, then the function return the already defined channel. Otherwise, a new channel is created from the different channel referenced by diffuse map and SetGlobalUVWChannel is called with that new channel ID.
139
140 //! @}
141
142 //! @name Mesh operation
143 //! @{
144 bool UnifyNormals();
145 bool FlipNormals(FACE_PROPERTIES properties = FACE_NONE, bool musthave = true);
146 bool GenerateNormals(unsigned int mode = GENNORMAL_PER_VERTEX, NormalSmoothMode smooth = NORMAL_GLOBAL_MODE); //!< Generate normal. Mode is one or a combination of GENNORMAL_MODE (if GENNORMAL_SPEC_CHANNEL is used). Return true if at least one normal has been computed, false if nothing need to be computed
147
148 virtual bool MatrixTransform(const C4x4Matrix& matrix); //!< Transform the 3D information with the given matrix. The object should not be instanciated or all instances are modified
149
150 //! @brief Weld points which distance is lower than distance specified value.
151 //! @param distance the value can be relative or absolute.
152 //! * absolute: points which distance is lower than the specified value are welded.
153 //! * relative: value is between 0.0 and 1.0 (but can be more) and is a percentage of the lowest object bounding box dimension.
154 //! @param absolute the distance specified is absolute. Otherwise di
155 //! @param handleChannels allows to weld duplicated value in the corresponding channels. This make a clean operation on the confused value of the corresponding channels. This call CDependentChannels::Weld internally with tolerance = 0.0
156 //! * When distance is 0.0, following parameters does not apply
157 //! * If distance != 0.0, there is a way to control which points can move and which shouldn't move
158 //! @param coupleFlagsNbr 0 if no variadic parameters are specified, the number of variadic parameters otherwise.
159 //! @param "variadic parameters" couple of values that defines the flags the points must have to be welded or welded to.
160 //! Ie: POINT_IS_SELECTED|POINT_BELONG_TO_BORDER, WELD_SRC_MUST_HAVE_FLAGS|WELD_TARGET_MUST_HAVE_FLAGS, POINT_USER_PROPERTIES1|POINT_USER_PROPERTIES2, WELD_TARGET_MUST_HAVE_FLAGS, POINT_USER_PROPERTIES3, WELD_TARGET_CAN_HAVE_FLAGS, 0
161 //! @return true is something was welded, false if nothing changed
162 bool Weld3DPoints(double distance, bool absolute, unsigned int handleChannels = ALL_CHANNELS_TYPE, unsigned int coupleFlagsNbr = 0, ...);
163 C3DObject *SubObject(int count, SUBOBJECT_MODE mode); //!< Return a sub object from this object based on the faces facecount index number and SUBOBJECT_MODE parameter.
164 C3DObject *SubObject(const int *faceIndexes, unsigned int faceCount); //!< Return a sub object from this object using the provided faceIndexes array which has faceCount index.
165 int ExplodeIntoIsolatedParts(C3DGeomObjectArray& newobjects);
166 bool Concatenate(C3DScene* scene, const C3DGeomObjectArray& object, C3DConcatenateFilter* filter = NULL); //!< Concatenate a set object object with the possibility to exclude some particular faces. Note: If object belong to a node, the coordinates are not transformed in any way. You need to transform them before the call if this is required or use the Concatenate variant with node array
167 bool Concatenate(C3DScene *scene, const C3DNodeArray& object, C3DConcatenateFilter *filter = NULL); //!< Concatenate a set of node containing geom object with the possibility to exclude some particular faces. Note: coordinates are transformed taken into account the node transformation.
168 bool MergeCoplanarFaces(double radianMaxAngle, unsigned int channels = ALL_CHANNELS_TYPE);
169 bool IsTriangular(FACE_PROPERTIES properties = FACE_NONE, bool musthave = true) const;
170 bool Triangulate(unsigned int channelType = ALL_CHANNELS_TYPE, FACE_PROPERTIES properties = FACE_NONE, bool musthave = true);
171 bool DisconnectBorderFaces(unsigned int channelType = ALL_CHANNELS_TYPE, unsigned int tagPointsFlags = POINT_BELONG_TO_BORDER|POINT_IS_CONFUSED, unsigned int tagFaceFlags = FACE_IS_BORDER|FACE_HAS_CONFUSED_POINTS, CPointGroupGraph *confusedGraph = NULL, bool simulate = false, C3DFaceList *originalChangedFaces = NULL); //!< pointFlags are set for the points that belongs to a seams. This flags cumulates with others
172 bool SortFaces(FACE_SORT_MODE sort);
173
174 //! @}
175
176 // Bindings
177#ifdef GEOMOBJECT_SUPPORT_BINDING
178 bool HasMaterialBindings() const;
179 void AddMaterialBinding(MaterialID id, MaterialID bindto);
180 C3DMaterial *GetMaterial(MaterialID id) const; // Get material taking care of the material bindings
181 MaterialID BindMaterialID(MaterialID id) const; // Return binded material id
182#endif
183
184 //! @name Materials used by the object
185 //! @{
186 bool HasDifferentFrontAndBackUVChannel(const CGeomInfo* info, MapType maptype) const;
187 bool HasBackFaceMaterials() const; //!< Return true if the object has different front and back face materials
188 const CFBMaterialHashMap *GetFBMaterialsHashMap(); //!< Get material hash (binded if necessary), trigger display
189 unsigned int GetMaterialsHashMap(CMaterialHashMap& hashMaterialMap, bool includeBackFace = true, bool reset = true); //!< Return reference material by the object as an association map that contains the materialID and the number of face that are concerned by the material. Some object (ie. curve) without faces can reference a material. In this case, the hash will associate a number of face of 0. Cf. @ref USE_GetMaterialsHashMap "usage sample"
190 bool ReplaceMaterials(const CHashMap<MaterialID, MaterialID, MaterialID>& materialMap); //!< Replace front / back face's material which have material key with the corresponding material value, trigger display. Return true if something changed
191 bool ReplaceMaterial(MaterialID matid, MaterialID newmatid); //!< Replace face material which have matid with newmatid
192
193 //! @}
194
196
197 void Inherit(const C3DGeomObject& srcObject, unsigned int channeltype, unsigned int channelflags); //!< This methods inherits srcObject points / faces / channel data structure. The object data information is not modified (left empty). It also call InheritFlags
198 virtual void InheritFlags(const C3DBaseObject& srcObject, int copyFlags = OBJECT_COPY_DEFAULT); //!< This methods only inherits srcObject flags and custom data. It does not modify the data structure.
199
200 virtual bool Update(C3DScene *scene, unsigned int updateMode);
201 virtual void Invalidate(unsigned int flags, bool set = true);
202 virtual bool InvalidateChannels(unsigned int channelType);
203
204 // virtuals
205 virtual void Clean(); //!< Clean the object by faces and points which flag have been set to invalid. Update channels accordingly.
206 void CleanChannels(ChannelID channelType = CHANNELID_UNDEFINED, bool mustHave = true);
207
208 virtual unsigned int GetChecksum(unsigned int checksumFlags = CHECKSUM_ALL) const; //!< Return a value that is a simple way to check if the geometry changed between two calls to the method. Checksum is base on geometry only, not customdata because customdata might have temporary values that does not reflect a content change
209
210#ifdef _DEBUG
211 virtual void Dump(unsigned int flags);
212 unsigned int MemoryStats() const;
213#endif
214
215private:
216 void InitObject(CDependentChannels *refchannels = NULL);
217
218protected :
220
222 ChannelID CreateUVWChannel(CMaterialMap *map, MaterialID matid, bool front);
223
224 // Virtuals
225 virtual bool InternalCopy(C3DBaseObject *&dstObject, int flags = OBJECT_COPY_DEFAULT, C3DObjectCreator *objectCreator = NULL) const;
226
227 // Display
228 void *bboxCache;
229
230 float smooth_angle; // Later : move it to node
231 NormalSmoothMode smooth_mode; // Later : move it to node
232 faceModeEnum faceMode;
233
234 C3DFaceList *faces;
235 C3DPointList *points;
236
237 CDependentChannels *channels;
238 ChannelID uvwID, vcID;
239 float vcModulate;
240
241 // Binds
242#ifdef GEOMOBJECT_SUPPORT_BINDING
246#endif
247};
248
249#if 0
250// This class free an object automatically
252{
253public:
254 C3DGeomObject *object;
255
257 {
258 object = NULL;
259 }
260
261 virtual ~C3DObjectDestructor()
262 {
263 xDelete(object);
264 }
265
266 void Attach(C3DGeomObject *refobject)
267 {
268 this->object = refobject;
269 }
270};
271#endif
272
273END_MOOTOOLS_NAMESPACE
274
275#endif // !defined(AFX_3DGEOMOBJECT_H__31D6A935_B14E_11D2_A1E5_000000000000__INCLUDED_)
C3DBBoxT template class for handling bounding box.
C3DBaseObject class which is the common base class for all object types.
GENNORMAL_MODE
Flags for C3DGeomObject::GenerateNormals.
Definition 3DGeomObject.h:32
@ GENNORMAL_INCOMPLETE_FACE_ONLY
Generates normals for faces that are incomplete (one of whose points has the POINT_IS_UNUSED flag)
Definition 3DGeomObject.h:35
@ GENNORMAL_ALL_FACES
Generate normals for the whole object (this flag implies GENNORMAL_INCOMPLETE_FACE_ONLY)
Definition 3DGeomObject.h:34
@ GENNORMAL_PER_FACE
Generate per face normal (CFaceNormalChannel flat normals)
Definition 3DGeomObject.h:37
@ GENNORMAL_PER_VERTEX
Generate per vertex normal (CPointNormalChannel smooth normals)
Definition 3DGeomObject.h:36
@ GENNORMAL_SPEC_CHANNEL
Generate a spec normal channel. GENNORMAL_ALL_FACES or GENNORMAL_INCOMPLETE_FACE_ONLY must used.
Definition 3DGeomObject.h:38
SUBOBJECT_MODE
Mode defining the subobject to return for C3DGeomObject::SubOject
Definition 3DGeomObject.h:22
@ SUBOBJECT_FACE_EQUAL
The returned subobject will contain faces which have the specified number of index.
Definition 3DGeomObject.h:24
@ SUBOBJECT_FACE_GREATER
The returned subobject will contain faces which have more than specified number of index.
Definition 3DGeomObject.h:26
@ SUBOBJECT_FACE_NOTEQUAL
The returned subobject will contain faces which have less than the specified number of index.
Definition 3DGeomObject.h:25
FACE_SORT_MODE
Definition 3DType.h:370
@ CHECKSUM_ALL
All is used for computing checksum.
Definition 3DType.h:433
NormalSmoothMode
Definition 3DType.h:401
@ NORMAL_GLOBAL_MODE
The object used the preferences smoothing mode.
Definition 3DType.h:402
Channel3DType
The channel type which can be used to cast to the appropriate class Bitwise operations can be use to ...
Definition Channel.h:27
FACE_PROPERTIES
Face flags used by any classes that inherit from CFace (C3DFace, CUVWFace...)
Definition Face.h:39
@ FACE_NONE
These flags can be used whatever the face class.
Definition Face.h:40
MapType
This enum allows to know the kind of texture map.
Definition MaterialMap.h:26
@ POINT_IS_CONFUSED
The point is confused with one or several other points.
Definition Point.h:29
@ POINT_BELONG_TO_BORDER
The point belongs to an edge which a border edge (belonging to a single face)
Definition Point.h:26
This is the base class for any kind of object.
Definition 3DBaseObject.h:106
Definition 3DScene.h:157
C3DFaceList class which implement a list of C3DFace. Each face contains indexes to 3D points stored i...
Definition 3DFaceList.h:249
This is the base class for any object containing geometry (curve, polygonal object,...
Definition 3DGeomObject.h:49
bool DisconnectBorderFaces(unsigned int channelType=ALL_CHANNELS_TYPE, unsigned int tagPointsFlags=POINT_BELONG_TO_BORDER|POINT_IS_CONFUSED, unsigned int tagFaceFlags=FACE_IS_BORDER|FACE_HAS_CONFUSED_POINTS, CPointGroupGraph *confusedGraph=NULL, bool simulate=false, C3DFaceList *originalChangedFaces=NULL)
pointFlags are set for the points that belongs to a seams. This flags cumulates with others
ChannelID GlobalizeChannels(C3DScene *scene, bool removeOthers)
Gather UVW to a single channel from the different face material maps. If GetGlobalUVWChannel is defin...
float GetSmoothAngle(bool *globalRadianAngle=NULL) const
Get the smooth angle in radian. If object has no specific angle, it will return the C3DScene::GetSmoo...
const CDependentChannels * GetChannels() const
Get const object channels.
weldMode
Definition 3DGeomObject.h:65
void SetSmoothAngle(float radianAngle)
Set the smooth angle for the specific object. It is used, for example, when calling GetPointNormalCha...
bool GenerateUVW(C3DScene *scene, CHANNEL_PROPERTIES tagChannelFlag=CHANNEL_NONE, bool setTagChannelFlag=true)
Generate UV when the object contains materials with planar / cylindrical / cubic projection (....
unsigned int GetMaterialsHashMap(CMaterialHashMap &hashMaterialMap, bool includeBackFace=true, bool reset=true)
Return reference material by the object as an association map that contains the materialID and the nu...
int GetFaceNbr() const
Return the object face number.
virtual bool InvalidateChannels(unsigned int channelType)
Notify that channels that have cache should be recomputed (ie, UVW channel or normal channel for exam...
virtual void InheritFlags(const C3DBaseObject &srcObject, int copyFlags=OBJECT_COPY_DEFAULT)
This methods only inherits srcObject flags and custom data. It does not modify the data structure.
bool GetBoundingBox(C3DBBox &bbox, unsigned int bboxflags, unsigned int elmtflags=0, bool set=false, const C3DSceneNode *node=NULL)
bool ReplaceMaterials(const CHashMap< MaterialID, MaterialID, MaterialID > &materialMap)
Replace front / back face's material which have material key with the corresponding material value,...
C3DPointList * GetPointList()
Get the object point list.
void FreeExtra()
Release any extra memory attached to the object.
virtual void Invalidate(unsigned int flags, bool set=true)
Notify that some information changed (combination of OBJECT_UPDATE_PROPERTIES invalidation flags) and...
void SetGlobalUVWChannel(ChannelID id)
Set a global UVW channel which will superseed, the particular channel defined in the face material ma...
int GetPointNbr() const
Return the object point number.
bool HasBackFaceMaterials() const
Return true if the object has different front and back face materials.
bool Weld3DPoints(double distance, bool absolute, unsigned int handleChannels=ALL_CHANNELS_TYPE, unsigned int coupleFlagsNbr=0,...)
Weld points which distance is lower than distance specified value.
NormalSmoothMode GetSmoothMode(bool *globalMode=NULL) const
Get the smooth method used for the object. If object has no specific method, it will return the C3DSc...
C3DObject * SubObject(int count, SUBOBJECT_MODE mode)
Return a sub object from this object based on the faces facecount index number and SUBOBJECT_MODE par...
CDependentChannels * GetChannels()
Get the object channels.
C3DObject * SubObject(const int *faceIndexes, unsigned int faceCount)
Return a sub object from this object using the provided faceIndexes array which has faceCount index.
virtual bool Update(C3DScene *scene, unsigned int updateMode)
Information that have been invalidated are recomputed when calling this method.IsInstanciated.
ChannelID GetGlobalVCChannel(float &modulate) const
The global VC channel is a VC channel ID shared by all faces whatever their materials....
void Inherit(const C3DGeomObject &srcObject, unsigned int channeltype, unsigned int channelflags)
This methods inherits srcObject points / faces / channel data structure. The object data information ...
bool GetBoundingBox(C3DPoint &point1, C3DPoint &point2, unsigned int bboxflags, unsigned int elmtflags=0, bool set=false, const C3DSceneNode *node=NULL)
ChannelID GetGlobalUVWChannel() const
The global UV channel is a UV channel ID shared by all faces whatever their materials and maps....
virtual void SetPointList(C3DPointList *pointslist, bool deletePrevious=true)
Set the object point list and delete existing one, unless deletePrevious = false.
virtual void Clean()
Clean the object by faces and points which flag have been set to invalid. Update channels accordingly...
bool Concatenate(C3DScene *scene, const C3DGeomObjectArray &object, C3DConcatenateFilter *filter=NULL)
Concatenate a set object object with the possibility to exclude some particular faces....
virtual void SetChannels(CDependentChannels *channels, bool deletePrevious=true)
Set the object channellist and delete existing one, unless deletePrevious = false.
virtual void SetFaceList(C3DFaceList *faceslist, bool deletePrevious=true)
Set the object face list and delete existing one, unless deletePrevious = false.
bool ReplaceMaterial(MaterialID matid, MaterialID newmatid)
Replace face material which have matid with newmatid.
virtual unsigned int GetChecksum(unsigned int checksumFlags=CHECKSUM_ALL) const
Return a value that is a simple way to check if the geometry changed between two calls to the method....
void SetSmoothMode(NormalSmoothMode mode)
Set way normals are generated. Cf. NormalSmoothMode to learn more about the differences.
void SetGlobalVCChannel(ChannelID id, float modulate=1.0f)
Set a global VC channel which will superseed, the particular channel defined in the face materials.
const CFBMaterialHashMap * GetFBMaterialsHashMap()
Get material hash (binded if necessary), trigger display.
bool GenerateNormals(unsigned int mode=GENNORMAL_PER_VERTEX, NormalSmoothMode smooth=NORMAL_GLOBAL_MODE)
Generate normal. Mode is one or a combination of GENNORMAL_MODE (if GENNORMAL_SPEC_CHANNEL is used)....
ChannelID AddChannel(CChannel *channel, ChannelID id=CHANNELID_UNDEFINED)
If id = CHANNELID_UNDEFINED, the id is automatically assigned when adding the channel to object chann...
C3DGeomObject(C3DPointList *points, C3DFaceList *faces=NULL, CDependentChannels *channels=NULL)
Creates a new C3DGeomObject which uses provided points, faces and channels. These data will be releas...
bool Concatenate(C3DScene *scene, const C3DNodeArray &object, C3DConcatenateFilter *filter=NULL)
Concatenate a set of node containing geom object with the possibility to exclude some particular face...
virtual bool MatrixTransform(const C4x4Matrix &matrix)
Transform the 3D information with the given matrix. The object should not be instanciated or all inst...
C3DFaceList * GetFaceList()
Get the object face list.
C3DMaterial is the base class for materials. There is currently two kinds of materials: C3DPbrMateria...
Definition 3DMaterial.h:69
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
Definition 3DPointList.h:267
The class allows to get access to the scene graph, node hierarchy, material.
Definition 3DScene.h:306
A node matches one element that is part of the C3DScene graph. It references a C3DBaseObject and has ...
Definition 3DSceneNode.h:64
The class defines an x, y, z 3D point which can use int, float or double.
Definition 3DPoint.h:27
A CChannel is the base class for some additional information associated to an object.
Definition Channel.h:93
This class contains an array of CChannel information which are associated to the object.
Definition DependentChannels.h:56
This class gets an object material hash. It returns front and back material pair. @Note if we have a ...
Definition 3DFaceList.h:108
CFaceNormalChannel is the channel class dedicated to vertex colors.
Definition FaceNormalChannel.h:22
CGeomInfo is an helper class oftenly required by different methods.
Definition GeomInfo.h:71
CMaterialMap handles material texture map.
Definition MaterialMap.h:95
CPointNormalChannel is the channel class dedicated to vertex colors.
Definition PointNormalChannel.h:61
Definition XArchive.h:17