Added: #1440 Same filter for toStringLocal

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent 6af13cafd4
commit 3f6de020c0

@ -123,7 +123,7 @@ const ISceneClassDesc *CAnimatable::classDesc() const
return &AnimatableClassDesc; return &AnimatableClassDesc;
} }
void CAnimatable::toStringLocal(std::ostream &ostream, const std::string &pad) const void CAnimatable::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
CSceneClass::toStringLocal(ostream, pad); CSceneClass::toStringLocal(ostream, pad);
if (m_AppData && m_AppData->entries().size() != 0) if (m_AppData && m_AppData->entries().size() != 0)

@ -74,7 +74,7 @@ public:
virtual void init(); virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const; virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// public // public
STORAGE::CAppData *appData(); STORAGE::CAppData *appData();

@ -96,7 +96,7 @@ const ISceneClassDesc *CBaseObject::classDesc() const
return &BaseObjectClassDesc; return &BaseObjectClassDesc;
} }
void CBaseObject::toStringLocal(std::ostream &ostream, const std::string &pad) const void CBaseObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
CReferenceTarget::toStringLocal(ostream, pad); CReferenceTarget::toStringLocal(ostream, pad);
} }

@ -67,7 +67,7 @@ public:
virtual void init(); virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const; virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected: protected:
// inherited // inherited

@ -94,7 +94,7 @@ const ISceneClassDesc *CEditablePatch::classDesc() const
return &EditablePatchClassDesc; return &EditablePatchClassDesc;
} }
void CEditablePatch::toStringLocal(std::ostream &ostream, const std::string &pad) const void CEditablePatch::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
CPatchObject::toStringLocal(ostream, pad); CPatchObject::toStringLocal(ostream, pad);
} }

@ -66,7 +66,7 @@ public:
virtual void init(); virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const; virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected: protected:
// inherited // inherited

