Added: #1440 Node graph printout

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent 15f52ccfac
commit 1161178d2a

@ -156,6 +156,43 @@ const ucstring &INode::userName() const
return v; return v;
} }
void INode::dumpNodes(std::ostream &ostream, const std::string &pad) const
{
ostream << "<ptr=0x";
{
std::stringstream ss;
ss << std::hex << std::setfill('0');
ss << std::setw(16) << (uint64)(void *)this;
ostream << ss.str();
}
ostream << "> " << userName().toUtf8() << " [" << m_Children.size() << "] { ";
CReferenceMaker *object = getReference(1);
if (object) // TODO: Implement!
{
ostream << "\n" << pad << "Object: ";
ostream << "<ptr=0x";
{
std::stringstream ss;
ss << std::hex << std::setfill('0');
ss << std::setw(16) << (uint64)(void *)object;
ostream << ss.str();
}
ostream << "> ";
ostream << ucstring(object->classDesc()->displayName()).toUtf8() << " ";
}
uint i = 0 ;
std::string padpad = pad + "\t";
for (std::set<NLMISC::CRefPtr<INode> >::iterator it = m_Children.begin(), end = m_Children.end(); it != end; ++it)
{
INode *node = (*it);
nlassert(node);
ostream << "\n" << pad << i << ": ";
node->dumpNodes(ostream, padpad);
++i;
}
ostream << "} ";
}
IStorageObject *INode::createChunkById(uint16 id, bool container) IStorageObject *INode::createChunkById(uint16 id, bool container)
{ {
return CReferenceTarget::createChunkById(id, container); return CReferenceTarget::createChunkById(id, container);

@ -75,6 +75,11 @@ public:
virtual void addChild(INode *node); virtual void addChild(INode *node);
virtual void removeChild(INode *node); // does not delete virtual void removeChild(INode *node); // does not delete
virtual const ucstring &userName() const; virtual const ucstring &userName() const;
// dump
void dumpNodes(std::ostream &ostream, const std::string &pad = "") const;
// read access
/// The children that are linked to this node by the parent tag /// The children that are linked to this node by the parent tag
inline const std::set<NLMISC::CRefPtr<INode> > &children() const { return m_Children; } inline const std::set<NLMISC::CRefPtr<INode> > &children() const { return m_Children; }

@ -34,8 +34,6 @@
// #include <nel/misc/debug.h> // #include <nel/misc/debug.h>
// Project includes // Project includes
#include "root_node.h"
#include "track_view_node.h"
using namespace std; using namespace std;
// using namespace NLMISC; // using namespace NLMISC;

@ -36,13 +36,13 @@
// Project includes // Project includes
#include "reference_maker.h" #include "reference_maker.h"
#include "root_node.h"
#include "track_view_node.h"
namespace PIPELINE { namespace PIPELINE {
namespace MAX { namespace MAX {
namespace BUILTIN { namespace BUILTIN {
class CRootNode;
class CTrackViewNode;
/** /**
* \brief CSceneImpl * \brief CSceneImpl
* \date 2012-08-22 08:53GMT * \date 2012-08-22 08:53GMT
@ -76,6 +76,10 @@ public:
virtual void setReference(uint index, CReferenceMaker *reference); virtual void setReference(uint index, CReferenceMaker *reference);
virtual uint nbReferences() const; virtual uint nbReferences() const;
// read access
inline CRootNode *rootNode() const { return m_RootNode; }
inline CTrackViewNode *trackViewNode() const { return m_TrackViewNode; }
protected: protected:
// inherited // inherited
virtual IStorageObject *createChunkById(uint16 id, bool container); virtual IStorageObject *createChunkById(uint16 id, bool container);

@ -30,9 +30,11 @@
// Testing // Testing
#include "../max/builtin/storage/app_data.h" #include "../max/builtin/storage/app_data.h"
#include "../max/builtin/builtin.h" #include "../max/builtin/builtin.h"
#include "../max/builtin/scene_impl.h"
#include "../max/builtin/i_node.h"
//static const char *filename = "/srv/work/database/interfaces/anims_max/cp_fy_hof_species.max"; static const char *filename = "/srv/work/database/interfaces/anims_max/cp_fy_hof_species.max";
static const char *filename = "/home/kaetemi/source/minimax/GE_Acc_MikotoBaniere.max"; //static const char *filename = "/home/kaetemi/source/minimax/GE_Acc_MikotoBaniere.max";
//static const char *filename = "/home/kaetemi/3dsMax/scenes/test2008.max"; //static const char *filename = "/home/kaetemi/3dsMax/scenes/test2008.max";
//static const char *filename = "/home/kaetemi/3dsMax/scenes/teapot_test_scene.max"; //static const char *filename = "/home/kaetemi/3dsMax/scenes/teapot_test_scene.max";
static const char *streamname = "Scene"; static const char *streamname = "Scene";
@ -174,6 +176,9 @@ int main(int argc, char **argv)
//classDirectory3.toString(std::cout); //classDirectory3.toString(std::cout);
//std::cout << "\n"; //std::cout << "\n";
std::cout << "\n";
scene.container()->scene()->rootNode()->dumpNodes(std::cout);
std::cout << "\n";
// TEST APP DATA // TEST APP DATA

Loading…
Cancel
Save