![]() |
Polygon Crucher SDK - Documentation
Documentation
|
CGeomInfo is an helper class oftenly required by different methods. More...
CGeomInfo is an helper class oftenly required by different methods.
For example, CFaceList or CPointList are not linked together. Moreover, CFaceList knows nothing about its owner, which is often a C3DGeomObject. So CGeomInfo is a way to provide that additional information when it is needed.
You can construct a CGeomInfo on the stack using the appropriate C3DGeomObject or C3DSceneNode.
Most of the time this is the CGeomInfo main usage.
But depending on the method called, CGeomInfo can also get the operation result.
This is the case for C3DFaceList::Triangulate method which does not modify the provided face list, but generates a new list.
The result can be retrieved using CGeomInfo::GetDst3DPointList.
Depending on how is initialized to the CGeomInfo you can also get additional results.
This code shows how to generate a triangulated object from an object.
If a list is created by a method, it belongs to the CGeomInfo unless you retrieve it using on of the provided method with detach = true.
Saying that, this simply means, that things are destroyed automatically if not required by the caller.
#include <GeomInfo.h>
Public Member Functions | |
CGeomInfo (C3DSceneNode *node, C3DBaseObject *object=NULL) | |
If object = NULL, node->GetBaseObject is used. scene = object scene if any, or node scene otherwise (which are the same most of the time) | |
CGeomInfo (C3DBaseObject *object) | |
CGeomInfo (CFaceList *faces, CPointList *points) | |
Can be use with a generic CFaceList / CPointList and GetSrcFaceList / GetSrcPointList only. | |
void | Init (C3DSceneNode *node=NULL, C3DBaseObject *object=NULL) |
void | SetFaceList (CFaceList *faces, CFaceList *dstfaces=NULL, unsigned int deleteInfoGeomFlags=GEOMINFO_DELETE_NONE) |
void | SetPointList (CPointList *points, CPointList *dstpoints=NULL, unsigned int deleteInfoGeomFlags=GEOMINFO_DELETE_NONE) |
CPointList * | GetSrcPointList (bool detach=false) const |
Return the source point list, which has been set by the constructor. detach = true means that CGeomInfo does not own the list anymore. | |
CFaceList * | GetSrcFaceList (bool detach=false) const |
Return the source face list, which has been set by the constructor. detach = true means that CGeomInfo does not own the list anymore. | |
C3DPointList * | GetSrc3DPointList (bool detach=false) const |
Return the source 3D point list, which has been set by the constructor. | |
C3DFaceList * | GetSrc3DFaceList (bool detach=false) const |
C3DPointList * | GetDst3DPointList (bool detach=false) const |
When using SetPointList with source and destination points. | |
C3DFaceList * | GetDst3DFaceList (bool detach=false) const |
When using SetFaceList with source and destination faces. | |
void | SetScene (C3DScene *scene) |
C3DScene * | GetScene () const |
C3DBaseObject * | GetBaseObject () const |
C3DGeomObject * | GetGeomObject () const |
Return NULL if not a geomobject. | |
C3DSceneNode * | GetNode () const |
ChannelID | GetMaterialUVWChannelID (C3DScene *scene, MaterialID id, MapType type, bool front=true) const |
Get channel ID (if any, CHANNELID_UNDEFINED otherwise) for the provided material which belong to scene (useful if object or node does not belong to any scene, or if material belong to a different scene) | |
ChannelID | GetMaterialUVWChannelID (MaterialID id, MapType type, bool front=true) const |
Get the channel ID (if any, CHANNELID_UNDEFINED otherwise) for the provided material which belong to object's scene (or node's scene) that was used to initialized the CGeomInfo. | |
CDependentChannels * | GetSrcChannels (bool detach=false) const |
CUVWChannel * | GetSrcUVWChannelByIndex (unsigned int index, CUVWFaceList *&faces, CUVWPointList *&uvpoints) const |
Internally call CDependentChannels::GetUVWChannelByIndex. Return NULL if no UVW index exists in source channel. | |
CUVWChannel * | GetSrcUVWChannelByID (ChannelID chnid, CUVWFaceList *&faces, CUVWPointList *&uvpoints) const |
Internally call CDependentChannels::GetUVWChannelByID. Return NULL if no UVW ID exists in source channel. | |
CVCChannel * | GetSrcVCChannelByIndex (unsigned int index, CVCFaceList *&faces, CVCPointList *&uvpoints) const |
Internally call CDependentChannels::GetVCChannelByIndex. Return NULL if no VC index exists in source channel. | |
CVCChannel * | GetSrcVCChannelByID (ChannelID chnid, CVCFaceList *&faces, CVCPointList *&points) const |
Internally call CDependentChannels::GetVCChannelByID. Return NULL if no VC ID exists in source channel. | |
CPointNormalChannel * | GetSrcPointNormalChannel (CNormalFaceList *&faces, C3DVectorList *&points, bool createIfNeeded=false) const |
Return the point normal channel and optionally create it if it does not exists in source channel. | |
CFaceNormalChannel * | GetSrcFaceNormalChannel (C3DVectorList *&points, bool createIfNeeded=false) const |
Return the face normal channel and optionally create it if it does not exists in source channel. | |
CSpecNormalChannel * | GetSrcSpecNormalChannel (CNormalFaceList *&faces, C3DVectorList *&points) const |
Return the specified normals channels in source channel. | |
int | GetChannelSize () const |
Return the number of channels in source channels. | |
int | GetChannelNumber (Channel3DType type=ALL_CHANNELS_TYPE, bool onlyValid=true) const |
Return the number of channels of the given type in source channels (cf. CDependentChannels::GetChannelsNumber). | |
void | SetChannels (CDependentChannels *srcchannels, CDependentChannels *dstchannels=NULL, unsigned int deleteInfoGeomFlags=GEOMINFO_DELETE_NONE) |
You may provide the source channels and corresponding destination channels. For example, in the triangulation case, C3DGeomObject::Triangulate will only process these channels. | |
CDependentChannels * | GetDstChannels (bool detach=false) const |
void | GetChannelFaceList (int i, CFaceList *&srcfaces, CFaceList *&dstfaces) const |
Get the #i source and destination face list. | |
void | GetChannelPointList (int i, CPointList *&srcpts, CPointList *&dstpts) const |
Get the #i source and destination point list. | |
int CGeomInfo::GetChannelNumber | ( | Channel3DType | type = ALL_CHANNELS_TYPE , |
bool | onlyValid = true |
||
) | const |
Return the number of channels of the given type in source channels (cf. CDependentChannels::GetChannelsNumber).
CGeomInfo methods to simplify a source and destination channels access