@ -43,16 +43,21 @@ namespace PIPELINE {
namespace MAX { namespace MAX {
namespace BUILTIN { namespace BUILTIN {
#define PMB_GEOM_UNKNOWN0900_CHUNK_ID 0x0900
#define PMB_GEOM_BUFFERS_CHUNK_ID 0x08fe #define PMB_GEOM_BUFFERS_CHUNK_ID 0x08fe
CGeomObject::CGeomObject(CScene *scene) : CObject(scene) CGeomObject::CGeomObject(CScene *scene) : CObject(scene), m_Unknown0900(NULL), m_GeomBuffers(NULL)
{ {
} }
CGeomObject::~CGeomObject() CGeomObject::~CGeomObject()
{ {
if (!m_ChunksOwnsPointers)
{
m_Unknown0900 = NULL;
m_GeomBuffers = NULL;
}
} }
const ucstring CGeomObject::DisplayName = ucstring("GeomObject"); const ucstring CGeomObject::DisplayName = ucstring("GeomObject");
@ -65,7 +70,18 @@ const CGeomObjectSuperClassDesc GeomObjectSuperClassDesc(&GeomObjectClassDesc);
void CGeomObject::parse(uint16 version, uint filter) void CGeomObject::parse(uint16 version, uint filter)
{ {
if (filter == 0)
{
CObject::parse(version); CObject::parse(version);
}
else if (filter == PMB_GEOM_OBJECT_PARSE_FILTER)
{
if (!m_ChunksOwnsPointers)
{
m_Unknown0900 = getChunk(PMB_GEOM_UNKNOWN0900_CHUNK_ID);
m_GeomBuffers = static_cast<STORAGE::CGeomBuffers *>(getChunk(PMB_GEOM_BUFFERS_CHUNK_ID));
}
}
} }
void CGeomObject::clean() void CGeomObject::clean()
@ -75,11 +91,21 @@ void CGeomObject::clean()
void CGeomObject::build(uint16 version, uint filter) void CGeomObject::build(uint16 version, uint filter)
{ {
if (filter == 0)
{
CObject::build(version); CObject::build(version);
}
else if (filter == PMB_GEOM_OBJECT_PARSE_FILTER)
{
if (m_Unknown0900) putChunk(PMB_GEOM_UNKNOWN0900_CHUNK_ID, m_Unknown0900);
if (m_GeomBuffers) putChunk(PMB_GEOM_UNKNOWN0900_CHUNK_ID, m_GeomBuffers);
}
} }
void CGeomObject::disown() void CGeomObject::disown()
{ {
m_Unknown0900 = NULL;
m_GeomBuffers = NULL;
CObject::disown(); CObject::disown();
} }
@ -99,7 +125,7 @@ const ISceneClassDesc *CGeomObject::classDesc() const
return &GeomObjectClassDesc; return &GeomObjectClassDesc;
} }
void CGeomObject::toStringLocal(std::ostream &ostream, const std::string &pad) const void CGeomObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
CObject::toStringLocal(ostream, pad); CObject::toStringLocal(ostream, pad);
} }
@ -108,6 +134,8 @@ IStorageObject *CGeomObject::createChunkById(uint16 id, bool container)
{ {
switch (id) switch (id)
{ {
case PMB_GEOM_UNKNOWN0900_CHUNK_ID:
return new CStorageArray<sint32>();
case PMB_GEOM_BUFFERS_CHUNK_ID: case PMB_GEOM_BUFFERS_CHUNK_ID:
return new STORAGE::CGeomBuffers(); return new STORAGE::CGeomBuffers();
} }

@ -36,9 +36,16 @@
// Project includes // Project includes
#include "object.h" #include "object.h"
/// Must be passed to the parse and build functions by
/// inheriting classes to parse the actual geom object.
#define PMB_GEOM_OBJECT_PARSE_FILTER 0x432a4da6
namespace PIPELINE { namespace PIPELINE {
namespace MAX { namespace MAX {
namespace BUILTIN { namespace BUILTIN {
namespace STORAGE {
class CGeomBuffers;
}
/** /**
* \brief CGeomGeomObject * \brief CGeomGeomObject
@ -67,12 +74,19 @@ public:
virtual void init(); virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const; virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// read access
inline STORAGE::CGeomBuffers *geomBuffers() const { return m_GeomBuffers; }
protected: protected:
// inherited // inherited
virtual IStorageObject *createChunkById(uint16 id, bool container); virtual IStorageObject *createChunkById(uint16 id, bool container);
private:
IStorageObject *m_Unknown0900;
STORAGE::CGeomBuffers *m_GeomBuffers;
}; /* class CGeomObject */ }; /* class CGeomObject */
typedef CSceneClassDesc<CGeomObject> CGeomObjectClassDesc; typedef CSceneClassDesc<CGeomObject> CGeomObjectClassDesc;

@ -97,7 +97,7 @@ const ISceneClassDesc *INode::classDesc() const
return &NodeClassDesc; return &NodeClassDesc;
} }
void INode::toStringLocal(std::ostream &ostream, const std::string &pad) const void INode::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
CReferenceTarget::toStringLocal(ostream, pad); CReferenceTarget::toStringLocal(ostream, pad);
// Print the implied connected children // Print the implied connected children

@ -67,7 +67,7 @@ public:
virtual void init(); virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const; virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// node interface // node interface
virtual INode *parent(); virtual INode *parent();

@ -129,7 +129,7 @@ const ISceneClassDesc *CNodeImpl::classDesc() const
return &NodeImplClassDesc; return &NodeImplClassDesc;
} }
void CNodeImpl::toStringLocal(std::ostream &ostream, const std::string &pad) const void CNodeImpl::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
INode::toStringLocal(ostream, pad); INode::toStringLocal(ostream, pad);
ostream << "\n" << pad << "NodeVersion: " << m_NodeVersion; ostream << "\n" << pad << "NodeVersion: " << m_NodeVersion;

@ -66,7 +66,7 @@ public:
virtual void init(); virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const; virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// node interface // node interface
virtual INode *parent(); virtual INode *parent();

@ -96,7 +96,7 @@ const ISceneClassDesc *CObject::classDesc() const
return &ObjectClassDesc; return &ObjectClassDesc;
} }
void CObject::toStringLocal(std::ostream &ostream, const std::string &pad) const void CObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
CBaseObject::toStringLocal(ostream, pad); CBaseObject::toStringLocal(ostream, pad);
} }

