5#if !defined(AFX_3DScene_H__CA6BC29F_FAC2_11D1_A0DE_000000000000__INCLUDED_)
6#define AFX_3DScene_H__CA6BC29F_FAC2_11D1_A0DE_000000000000__INCLUDED_
19BEGIN_MOOTOOLS_NAMESPACE
68 virtual C3DObject *GetNewPolygonalObject();
69 virtual C3DCurve *GetNewCurveObject();
70 virtual C3DPatch *GetNewPatchObject();
71 virtual C3DGroup *GetNewGroupObject();
120 unsigned int flags, kindof;
141 unsigned int neededFlags;
142 unsigned int excludingFlags;
168 } materialFilteringMode;
199 operator bool() {
return (node !=
NULL); }
210 typedef enum _NodePosInternalFlags
212 NODEPOS_INTERNAL_NONE = 0x00,
213 NODEPOS_INTERNAL_STOP_TRAVERSAL = 0x01,
214 NODEPOS_INTERNAL_ALLOW_EMPTY_GEOM = 0x02,
215 NODEPOS_INTERNAL_IGNORE_INSTANCE_ONCE = 0x04,
216 } NodePosInternalFlags;
221 unsigned int internalflags;
231 unsigned int sceneVersion, materialsVersion;
241 SELECTION_DEFAULT = 0,
259 CONCATENATE_PROCESSING_FLAGS = 0xFFFF000,
276 REPLACEMATID_DEFAULT = 0,
291 using CAssociationMap::Free;
311 unsigned int kindOfObject;
312 unsigned int nodeFlags;
328#ifdef MOOTOOLS_PRIVATE_BUILD
330 virtual bool Delete();
410 void RemoveAllNodes();
452 void SetPatchLevel(
unsigned int level);
482 int GetCurrentTime()
const;
483 bool SetCurrentTime(
int newtime);
484 void DeleteAllKeys();
583 CGuidMgr& GetGuidMgr() {
return guidMgr; }
594 void ReleaseParserInfo();
598END_MOOTOOLS_NAMESPACE
C3DKeyframable class for handling keyframes.
C3DBaseObject class which is the common base class for all object types.
@ OBJECT_ALL_KINDOF
This also include private type for copy and other specific operations.
Definition 3DBaseObject.h:48
C3DFaceList class definition which is a list of C3DFace.
@ GENNORMAL_PER_VERTEX
Generate per vertex normal (CPointNormalChannel smooth normals)
Definition 3DGeomObject.h:36
The files handles materials definition.
MATERIAL_CLASS
Definition 3DMaterial.h:53
@ MATERIAL_CLASS_STANDARD
The material is a C3DStandardMaterial.
Definition 3DMaterial.h:55
SceneSelectionFlags
Definition 3DScene.h:240
@ SELECTION_SELECT_INSTANCES
Select also the instances of the provided node.
Definition 3DScene.h:243
@ SELECTION_SELECT_CHILDS
Select the child of the provided node.
Definition 3DScene.h:244
@ SELECTION_KEEP_SELECTION
Add the new selection to the existing one.
Definition 3DScene.h:242
ReplaceMatIDFlags
Definition 3DScene.h:275
@ REPLACEMATID_DELETE_SRC_MATERIAL
Delete the src material (matid). To be used only if pParentNode = NULL, otherwise some other might re...
Definition 3DScene.h:278
@ REPLACEMATID_COPY_MATERIAL
the target material (newmatid) is replaced by the src material (if newmatid exits,...
Definition 3DScene.h:277
@ REPLACEMATID_INCLUDE_PARENT
pParentNode is included in the change
Definition 3DScene.h:279
NodeFilterFlags
Definition 3DScene.h:103
@ NODEFILTER_SELECTED
Return only selected nodes.
Definition 3DScene.h:107
@ NODEFILTER_DEFAULT
Do default traversal, filter nothing.
Definition 3DScene.h:104
@ NODEFILTER_VALID
Return only valid nodes.
Definition 3DScene.h:105
@ NODEFILTER_SHOW
Return only displayed nodes.
Definition 3DScene.h:106
CreateBackFaceFlags
Definition 3DScene.h:266
@ BACKFACE_FBGEOM
Create back face only if geom have back face materials. In this case the whole geom is backfaced.
Definition 3DScene.h:268
@ BACKFACE_DEFAULT
Create back face for all geom and the whole geom.
Definition 3DScene.h:267
@ BACKFACE_FBFACE_ONLY
Create back face only for face that have back face materials. In this case only the fb faces are back...
Definition 3DScene.h:269
NodePosFlags
Definition 3DScene.h:92
@ NODEPOS_INSTANCE_ONCE
When traversing the tree, settings this flag returns only once time each object instance....
Definition 3DScene.h:94
@ NODEPOS_DEFAULT
Do default traversal, which means it starts traversal from the first child of the provided node....
Definition 3DScene.h:93
@ NODEPOS_INCLUDE_NODE
Include the node itself in the traversal. Node childs and right brothers will also be traversed.
Definition 3DScene.h:95
@ NODEPOS_BRANCH_ONLY
Traverse provided node childs. If NODEPOS_INCLUDE_NODE specified, traverse also right branch (brother...
Definition 3DScene.h:96
@ NODEPOS_ALLOW_EMPTY_NODES
During serialization some node might be provided with geometry. This allows to get access to such nod...
Definition 3DScene.h:97
ConcatenateFlags
Definition 3DScene.h:250
@ CONCATENATE_DEFAULT
The scene is not modified, and a node is returned which can be added as you need in the scene graph.
Definition 3DScene.h:251
@ CONCATENATE_SORT_BY_MATERIAL
The result node has its faces sorted by material.
Definition 3DScene.h:260
@ CONCATENATE_REMOVE_TO_ROOT
Parent and childs are deleted (or not depending on the optionnal C3DFilter::ProcessNode returned valu...
Definition 3DScene.h:255
@ CONCATENATE_REMOVE_AND_ADD_TO_PARENT
Parent childs are deleted (or not depending on the optionnal C3DFilter::ProcessNode returned value) a...
Definition 3DScene.h:256
@ CONCATENATE_INCLUDE_PARENT
parentNode is included in concatenation (could be useful if parent is a geom object)
Definition 3DScene.h:252
@ CONCATENATE_REPLACE_PARENT
Parent and its childs is replaced by concatenated node (whatever C3DFilter::ProcessNode returned valu...
Definition 3DScene.h:257
SCENE_DATA
Definition 3DScene.h:30
@ SCENE_DATA_SMOOTH_ANGLE
float ((C3DPreferences::Get3DPreferences()::GetSmoothAngle()). Smooth angle in radian
Definition 3DScene.h:35
@ SCENE_DATA_TEXTURE_PATHS
string array: additional texture paths. Can be retrieve using C3DScene::GetTexturePaths
Definition 3DScene.h:37
@ SCENE_DATA_FILENAME
CXString: the scene file path.
Definition 3DScene.h:31
@ SCENE_DATA_TEMPORARY_TEXTURES
Bool (false): texture files are temporaries and can be deleted when scene deleted (ie,...
Definition 3DScene.h:33
@ SCENE_DATA_PATCH_LEVEL
unsigned int (C3DPreferences::Get3DPreferences()::GetPatchLevel())
Definition 3DScene.h:34
@ SCENE_DATA_FILECLASS
Unsigned int: the scene file class (Ie. FBX_3D_FILE, WAVEFRONT_3D_FILE...)
Definition 3DScene.h:32
@ SCENE_DATA_GEOLOCATION
Binary (C3DScene::GeoLocation): longitude and latitude position of the scene.
Definition 3DScene.h:38
@ SCENE_DATA_TARGET_MR_BBOX
Binary - 6 floats - Target bounding box for multiresolution file.
Definition 3DScene.h:39
@ SCENE_DATA_SMOOTH_MODE
unsigned int ((C3DPreferences::Get3DPreferences()::GetSmoothMode())
Definition 3DScene.h:36
C3DSceneNode class definition.
UP_AXIS_MODE
Definition 3DType.h:360
NormalSmoothMode
Definition 3DType.h:401
@ NORMAL_GLOBAL_MODE
The object used the preferences smoothing mode.
Definition 3DType.h:402
@ 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
C3DAnimatable is the base class for any object which inherits an animation.
Definition 3DAnimatable.h:25
This is the base class for any kind of object.
Definition 3DBaseObject.h:106
C3DCamera handles camera object.
Definition 3DCamera.h:61
FBMaterialID GetFBMaterialID() const
Get the material that was set. If SetMaterial call, the return material as only frontID defined.
virtual void OnConcatenate(C3DSceneNode *dstnode, const C3DSceneNode *srcnode)
The dstnode send previously in OnConcatenateBegin is finished to be processed. If validNode == true,...
Definition 3DScene.h:183
virtual bool ProcessFace(const C3DBaseObject *object, const C3DFace *face) const
Must be called by overriden methods to handle material filtering if needed.
virtual C3DSceneNode * OnConcatenateBegin()
A new concatenated node need to be created with its object. We will try to add something to it,...
virtual void OnConcatenate(C3DFaceList *dstfaces, unsigned int dstindex, const C3DFaceList *srcfacelist, unsigned int srcindex)
This is calledwhen something from srcobject goes into dstobject. dstobject is a geom object,...
Definition 3DScene.h:185
virtual bool ProcessNode(const C3DSceneNode *node) const
Must be called by overriden methods to handle material filtering if needed.
virtual void OnConcatenate(C3DGeomObject *dstobject, const C3DBaseObject *srcobject)
This is called when something from srcnode object goes into dstnode object. This give a chance to mer...
Definition 3DScene.h:184
void SetFBMaterial(FBMaterialID matid, bool musHave)
Used to perform material filtering (used by ConcatenateByMaterial)
bool PerformMaterialFiltering() const
Return true if material filtering is performed.
void SetMaterial(MaterialID matid, bool musHave)
Used to perform material filtering (used by ConcatenateByMaterial)
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
A 3D face is a list of indexes of C3DPointList object point list.
Definition 3DFace.h:43
C3DFaceList class which implement a list of C3DFace. Each face contains indexes to 3D points stored i...
Definition 3DFaceList.h:249
C3DFilter allows to filter the nodes / faces / points being processed.
Definition 3DScene.h:118
void SetCallbackData(void *data)
specific that can be used in the callback operation
virtual bool ProcessFace(const C3DBaseObject *object, const C3DFace *face) const
Return true if the face should be processed, false otherwise.
virtual bool ProcessPoint(const C3DBaseObject *object, const C3DPoint *point) const
Return true if the point should be processed, false otherwise.
static bool ProcessNode(unsigned int filterFlags, const C3DSceneNode *node, unsigned int kindOfObject=OBJECT_ALL_KINDOF)
Flags is one or more NodeFilterFlags. Call this static method allows a simple filter on the nodes.
virtual bool ProcessNode(const C3DSceneNode *node) const
Return true if the node should be processed, false otherwise.
void * GetCallbackData()
specific that can be used in the callback operation
Definition 3DScene.h:127
C3DFilter(unsigned int flags=NODEFILTER_DEFAULT, unsigned int kindOfObject=OBJECT_ALL_KINDOF)
By default all the nodes are transmitted to ProcessNode.
void ExcludindFlags(unsigned int flags)
Defines flags that the node must not have.
C3DFlagFilter(unsigned int kindOfObject=OBJECT_ALL_KINDOF)
By default all the nodes are transmitted to ProcessNode.
void NeededFlags(unsigned int flags)
Defines flags required for the node to be processed.
virtual bool ProcessNode(const C3DSceneNode *node) const
Return true if the node should be processed, false if not.
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
C3DSceneNode ** GetInstancesByID(C3DSceneNode *node, int &size) const
Return instances of the node. If the node has no instance, it return the a pointer to the node itself...
This is the base class for any keyframe that is part of C3DKeyframable class.
Definition 3DKeyframe.h:49
This class implements a light object in the scene (OBJECT_LIGHT)
Definition 3DLight.h:50
C3DMaterial is the base class for materials. There is currently two kinds of materials: C3DPbrMateria...
Definition 3DMaterial.h:69
void SetFilter(const C3DFilter *filter)
Place a filter to exclude node from being processed. To be set after C3DScene::GetFirstNode();.
bool CheckObjectID(BaseObjectID id) const
return true if specified object id has been seen (works in conjunction with AddObjectID)
void AddObjectID(BaseObjectID id)
Add an ObjectID in the processed list. No other nodes with this object ID will be returned by GetNext...
This class can be provided in C3DScene::Copy operations and allows to modify the created kind of clas...
Definition 3DScene.h:47
C3DScene * GetScene() const
Set the scene to which the copied object will belong to. The element GUID is updated.
void SetScene(C3DScene *scene)
Set the scene to which the copied object will belong to. The element GUID is updated.
virtual C3DBaseObject * GetNewObjectFrom(const C3DBaseObject *refobject, bool &emptyCopy)
Return an object from the provided refobject. Returned object might be empty (empty points/faces/chan...
CCustomData & GetCustomData()
Can be used to store some information.
C3DObjectCreator(C3DScene *scene=NULL)
Destination scene to which the element is copied.
virtual C3DBaseObject * ConvertToType(const C3DSceneNode *refnode, const C3DBaseObject *refobject)
Convert refobject to another type. return the object itself if no conversion performed.
virtual bool CanProcess(const C3DSceneNode *node, const C3DBaseObject *object)
Return true if the node and its object should be copied / converted.
C3DObject handles polygonal mesh.
Definition 3DObject.h:24
C3DPatch handles handles patch object smoothed using a subdivision algorithm.
Definition 3DPatch.h:34
Definition 3DPointList.h:267
The class allows to get access to the scene graph, node hierarchy, material.
Definition 3DScene.h:306
bool MakeGroupForChilds(C3DSceneNode *pParentNode=NULL)
If an object has a child, make this child being attached to a C3DGroup instead. This guarantee that a...
bool AddTexturePath(const CXString &path)
Add a specific texture path for the scene. The path is not added to preferences. Return true if the p...
bool GenerateNormals(C3DSceneNode *node=NULL, unsigned int mode=GENNORMAL_PER_VERTEX, NormalSmoothMode smooth=NORMAL_GLOBAL_MODE)
Generate normal in multithread process. Mode is one or a combination of GENNORMAL_MODE (if GENNORMAL_...
unsigned int GetInstancesByID(C3DSceneNode *pParentNode, C3DSceneNode *refnode, C3DNodeArray &nodes, bool resetArray) const
Retrieve nodes that contains instance of object contained by refnode. Internally, the method looks if...
int ConvertToGlobalCoordinates(C3DSceneNode *pParentNode=NULL, bool includeNodeItself=false)
Convert a node and its child to global coordinates. Return the number of node changed.
void DetachAndAddNode(C3DSceneNode *parentNode, C3DSceneNode *node, bool lastNode=false)
Same has AddNode, but remove the node from a previous scene if needed.
int DeleteInstanciation(C3DSceneNode *pParentNode=NULL)
Remove instanciation for the pParentNode and its childrend and replace it by a real copy....
unsigned int GetInstancesCount(C3DSceneNode *pParentNode, BaseObjectID id) const
return the number of instance found in pParentNode branch.
bool MergeMatrixKeyframes(C3DSceneNode *fromNode, C3DSceneNode *toNode)
Multiply toNode's Matrix Keyframes by fromNode's ones.
MaterialID GetMaterialID(const CXString &name)
Same has GetMaterialByID except it returns a MaterialID.
C3DSceneNode * GetNextNode(C3DBaseObject *&object, C3DNodePos &pos) const
Return the node and it's object.
unsigned int GetInstancesByID(C3DSceneNode *pParentNode, BaseObjectID id, C3DNodeArray &nodes, bool resetArray) const
Get nodes which object are instance of id. It adds the node itself if node is not instanciated....
C3DBaseObject * GetObjectByID(BaseObjectID id) const
Look for object id through the whole scene. The first node with this ID is returned....
C3DBaseObject * CreateObjectInstance(const C3DBaseObject *refObject) const
Create an instance of the given object. The returned instanciated node must be attached to a node the...
C3DSceneNode * GetNodeByID(SceneNodeID id, bool is32BitsID=false) const
If is32BitsID, the method lookl for 32 bits ID get with GetNodeID32() method.
unsigned int GetSelectedNodeNumber(C3DSceneNode *pParentNode=NULL, unsigned int kindof=OBJECT_ALL_KINDOF) const
Get selected node count for the whole scene (pParentNode == NULL) or for the pParentNode childs (incl...
void SetUnit(UNIT_MODE unit)
Set the scene unit.
C3DScene * InitExport(CSceneExportOptions &options)
this method is called before the scene is save using C3DIo::Save. It returns a scene copy (unless SCE...
HashPos GetFirstMaterial() const
if matclass = MATERIAL_CLASS_UNDEFINED, return all type of materials, otherwise return materials of t...
static C3DScene * Create()
Allocates and creates an empty scene. Use C3DScene::Delete to delete the scene. Same as xNew(C3DScene...
CTree * GetTree()
CTree base class has protected access, so use this with precaution.
Definition 3DScene.h:582
double ConvertToUnit(double x) const
Get a value in the current length / scale unit. (x * scale factor) / GetUnitFactor())
C3DSceneNode * CreateInstance(const C3DSceneNode *node)
Instanciate the the object node and object subnode. Returned node, contains a node (with possibily su...
C3DMaterial * CreateNewMaterial(MATERIAL_CLASS materialClass)
Create material with automatic ID assignment.
C3DSceneNode * GetNextNode(C3DGeomObject *&object, C3DNodePos &pos) const
GetFirstNode must define OBJECT_GEOM when using this version.
int GetBoundingBox(C3DBBox &bbox, C3DSceneNode *pParentNode=NULL, unsigned int kindof=OBJECT_ALL_KINDOF, unsigned int nodeFlag=SCENE_NODE_NONE, bool mustBeSet=true) const
Return the number of node found that satisfies the condition.
bool ReplaceNode(C3DSceneNode *newNode, C3DSceneNode *oldNode, bool deleteOldNode)
Replace oldNode by newNode. newNode is attached to oldNode childs, and become a child of oldNode pare...
C3DMaterial * GetNextMaterial(HashPos &pos) const
if defined matclass should be the same than the one use in GetFirstMaterial
int GetLinkedFiles(CXStringArray &files, bool pathRelativeToScenePath=true, bool textureOnly=false) const
This returns a list of file that are in relation with the scene (texture files...)....
C3DSceneNode * GetCommonParent(const C3DNodeArray &nodes) const
Return the upper common parent in the hierarchy to the provided nodes.
CCustomData & GetCustomData()
Get access to custom data which allows to set or retrieve specific information. cf....
C3DSceneNode * Concatenate(C3DSceneNode *pParentNode=NULL, unsigned int concatenateFlags=CONCATENATE_REMOVE_TO_ROOT|CONCATENATE_SORT_BY_MATERIAL, C3DConcatenateFilter *filter=NULL, C3DNodeArray *processedMeshes=NULL)
C3DSceneNode * GetRoot() const
Return the root node in the scene.
static double GetUnitFactor(UNIT_MODE unit)
Return the value needed to convert centimer to the given unit. Ie. if unit = UNIT_M,...
int GetMaterials(C3DSceneNode *pParentNode, CMaterialHashMap &materials, bool resetHash) const
Collect the materials referenced by pParentNode and childs. CMaterialHashMap is a map that associate ...
bool RemoveNode(C3DSceneNode *node, C3DNodePos &pos, bool deleteIt=true)
Remove or delete the node (and its childs) from the scene graph. This version is to use when traversi...
unsigned int GetMaterials(C3DMaterialArray &mats, bool resetArray=true, MATERIAL_CLASS matclass=MATERIAL_CLASS_UNDEFINED) const
Fill the material array and return the number of scene's material of the given class (or all class if...
CXString GetUnitText(bool abreviation) const
Return a text that describe the unit of the scene (ie. "centimers" or "cm" if abbreviation is true)
double GetScaleFactor() const
Return scene scale. Multiply the coordinates by this scale to get an information expressed in centime...
int GetNodesByFlags(C3DSceneNode *pParentNode, unsigned int nodeflags, bool nodeflagset, unsigned int objectflags, bool objectflagset, C3DNodeArray &nodes, bool singleInstance, bool resetArray, unsigned int objectKindof=OBJECT_ALL_KINDOF) const
Return the nodes that matches the required flags. When singleInstance = true, this return the first n...
void CopyChilds(C3DScene *pDstScene, C3DSceneNode *pDestParentNode, C3DSceneNode *pParentNode=NULL, int flags=SCENE_COPY_DEFAULT, C3DObjectCreator *objectCreator=NULL) const
Copy only node's childs.
void SortNodesByDepth(C3DNodeArray &array, bool highToSmallDepth=true) const
Sort a node array by its depth in the hierarchy from highest to smallest depth or the inverse if high...
double ConvertFromUnit(double x) const
Get a value from the current length / scale unit. (x * GetUnitFactor()) / scale_factor)
void AdjustPaths(const CXString &targetPath, bool relativePathAllowed)
This adjusts paths of files in relation with the scene in order to make them relative to the scene pa...
C3DSceneNode * GetNodeByName(C3DSceneNode *pParent, const CXString &name) const
Beware node names are not supposed to be single. The first node encountered with the given name is re...
void SetScaleFactor(double scale)
Define the scale factor, which is the coordinate multiplied by this factor to get values in centimers...
C3DSceneNode * CopySingleNode(C3DScene *pDstScene, C3DSceneNode *pDestParentNode, C3DSceneNode *pSrcNode, int flags=SCENE_COPY_DEFAULT, C3DObjectCreator *objectCreator=NULL) const
Copy only the node.
unsigned int SetNodeObject(C3DSceneNode *node, C3DBaseObject *newobject, bool allObjectInstance, bool deletePreviousObject=true)
Replace node object with newobject and detach it from the scene. Replaces all object instance is need...
MaterialID AddNewMaterial(C3DMaterial *material)
Add a material that has been created from scratch and which is not attached to any material list....
float GetSmoothAngle() const
Return smooth angle in radian.
int GetChilds(C3DSceneNode *pParentNode, C3DNodeArray &array, bool singleInstance=false, bool includeParentNode=false) const
Get childs of a node and potentially the node itself. If singleInstance = true, only one instance of ...
unsigned int GetNodeIDMap(C3DSceneNodeIDMap &nodes, bool create32BitsIDMap) const
void AddNode(C3DSceneNode *parentNode, C3DSceneNode *node, bool lastNode=false)
Add a node to the scene which parent is parentNode. node is attached to the scene,...
unsigned int GetSelectedNodes(C3DSceneNode *pParentNode, C3DNodeArray &nodes, unsigned int kindof=OBJECT_ALL_KINDOF) const
Get selected nodes for the whole scene (pParentNode == NULL) or for the pParentNode childs (including...
bool RemoveMaterial(MaterialID matid, bool deleteIt=true)
Remove the material from the scene. This does not modify object material association,...
int GetDirectChildCount(C3DSceneNode *pParentNode=NULL, unsigned int kindof=OBJECT_ALL_KINDOF) const
Return the number of child below the given node (direct childs)
C3DMaterial * GetMaterialByID(MaterialID id, bool createIfMissing=false, MATERIAL_CLASS materialClass=MATERIAL_CLASS_STANDARD)
Find a material given its id. Return NULL if does not exists, or create it if createIfMissing = true.
unsigned int RemoveNodes(C3DNodeArray &nodes, bool deleteThem=true, bool cleanTree=true)
Remove or delete the nodes (and their childs) from the scene graph. if cleanTree = true,...
int GetChildCount(C3DSceneNode *pParentNode=NULL, unsigned int kindof=OBJECT_ALL_KINDOF, unsigned int nodeFlag=SCENE_NODE_NONE, bool mustBeSet=true) const
Return the number of child below the given node (all branch) of the given type and with the given fla...
int ConvertToType(C3DSceneNode *parentNode, C3DObjectCreator *objectCreator)
perform object type conversion. Return number of object that has been modified.
unsigned int GetNodesByFilter(C3DSceneNode *pParentNode, C3DNodeArray &nodes, const C3DFilter *filter=NULL) const
Get nodes filtered by filter (or not) for the whole scene (pParentNode == NULL) or for the pParentNod...
bool ReplaceNodeMaterialID(C3DSceneNode *pParentNode, MaterialID srcmatid, MaterialID newmatid, unsigned int replaceNodeMaterialIDFlags=REPLACEMATID_DEFAULT)
Replace all occurences of srcmatid in the pParentNode childs with newmatid. replaceNodeMaterialIDFlag...
void CompensateTransform(C3DSceneNode *node, const C4x4Matrix &transform)
Transform the points with the given matrix but apply the equivalent transform to the node,...
void Sort(C3DSceneNode *pParentNode=NULL, bool sortDirectChildOnly=false, unsigned int kindof=OBJECT_ALL_KINDOF, unsigned int nodeFlag=SCENE_NODE_NONE, bool mustBeSet=true, XQSORT_PROTO compareMethod=NULL, void *userData=NULL)
Sort scene using compareMethod. If compareMethod = NULL a sort by name is done, otherwise the compare...
unsigned int RemoveNodeByObjectID(C3DSceneNode *pParentNode, BaseObjectID objectID, bool deleteObject=true)
Remove all node that reference objectID. if deleteObject = false, the last object reference is kept.
C3DSceneNode * RemoveNode(C3DSceneNode *node, bool deleteIt=true)
Remove or delete a node from the scene graph. Childs are also removed, if any. Return the previous va...
unsigned int GetInstancesMap(C3DInstanceMap &instances) const
Init an instance map when multiple call to GetInstancesByID is required. Return the number of instanc...
unsigned int CleanGroups(C3DSceneNode *pParent=NULL, bool onlyEmptyGroup=true, bool includeNodeItself=false)
Return the number of group removed.
unsigned int GetMaterialsByText(const CXString &filter, bool matchCase, C3DMaterialIDArray &matids, bool resetHash)
Advanced search: find all materials which name match the given text.
C3DMaterial * GetMaterialByID2(MaterialID id, MATERIAL_CLASS materialClass) const
Find a material given its id. if materialClass is specified, the material is returned only if it has ...
C3DMaterial * GetMaterialByName(const CXString &name) const
Beware material names are not supposed to be single. The first material encountered with a given name...
unsigned int CreateBackfaceNodes(C3DSceneNode *pParentNode=NULL, unsigned int createBackFaceFlags=BACKFACE_DEFAULT, C3DFilter *pFilter=NULL)
bool SwapCoordinates(int swapmode)
return true if something changed
C3DSceneNode * GetNextNode(C3DNodePos &pos) const
Return only the node (don't care about the object which can be obtained using C3DSceneNode::GetBaseOb...
bool ChangeNodeParent(C3DSceneNode *newParent, C3DSceneNode *node, bool updateMatrix=true)
Attach node with its child to newParent. Matrix are update accordingly.
bool AddScene(const C3DScene *scene, int sceneCopyflags=SCENE_COPY_DEFAULT, C3DObjectCreator *objectCreator=NULL)
Copy scene to the current scene using sceneCopyflags.
int GetFBMaterials(C3DSceneNode *pParentNode, CFBMaterialHashMap &fbmatids, bool resetHash) const
Collect front and back face material pairs referenced by pParentNode and childs. CFBMaterialHashMap i...
C3DSceneNode * CopyNode(C3DScene *pDstScene, C3DSceneNode *pDestParentNode, C3DSceneNode *pSrcNode, int flags=SCENE_COPY_DEFAULT, C3DObjectCreator *objectCreator=NULL) const
Copy the node and its childs.
bool Merge(C3DScene *sceneToMerge, C3DSceneNode *parentNode=NULL)
Merge sceneToMerge to parentNode or the root of the current scene. All sceneToMerge nodes are moved t...
unsigned int SetNodeObject(BaseObjectID objectID, C3DBaseObject *newobject, bool deletePreviousObject=true)
Replace all objectID instances with the new object. If object is not deleted, it is detached from the...
C3DMaterial * CreateNewMaterial(MaterialID &matID, MATERIAL_CLASS materialClass)
Create material providing an ID (which might be modified if it already exists)
int GetTexturePaths(CXStringArray &paths, bool removeAll=true) const
Get scene texture path, and return the paths size (including any previous one, if removeAll = false)
unsigned int GetNodesByText(C3DSceneNode *pParent, const CXString &filter, bool matchCase, C3DNodeArray &nodes, bool resetArray=true)
Advanced search: find all nodes which name match the given regular expression.
bool OrientScene(UP_AXIS_MODE mode, bool import)
return true if something changed
C3DScene * Copy(C3DSceneNode *pSrcNode=NULL, int sceneCopyflags=SCENE_COPY_DEFAULT, C3DObjectCreator *objectCreator=NULL) const
Return a copy of the scene, or NULL if the scene does not contains any node (unless SCENE_COPY_EMPTY_...
bool GetTexturePath(int index, CXString &path) const
Get ith scene texture path, starting with index 0. Returns false if there is no path for the index,...
void CheckoutImport(CSceneImportOptions &options)
This method is called after scene is imported using C3DIo::Read. It prepares the scene following the ...
bool DeleteNodes(C3DSceneNode *node=NULL, const C3DFilter *filter=NULL, bool includeNode=false)
Delete the node descendance that match the C3DFilter criteria. if includeNode = true,...
bool IsUnitDefined() const
Return false if unit has not been defined when reading file. This means that we are not able to conve...
int Select(C3DSceneNode *node, unsigned int sceneSelectionFlags)
SelectionFlags is a combination of SceneSelectionFlags. Return the number of newly selected objects.
bool IsNodeSelected(unsigned int kindof=OBJECT_ALL_KINDOF) const
Return true if one node is selected.
void CreatePersistentGuids()
Give each node a persitent GUID based on mix of name, node properties and hierarchy position....
int GetNodeDepth(C3DSceneNode *pNode=NULL) const
Return the node depth.A direct child of the root as the depth 0.
UNIT_MODE GetUnit() const
By default UNIT_UNDEFINED is set unless the format specify it. C3DVector(1, 0, 0) has a length of 1 c...
virtual ~C3DScene()
Use Delete instead, unless the C3DScene is created on the stack (take care that it is referenced once...
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
This class handles an association between a key and its associated values.
Definition AssociationMap.h:240
void Convert(CAssociationCollector< MAPTYPE, ASSOCTYPE, SIZETYPE > &collector)
Init the association map from a CAssociationCollector.
Definition AssociationMap.h:544
unsigned int GetSize() const
return the number of key values in the association map
Definition AssociationMap.h:505
CCustomData is a handly class for storing any kind of data.
Definition CustomData.h:106
This class gets an object material hash. It returns front and back material pair. @Note if we have a ...
Definition 3DFaceList.h:108
A given extension may match several formats. In case of conflict CFileNameSpec is a way to indicate t...
Definition FileInfo.h:156
Definition InstanciatedObject.h:16
CMaterials stores scene materials. CMaterials::CreateNewMaterial allows to create a material and inse...
Definition 3DMaterial.h:387
This class is used to provide some specific options when exporting a 3D scene.
Definition Io3dmgr.h:157
This class is used to provide some specific options when loading scene file.
Definition Io3dmgr.h:133
Definition 3DKeyframe.h:22
CXStringArray implement an array of CXString.
Definition XStringArray.h:25
This class handles two MaterialID that simplifies operation on faces which have front and back materi...
Definition 3DFaceList.h:28
double altitude
altitude in m
Definition 3DScene.h:319
double northCorrection
Rotation around Z axis to align Y axis to the north, in radian.
Definition 3DScene.h:320