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;
}
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);
if (m_AppData && m_AppData->entries().size() != 0)

@ -74,7 +74,7 @@ public:
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) 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
STORAGE::CAppData *appData();

@ -96,7 +96,7 @@ const ISceneClassDesc *CBaseObject::classDesc() const
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);
}

@ -67,7 +67,7 @@ public:
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) 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:
// inherited

@ -94,7 +94,7 @@ const ISceneClassDesc *CEditablePatch::classDesc() const
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);
}

@ -66,7 +66,7 @@ public:
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) 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:
// inherited

@ -43,16 +43,21 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
#define PMB_GEOM_UNKNOWN0900_CHUNK_ID 0x0900
#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()
{
if (!m_ChunksOwnsPointers)
{
m_Unknown0900 = NULL;
m_GeomBuffers = NULL;
}
}
const ucstring CGeomObject::DisplayName = ucstring("GeomObject");
@ -64,9 +69,20 @@ const CGeomObjectClassDesc GeomObjectClassDesc(&DllPluginDescBuiltin);
const CGeomObjectSuperClassDesc GeomObjectSuperClassDesc(&GeomObjectClassDesc);
void CGeomObject::parse(uint16 version, uint filter)
{
if (filter == 0)
{
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()
{
@ -74,12 +90,22 @@ void CGeomObject::clean()
}
void CGeomObject::build(uint16 version, uint filter)
{
if (filter == 0)
{
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()
{
m_Unknown0900 = NULL;
m_GeomBuffers = NULL;
CObject::disown();
}
@ -99,7 +125,7 @@ const ISceneClassDesc *CGeomObject::classDesc() const
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);
}
@ -108,6 +134,8 @@ IStorageObject *CGeomObject::createChunkById(uint16 id, bool container)
{
switch (id)
{
case PMB_GEOM_UNKNOWN0900_CHUNK_ID:
return new CStorageArray<sint32>();
case PMB_GEOM_BUFFERS_CHUNK_ID:
return new STORAGE::CGeomBuffers();
}

@ -36,9 +36,16 @@
// Project includes
#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 MAX {
namespace BUILTIN {
namespace STORAGE {
class CGeomBuffers;
}
/**
* \brief CGeomGeomObject
@ -67,12 +74,19 @@ public:
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) 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:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
private:
IStorageObject *m_Unknown0900;
STORAGE::CGeomBuffers *m_GeomBuffers;
}; /* class CGeomObject */
typedef CSceneClassDesc<CGeomObject> CGeomObjectClassDesc;

@ -97,7 +97,7 @@ const ISceneClassDesc *INode::classDesc() const
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);
// Print the implied connected children

@ -67,7 +67,7 @@ public:
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) 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
virtual INode *parent();

@ -129,7 +129,7 @@ const ISceneClassDesc *CNodeImpl::classDesc() const
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);
ostream << "\n" << pad << "NodeVersion: " << m_NodeVersion;

@ -66,7 +66,7 @@ public:
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) 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
virtual INode *parent();

@ -96,7 +96,7 @@ const ISceneClassDesc *CObject::classDesc() const
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);
}

@ -67,7 +67,7 @@ public:
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) 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:
// inherited

@ -94,7 +94,7 @@ const ISceneClassDesc *CPatchObject::classDesc() const
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);
}

@ -36,6 +36,10 @@
// Project includes
#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 MAX {
namespace BUILTIN {
@ -66,7 +70,7 @@ public:
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) 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:
// inherited

@ -94,7 +94,7 @@ const ISceneClassDesc *CPolyObject::classDesc() const
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);
}

@ -36,6 +36,10 @@
// Project includes
#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 MAX {
namespace BUILTIN {
@ -66,7 +70,7 @@ public:
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) 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:
// inherited

@ -224,7 +224,7 @@ const ISceneClassDesc *CReferenceMaker::classDesc() const
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);
uint nb = nbReferences();

@ -68,7 +68,7 @@ public:
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) 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
/// Get a reference

@ -96,7 +96,7 @@ const ISceneClassDesc *CReferenceTarget::classDesc() const
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);
}

@ -68,7 +68,7 @@ public:
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) 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:
// inherited

@ -94,7 +94,7 @@ const ISceneClassDesc *CRootNode::classDesc() const
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);
}

@ -66,7 +66,7 @@ public:
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) 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
virtual const ucstring &userName() const;

@ -106,7 +106,7 @@ const ISceneClassDesc *CSceneImpl::classDesc() const
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);
}

@ -69,7 +69,7 @@ public:
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) 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
virtual CReferenceMaker *getReference(uint index) const;

@ -131,7 +131,7 @@ const ISceneClassDesc *CTrackViewNode::classDesc() const
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);
if (m_Empty0140) ostream << "\n" << pad << "Empty 0x0140 ";

@ -75,7 +75,7 @@ public:
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) 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
virtual CReferenceMaker *getReference(uint index) const;

@ -59,9 +59,19 @@ const TSClassId CTriObject::SuperClassId = CGeomObject::SuperClassId;
const CTriObjectClassDesc TriObjectClassDesc(&DllPluginDescBuiltin);
void CTriObject::parse(uint16 version, uint filter)
{
if (filter == 0)
{
CGeomObject::parse(version);
}
else if (filter == PMB_TRI_OBJECT_PARSE_FILTER)
{
if (!m_ChunksOwnsPointers)
{
}
}
}
void CTriObject::clean()
{
@ -69,9 +79,16 @@ void CTriObject::clean()
}
void CTriObject::build(uint16 version, uint filter)
{
if (filter == 0)
{
CGeomObject::build(version);
}
else if (filter == PMB_TRI_OBJECT_PARSE_FILTER)
{
}
}
void CTriObject::disown()
{
@ -94,7 +111,7 @@ const ISceneClassDesc *CTriObject::classDesc() const
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);
}

@ -36,6 +36,10 @@
// Project includes
#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 MAX {
namespace BUILTIN {
@ -66,7 +70,7 @@ public:
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) 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:
// inherited

@ -232,7 +232,7 @@ const ISceneClassDesc *CSceneClass::classDesc() const
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...
}

@ -112,7 +112,7 @@ public:
/// Return the class description of the inheriting class
virtual const ISceneClassDesc *classDesc() const;
/// 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:

Loading…
Cancel
Save