@ -67,7 +67,7 @@ public:
virtual void init(); virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const; virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected: protected:
// inherited // inherited

@ -94,7 +94,7 @@ const ISceneClassDesc *CPatchObject::classDesc() const
return &PatchObjectClassDesc; return &PatchObjectClassDesc;
} }
void CPatchObject::toStringLocal(std::ostream &ostream, const std::string &pad) const void CPatchObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
CGeomObject::toStringLocal(ostream, pad); CGeomObject::toStringLocal(ostream, pad);
} }

@ -36,6 +36,10 @@
// Project includes // Project includes
#include "geom_object.h" #include "geom_object.h"
/// Must be passed to the parse and build functions by
/// inheriting classes to parse the actual patch object.
#define PMB_PATCH_OBJECT_PARSE_FILTER 0x2a611c9
namespace PIPELINE { namespace PIPELINE {
namespace MAX { namespace MAX {
namespace BUILTIN { namespace BUILTIN {
@ -66,7 +70,7 @@ public:
virtual void init(); virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const; virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected: protected:
// inherited // inherited

@ -94,7 +94,7 @@ const ISceneClassDesc *CPolyObject::classDesc() const
return &PolyObjectClassDesc; return &PolyObjectClassDesc;
} }
void CPolyObject::toStringLocal(std::ostream &ostream, const std::string &pad) const void CPolyObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
CGeomObject::toStringLocal(ostream, pad); CGeomObject::toStringLocal(ostream, pad);
} }

@ -36,6 +36,10 @@
// Project includes // Project includes
#include "geom_object.h" #include "geom_object.h"
/// Must be passed to the parse and build functions by
/// inheriting classes to parse the actual poly object.
#define PMB_POLY_OBJECT_PARSE_FILTER 0x127d3a04
namespace PIPELINE { namespace PIPELINE {
namespace MAX { namespace MAX {
namespace BUILTIN { namespace BUILTIN {
@ -66,7 +70,7 @@ public:
virtual void init(); virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const; virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected: protected:
// inherited // inherited

@ -224,7 +224,7 @@ const ISceneClassDesc *CReferenceMaker::classDesc() const
return &ReferenceMakerClassDesc; return &ReferenceMakerClassDesc;
} }
void CReferenceMaker::toStringLocal(std::ostream &ostream, const std::string &pad) const void CReferenceMaker::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
CAnimatable::toStringLocal(ostream, pad); CAnimatable::toStringLocal(ostream, pad);
uint nb = nbReferences(); uint nb = nbReferences();

@ -68,7 +68,7 @@ public:
virtual void init(); virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const; virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// child classes should inherit, default implementation stores in a vector // child classes should inherit, default implementation stores in a vector
/// Get a reference /// Get a reference

@ -96,7 +96,7 @@ const ISceneClassDesc *CReferenceTarget::classDesc() const
return &ReferenceTargetClassDesc; return &ReferenceTargetClassDesc;
} }
void CReferenceTarget::toStringLocal(std::ostream &ostream, const std::string &pad) const void CReferenceTarget::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
CReferenceMaker::toStringLocal(ostream, pad); CReferenceMaker::toStringLocal(ostream, pad);
} }

@ -68,7 +68,7 @@ public:
virtual void init(); virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const; virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected: protected:
// inherited // inherited

@ -94,7 +94,7 @@ const ISceneClassDesc *CRootNode::classDesc() const
return &RootNodeClassDesc; return &RootNodeClassDesc;
} }
void CRootNode::toStringLocal(std::ostream &ostream, const std::string &pad) const void CRootNode::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
INode::toStringLocal(ostream, pad); INode::toStringLocal(ostream, pad);
} }

@ -66,7 +66,7 @@ public:
virtual void init(); virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const; virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// node interface // node interface
virtual const ucstring &userName() const; virtual const ucstring &userName() const;

@ -106,7 +106,7 @@ const ISceneClassDesc *CSceneImpl::classDesc() const
return &SceneImplClassDesc; return &SceneImplClassDesc;
} }
void CSceneImpl::toStringLocal(std::ostream &ostream, const std::string &pad) const void CSceneImpl::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
CReferenceMaker::toStringLocal(ostream, pad); CReferenceMaker::toStringLocal(ostream, pad);
} }

@ -69,7 +69,7 @@ public:
virtual void init(); virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const; virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// reference maker // reference maker
virtual CReferenceMaker *getReference(uint index) const; virtual CReferenceMaker *getReference(uint index) const;

@ -131,7 +131,7 @@ const ISceneClassDesc *CTrackViewNode::classDesc() const
return &TrackViewNodeClassDesc; return &TrackViewNodeClassDesc;
} }
void CTrackViewNode::toStringLocal(std::ostream &ostream, const std::string &pad) const void CTrackViewNode::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
CReferenceTarget::toStringLocal(ostream, pad); CReferenceTarget::toStringLocal(ostream, pad);
if (m_Empty0140) ostream << "\n" << pad << "Empty 0x0140 "; if (m_Empty0140) ostream << "\n" << pad << "Empty 0x0140 ";

@ -75,7 +75,7 @@ public:
virtual void init(); virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const; virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// reference maker // reference maker
virtual CReferenceMaker *getReference(uint index) const; virtual CReferenceMaker *getReference(uint index) const;

@ -60,7 +60,17 @@ const CTriObjectClassDesc TriObjectClassDesc(&DllPluginDescBuiltin);
void CTriObject::parse(uint16 version, uint filter) void CTriObject::parse(uint16 version, uint filter)
{ {
if (filter == 0)
{
CGeomObject::parse(version); CGeomObject::parse(version);
}
else if (filter == PMB_TRI_OBJECT_PARSE_FILTER)
{
if (!m_ChunksOwnsPointers)
{
}
}
} }
void CTriObject::clean() void CTriObject::clean()
@ -70,7 +80,14 @@ void CTriObject::clean()
void CTriObject::build(uint16 version, uint filter) void CTriObject::build(uint16 version, uint filter)
{ {
if (filter == 0)
{
CGeomObject::build(version); CGeomObject::build(version);
}
else if (filter == PMB_TRI_OBJECT_PARSE_FILTER)
{
}
} }
void CTriObject::disown() void CTriObject::disown()
@ -94,7 +111,7 @@ const ISceneClassDesc *CTriObject::classDesc() const
return &TriObjectClassDesc; return &TriObjectClassDesc;
} }
void CTriObject::toStringLocal(std::ostream &ostream, const std::string &pad) const void CTriObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
CGeomObject::toStringLocal(ostream, pad); CGeomObject::toStringLocal(ostream, pad);
} }

@ -36,6 +36,10 @@
// Project includes // Project includes
#include "geom_object.h" #include "geom_object.h"
/// Must be passed to the parse and build functions by
/// inheriting classes to parse the actual tri object.
#define PMB_TRI_OBJECT_PARSE_FILTER 0x38f55e43
namespace PIPELINE { namespace PIPELINE {
namespace MAX { namespace MAX {
namespace BUILTIN { namespace BUILTIN {
@ -66,7 +70,7 @@ public:
virtual void init(); virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const; virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected: protected:
// inherited // inherited

@ -232,7 +232,7 @@ const ISceneClassDesc *CSceneClass::classDesc() const
return static_cast<const ISceneClassDesc *>(&SceneClassDesc); return static_cast<const ISceneClassDesc *>(&SceneClassDesc);
} }
void CSceneClass::toStringLocal(std::ostream &ostream, const std::string &pad) const void CSceneClass::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{ {
// Nothing to do here... // Nothing to do here...
} }

@ -112,7 +112,7 @@ public:
/// Return the class description of the inheriting class /// Return the class description of the inheriting class
virtual const ISceneClassDesc *classDesc() const; virtual const ISceneClassDesc *classDesc() const;
/// Create a readable representation of this class /// Create a readable representation of this class
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
//@} //@}
public: public:

Loading…
Cancel
Save