![]() |
Polygon Crucher SDK - Documentation
Documentation
|
CMultiresolutionObject is the base class for multiresolution object. There is two kind of multiresolution object: More...
CMultiresolutionObject is the base class for multiresolution object. There is two kind of multiresolution object:
#include <MultiresolutionObject.h>
Public Member Functions | |
DECLARE_DYNAMIC_XOBJECT (CMultiresolutionObject) | |
CSceneOptimizer * | GetOptimizer () |
void | DetachOptimizer () |
C3DSceneNode * | GetSrcNode () const |
Return the node of the original scene (if any) to which the object refers. (note: if the original scene has been deleted the node pointer might be invalid, and should not be used.) | |
C3DExtObject * | GetExtObject () const |
Return the optimized undynamic object (if any) | |
void | SetExtObject (C3DExtObject *object) |
void | SetSrcNode (C3DSceneNode *node) |
void | SetOptimizer (CSceneOptimizer *sceneOptimizer) |
virtual unsigned int | GetMagicTarget () const =0 |
virtual void | SetMagicTarget (unsigned int ratio)=0 |
virtual double | GetCurrentRatio () const =0 |
virtual int | GetRemovableFaceNbr () const =0 |
virtual int | GetRemovablePtNbr () const =0 |
virtual void | GetMinSize (int &minFaceSize, int &minPointSize) const =0 |
virtual void | GetMaxSize (int &maxFaceSize, int &maxPointSize) const =0 |
virtual void | GetCurrentSize (int ¤tFaceSize, int ¤tPointSize) const =0 |
virtual int | GetTargetCount (double ratio, unsigned int mode, bool &canBeOptimizedButleftUnoptimized) const =0 |
return the approx. final number of point or faces giving a ratio accordingly to target mode (OPTIMIZE_TO_POINT | OPTIMIZE_TO_FACE). | |
virtual void | SetMinSize (int minFaceSize, int minPointSize)=0 |
Set the minimum point/face size the objet have at lowest ratio. | |
virtual void | SetMaxSize (int maxFaceSize, int maxPointSize)=0 |
Set the maximum point/face size the objet have at highest ratio. | |
virtual void | LockRatio (bool lock)=0 |
the ratio is locked and cannot be changed | |
virtual bool | IsRatioLocked () const =0 |
virtual bool | IsMultiResFlagSet (MROBJECT_PROPERTIES flag) const =0 |
virtual void | SetMultiResFlag (MROBJECT_PROPERTIES flag, bool set)=0 |
virtual void | SetProgressive (bool set)=0 |
The object uses the provided progressive threshold (set MROBJECT_PROGRESSIVE_RATIO flag which is used only if the MRObject is used directly without the optimizer) | |
virtual void | SetProgressiveThreshold (double threshold)=0 |
virtual double | GetProgressiveThreshold () const =0 |
virtual int | SetObjectRatio (double ratio, int requiredNbr, unsigned int mode=OPTIMIZE_TO_FACE|OPTIMIZE_TO_RATIO)=0 |
virtual void | FreezeObject () |
This remove the multiresolution data, freezes the object at its given level of details and clean it, removing some invalid faces. SetObjectRatio cannot be called anymore. | |
virtual double | GetLastKnownRatio (bool &unknownRatio) const |
Return the last requested ratio used with OPTIMIZE_TO_RATIO (progressiveThreshold adjustement is not taken into account) | |
![]() | |
C3DObject (C3DPointList *points, C3DFaceList *faces, CDependentChannels *channels=NULL) | |
bool | Init (int points, int faces, int defaultFaceSize, BOOL createUVChannel=FALSE, int uvpts=0, ChannelID chnid=0) |
![]() | |
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. | |
virtual void | Serialize (CXArchive &ar) |
int | GetPointNbr () const |
Return the object point number. | |
int | GetFaceNbr () const |
Return the object face number. | |
bool | GetBoundingBox (C3DPoint &point1, C3DPoint &point2, unsigned int bboxflags, unsigned int elmtflags=0, bool set=false, const C3DSceneNode *node=NULL) |
bool | GetBoundingBox (C3DBBox &bbox, unsigned int bboxflags, unsigned int elmtflags=0, bool set=false, const C3DSceneNode *node=NULL) |
bool | GetCG (C3DPoint &point) |
C3DFaceList * | GetFaceList () |
Get the object face list. | |
C3DPointList * | GetPointList () |
Get the object point list. | |
CDependentChannels * | GetChannels () |
Get the object channels. | |
const CDependentChannels * | GetChannels () const |
Get const object channels. | |
virtual void | SetFaceList (C3DFaceList *faceslist, bool deletePrevious=true) |
Set the object face list and delete existing one, unless deletePrevious = false. | |
virtual void | SetPointList (C3DPointList *pointslist, bool deletePrevious=true) |
Set the object point list and delete existing one, unless deletePrevious = false. | |
virtual void | SetChannels (CDependentChannels *channels, bool deletePrevious=true) |
Set the object channellist and delete existing one, unless deletePrevious = false. | |
void | FreeExtra () |
Release any extra memory attached to the object. | |
void | ChangeChannelID (C3DScene *scene, CHashMap< CChannelInfo, const CChannelInfo &, CChannelInfo > &channelMap) |
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. | |
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. | |
virtual bool | Update (C3DScene *scene, unsigned int updateMode) |
Information that have been invalidated are recomputed when calling this method.IsInstanciated. | |
virtual void | Invalidate (unsigned int flags, bool set=true) |
Notify that some information changed (combination of OBJECT_UPDATE_PROPERTIES invalidation flags) and invalidate related information, which will be updated in the Update call. The invalidated information is not destroyed until the next Update call. | |
virtual bool | InvalidateChannels (unsigned int channelType) |
Notify that channels that have cache should be recomputed (ie, UVW channel or normal channel for example). This give better control than Invalidate(OBJECT_INV_CHANNELS) which invalidate any channel information. We can specify with this method what need to be invalidated depending on the performed operation. Return true, if a cache has been invalidated. | |
virtual void | Clean () |
Clean the object by faces and points which flag have been set to invalid. Update channels accordingly. | |
void | CleanChannels (ChannelID channelType=CHANNELID_UNDEFINED, bool mustHave=true) |
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. | |
void | SetSmoothAngle (float radianAngle) |
Set the smooth angle for the specific object. It is used, for example, when calling GetPointNormalChannel() to generate normal breaks. | |
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. | |
void | SetSmoothMode (NormalSmoothMode mode) |
Set way normals are generated. Cf. NormalSmoothMode to learn more about the differences. | |
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. | |
void | SetFaceMode (faceModeEnum mode) |
faceModeEnum | GetFaceMode (void) const |
CChannel * | GetChannelByID (ChannelID id, Channel3DType type) |
CChannel * | GetChannelByIndex (int index, Channel3DType type=CHANNEL_TYPE_UNDEFINED, bool onlyValid=true) |
CPointNormalChannel * | GetPointNormalChannel () |
CFaceNormalChannel * | GetFaceNormalChannel () |
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. | |
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. | |
void | SetGlobalVCChannel (ChannelID id, float modulate=1.0f) |
Set a global VC channel which will superseed, the particular channel defined in the face materials. | |
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. | |
void | SetGlobalUVWChannel (ChannelID id) |
Set a global UVW channel which will superseed, the particular channel defined in the face material maps. | |
bool | GenerateUVW (C3DScene *scene, CHANNEL_PROPERTIES tagChannelFlag=CHANNEL_NONE, bool setTagChannelFlag=true) |
Generate UV when the object contains materials with planar / cylindrical / cubic projection (...) | |
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. | |
bool | UnifyNormals () |
bool | FlipNormals (FACE_PROPERTIES properties=FACE_NONE, bool musthave=true) |
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. | |
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. | |
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. | |
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. | |
C3DObject * | SubObject (const int *faceIndexes, unsigned int faceCount) |
Return a sub object from this object using the provided faceIndexes array which has faceCount index. | |
int | ExplodeIntoIsolatedParts (C3DGeomObjectArray &newobjects) |
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. | |
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. | |
bool | MergeCoplanarFaces (double radianMaxAngle, unsigned int channels=ALL_CHANNELS_TYPE) |
bool | IsTriangular (FACE_PROPERTIES properties=FACE_NONE, bool musthave=true) const |
bool | Triangulate (unsigned int channelType=ALL_CHANNELS_TYPE, FACE_PROPERTIES properties=FACE_NONE, bool musthave=true) |
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 | |
bool | SortFaces (FACE_SORT_MODE sort) |
bool | HasDifferentFrontAndBackUVChannel (const CGeomInfo *info, MapType maptype) const |
bool | HasBackFaceMaterials () const |
Return true if the object has different front and back face materials. | |
const CFBMaterialHashMap * | GetFBMaterialsHashMap () |
Get material hash (binded if necessary), trigger display. | |
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. usage sample. | |
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. | |
bool | ReplaceMaterial (MaterialID matid, MaterialID newmatid) |
Replace face material which have matid with newmatid. | |
![]() | |
virtual bool | DeleteFromNode () |
virtual void | PostSerialize (CXArchive &ar, bool lastCall) |
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. | |
BaseObjectID | GetObjectID () const |
Return the node GUID depending on the scene. If no scene defined, CGuidMgr::UNDEFINED_GUID is returned. | |
int | GetInstanceCount () const |
Return the instance count. If the count then this is a single object that is referenced only one time in the scene. | |
bool | IsInstanciated () const |
return true if several instance of the object exists. The C3DSceneNode that reference these instances can be retrieved using C3DScene::GetInstancesByID | |
unsigned int | GetCustomDataChecksum (unsigned int ignoreCustomID,...) const |
For object which are not geometric object, the checksum could be made on CustomData, and you can ignore some ID might be ignored if they content runtime value that does not reflect a change of the content. The list must be terminated by 0. | |
virtual bool | NeedUpdate () const |
unsigned int | GetInvalidateFlags () const |
Return the flags that have been invalidated. | |
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. | |
longint | GetUpdateStamp (OBJECT_UPDATE_PROPERTIES flags) const |
Allow to know if the given flag changed between two call. | |
virtual bool | IsFinalObject () const |
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 or a C3DPatch if the patch is not subdivided. | |
C3DBaseObject * | Copy (int copyflags=OBJECT_COPY_DEFAULT, C3DObjectCreator *objectCreator=NULL) const |
void | SetFlag (OBJECT_PROPERTIES flag, bool set) |
void | SetFlags (unsigned int flags, bool set) |
bool | IsFlagSet (OBJECT_PROPERTIES flag) const |
bool | IsOneFlagSet (unsigned int flags) const |
bool | CheckFlags (unsigned int checkflags, bool allSetOrNoneSet) const |
CCustomData & | GetCustomData () |
const CCustomData & | GetCustomData () const |
operator C3DGeomObject * () const | |
Operators (cast operators, return NULL if object is this or if the type is incorrect It does not perform any geometric or topologic conversions. | |
operator C3DGroup * () const | |
Cf. C3DGeomObject*(). | |
operator C3DObject * () const | |
Cf. C3DGeomObject*(). | |
operator C3DCurve * () const | |
Cf. C3DGeomObject*(). | |
operator C3DPatch * () const | |
Cf. C3DGeomObject*(). | |
operator C3DDummy * () const | |
Cf. C3DGeomObject*(). | |
operator C3DLight * () const | |
Cf. C3DGeomObject*(). | |
operator C3DCamera * () const | |
Cf. C3DGeomObject*(). | |
bool | IsGeomObject () const |
return true if the object is an OBJECT_GEOM. Cf. OBJECT_KINDOF | |
OBJECT_KINDOF | GetKindOf () const |
return OBJECT_KINDOF, which defines the kind of object. | |
CXString | GetTypeString () const |
return a string containing the kind of the object ("curve", "camera"...) | |
![]() | |
virtual bool | Delete () |
int | GetRefCount () const |
int | AddRef () const |
Additional Inherited Members | |
![]() | |
enum | faceModeEnum { FACE_DEFAULT_MODE = 0 , SINGLE_SIDE , DOUBLE_SIDE } |
enum | weldMode { WELD_NONE = 0 , WELD_SRC_CANT_HAVE_FLAGS = 0x01 , WELD_SRC_MUST_HAVE_FLAGS = 0x02 , WELD_TARGET_CANT_HAVE_FLAGS = 0x04 , WELD_TARGET_MUST_HAVE_FLAGS = 0x08 } |
typedef enum C3DGeomObject::faceModeEnum | faceModeEnum |
typedef enum C3DGeomObject::weldMode | WeldMode |
![]() | |
static C3DBaseObject * | Create (OBJECT_KINDOF kindOf) |
Allocates and creates a new empty object of the given type OBJECT_KINDOF. Uses xNew internally. | |
This remove the multiresolution data, freezes the object at its given level of details and clean it, removing some invalid faces. SetObjectRatio cannot be called anymore.
Reimplemented in CMultiresolutionObject1.
Implemented in CMultiresolutionObject1.
|
pure virtual |
Implemented in CMultiresolutionObject1.
Implemented in CMultiresolutionObject1.
|
pure virtual |
Implemented in CMultiresolutionObject1.
|
pure virtual |
Implemented in CMultiresolutionObject1.
Implemented in CMultiresolutionObject1.
Implemented in CMultiresolutionObject1.
|
pure virtual |
return the approx. final number of point or faces giving a ratio accordingly to target mode (OPTIMIZE_TO_POINT | OPTIMIZE_TO_FACE).
Implemented in CMultiresolutionObject1.
|
pure virtual |
Implemented in CMultiresolutionObject1.
the ratio is locked and cannot be changed
Implemented in CMultiresolutionObject1.
Implemented in CMultiresolutionObject1.
Set the maximum point/face size the objet have at highest ratio.
Implemented in CMultiresolutionObject1.
Set the minimum point/face size the objet have at lowest ratio.
Implemented in CMultiresolutionObject1.
|
pure virtual |
Implemented in CMultiresolutionObject1.
The object uses the provided progressive threshold (set MROBJECT_PROGRESSIVE_RATIO flag which is used only if the MRObject is used directly without the optimizer)
Implemented in CMultiresolutionObject1.