Commit d8611d82 authored by cutealien's avatar cutealien

Add IColladaMeshWriter::findGeometryNameForNode

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4402 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 36f1a5cd
--------------------------
Changes in 1.9 (not yet released)
- Add IColladaMeshWriter::findGeometryNameForNode
- Add getters IGUIButton::isDrawBorderEnabled and IGUIButton::isDrawBackgroundEnabled
--------------------------
......
......@@ -139,7 +139,7 @@ namespace scene
//! Return the mesh for the given node. If it has no mesh or shouldn't export it's mesh
//! you can return 0 in which case only the transformation matrix of the node will be used.
// Note: Function is not const because there is no const getMesh() function.
// TODO: Function is not const because there is no const getMesh() function for several Irrlicht nodes.
virtual IMesh* getMesh(irr::scene::ISceneNode * node) = 0;
//! Return if the node has it's own material overwriting the mesh-materials
......@@ -359,6 +359,12 @@ namespace scene
/** A tool function to help when using a custom name generator to generative valid names for collada names and id's. */
virtual irr::core::stringw toNCName(const irr::core::stringw& oldString, const irr::core::stringw& prefix=irr::core::stringw(L"_NC_")) const = 0;
//! After export you can find out which name had been used for writing the geometry for this node.
/** The name comes from IColladaMeshWriterNames::nameForMesh, but you can't access the node there.
\return Either a pointer to the name or NULL */
// TODO: Function is not const because there is no const getMesh() function for several Irrlicht nodes.
virtual const irr::core::stringw* findGeometryNameForNode(ISceneNode* node) = 0;
protected:
// NOTE: You usually should also call setProperties with the same paraemter when using setDefaultProperties
......
......@@ -1189,6 +1189,20 @@ irr::core::stringw CColladaMeshWriter::toNCName(const irr::core::stringw& oldStr
return result;
}
const irr::core::stringw* CColladaMeshWriter::findGeometryNameForNode(ISceneNode* node)
{
IMesh* mesh = getProperties()->getMesh(node);
if ( !mesh )
return NULL;
MeshNode * n = Meshes.find(mesh);
if ( !n )
return NULL;
const SColladaMesh& colladaMesh = n->getValue();
return &colladaMesh.findGeometryNameForNode(node);
}
// Restrict the characters to a set of allowed characters in xs::NCName.
irr::core::stringw CColladaMeshWriter::pathToURI(const irr::io::path& path) const
{
......
......@@ -96,6 +96,9 @@ public:
// Restrict the characters of oldString a set of allowed characters in xs::NCName and add the prefix.
virtual irr::core::stringw toNCName(const irr::core::stringw& oldString, const irr::core::stringw& prefix=irr::core::stringw(L"_NC_")) const;
//! After export you can find out which name had been used for writing the geometry for this node.
virtual const irr::core::stringw* findGeometryNameForNode(ISceneNode* node);
protected:
void reset();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment