6#if !defined(AFX_3DGEOMOBJECT_H__31D6A935_B14E_11D2_A1E5_000000000000__INCLUDED_)
7#define AFX_3DGEOMOBJECT_H__31D6A935_B14E_11D2_A1E5_000000000000__INCLUDED_
17BEGIN_MOOTOOLS_NAMESPACE
23 SUBOBJECT_NONE = 0x00,
33 GENNORMAL_NONE = 0x00,
57 typedef enum faceModeEnum
XEnumType(
unsigned int)
59 FACE_DEFAULT_MODE = 0,
67 WELD_SRC_CANT_HAVE_FLAGS = 0x01,
68 WELD_SRC_MUST_HAVE_FLAGS = 0x02,
69 WELD_TARGET_CANT_HAVE_FLAGS = 0x04,
70 WELD_TARGET_MUST_HAVE_FLAGS = 0x08,
109 void SetFaceMode(faceModeEnum mode);
110 faceModeEnum GetFaceMode(
void)
const;
168 bool MergeCoplanarFaces(
double radianMaxAngle,
unsigned int channels = ALL_CHANNELS_TYPE);
177#ifdef GEOMOBJECT_SUPPORT_BINDING
211 virtual void Dump(
unsigned int flags);
232 faceModeEnum faceMode;
242#ifdef GEOMOBJECT_SUPPORT_BINDING
268 this->
object = refobject;
273END_MOOTOOLS_NAMESPACE
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
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