From 028c5381d1e96d1deb1c9a3d9d8905a336c6555c Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 24 Aug 2012 15:55:41 +0200 Subject: [PATCH] Added: #1440 Base parser for CTrackViewNode --HG-- branch : build_pipeline_v3 --- .../tools/pipeline/max/builtin/builtin.cpp | 5 + .../tools/pipeline/max/builtin/scene_impl.cpp | 10 +- .../tools/pipeline/max/builtin/scene_impl.h | 7 +- .../pipeline/max/builtin/track_view_node.cpp | 144 ++++++++++++++++++ .../pipeline/max/builtin/track_view_node.h | 108 +++++++++++++ 5 files changed, 268 insertions(+), 6 deletions(-) create mode 100644 code/nel/tools/pipeline/max/builtin/track_view_node.cpp create mode 100644 code/nel/tools/pipeline/max/builtin/track_view_node.h diff --git a/code/nel/tools/pipeline/max/builtin/builtin.cpp b/code/nel/tools/pipeline/max/builtin/builtin.cpp index aca908055..c23b1a41c 100644 --- a/code/nel/tools/pipeline/max/builtin/builtin.cpp +++ b/code/nel/tools/pipeline/max/builtin/builtin.cpp @@ -46,6 +46,8 @@ #include "node_impl.h" #include "root_node.h" +#include "track_view_node.h" + // using namespace std; // using namespace NLMISC; @@ -232,6 +234,9 @@ void CBuiltin::registerClasses(CSceneClassRegistry *registry) registry->add(&RootNodeClassDesc); } + // tvnode (inh ReferenceTarget) + registry->add(&TrackViewNodeClassDesc); + // unimplemented registry->add(&ControlFloatSuperClassDesc); registry->add(&ParamBlockSuperClassDesc); diff --git a/code/nel/tools/pipeline/max/builtin/scene_impl.cpp b/code/nel/tools/pipeline/max/builtin/scene_impl.cpp index b6309589f..bd1e58307 100644 --- a/code/nel/tools/pipeline/max/builtin/scene_impl.cpp +++ b/code/nel/tools/pipeline/max/builtin/scene_impl.cpp @@ -34,6 +34,8 @@ // #include // Project includes +#include "root_node.h" +#include "track_view_node.h" using namespace std; // using namespace NLMISC; @@ -67,7 +69,7 @@ void CSceneImpl::parse(uint16 version) nlassert(m_RootNode); nlassert(m_RenderEnvironment); nlassert(m_NamedSelSetList); - nlassert(m_TVNode); + nlassert(m_TrackViewNode); nlassert(m_GridReference); nlassert(m_RenderEffects); nlassert(m_ShadowMap); @@ -128,7 +130,7 @@ CReferenceMaker *CSceneImpl::getReference(uint index) const case 5: return m_NamedSelSetList; case 6: - return m_TVNode; + return m_TrackViewNode; case 7: return m_GridReference; case 8: @@ -160,7 +162,7 @@ void CSceneImpl::setReference(uint index, CReferenceMaker *reference) m_Sound = reference; break; case 3: - m_RootNode = reference; + m_RootNode = dynamic_cast(reference); break; case 4: m_RenderEnvironment = reference; @@ -169,7 +171,7 @@ void CSceneImpl::setReference(uint index, CReferenceMaker *reference) m_NamedSelSetList = reference; break; case 6: - m_TVNode = reference; + m_TrackViewNode = dynamic_cast(reference); break; case 7: m_GridReference = reference; diff --git a/code/nel/tools/pipeline/max/builtin/scene_impl.h b/code/nel/tools/pipeline/max/builtin/scene_impl.h index 235282e51..62a712619 100644 --- a/code/nel/tools/pipeline/max/builtin/scene_impl.h +++ b/code/nel/tools/pipeline/max/builtin/scene_impl.h @@ -40,6 +40,9 @@ namespace PIPELINE { namespace MAX { namespace BUILTIN { +class CRootNode; +class CTrackViewNode; + /** * \brief CSceneImpl * \date 2012-08-22 08:53GMT @@ -81,10 +84,10 @@ private: NLMISC::CRefPtr m_MaterialEditor; NLMISC::CRefPtr m_MtlBaseLib; NLMISC::CRefPtr m_Sound; - NLMISC::CRefPtr m_RootNode; + NLMISC::CRefPtr m_RootNode; NLMISC::CRefPtr m_RenderEnvironment; NLMISC::CRefPtr m_NamedSelSetList; - NLMISC::CRefPtr m_TVNode; + NLMISC::CRefPtr m_TrackViewNode; NLMISC::CRefPtr m_GridReference; NLMISC::CRefPtr m_RenderEffects; NLMISC::CRefPtr m_ShadowMap; diff --git a/code/nel/tools/pipeline/max/builtin/track_view_node.cpp b/code/nel/tools/pipeline/max/builtin/track_view_node.cpp new file mode 100644 index 000000000..ca1c5a99f --- /dev/null +++ b/code/nel/tools/pipeline/max/builtin/track_view_node.cpp @@ -0,0 +1,144 @@ +/** + * \file track_view_node.cpp + * \brief CTrackViewNode + * \date 2012-08-24 09:44GMT + * \author Jan Boon (Kaetemi) + * CTrackViewNode + */ + +/* + * Copyright (C) 2012 by authors + * + * This file is part of RYZOM CORE PIPELINE. + * RYZOM CORE PIPELINE is free software: you can redistribute it + * and/or modify it under the terms of the GNU Affero General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * RYZOM CORE PIPELINE is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with RYZOM CORE PIPELINE. If not, see + * . + */ + +#include +#include "track_view_node.h" + +// STL includes + +// NeL includes +// #include + +// Project includes + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { +namespace MAX { +namespace BUILTIN { + +#define PMB_TVNODE_EMPTY0140_CHUNK_ID 0x0140 +#define PMB_TVNODE_EMPTY0150_CHUNK_ID 0x0150 + +#define PMB_TVNODE_DISPLAYNAME_CHUNK_ID 0x0110 +#define PMB_TVNODE_IDENTIFIER_CHUNK_ID 0x0120 +#define PMB_TVNODE_INTEGER0130_CHUNK_ID 0x0130 /* type? */ + +CTrackViewNode::CTrackViewNode(CScene *scene) : CReferenceTarget(scene) +{ + +} + +CTrackViewNode::~CTrackViewNode() +{ + +} + +const ucstring CTrackViewNode::DisplayName = ucstring("TVNode"); +const char *CTrackViewNode::InternalName = "TrackViewNode"; +const NLMISC::CClassId CTrackViewNode::ClassId = NLMISC::CClassId(0x8d73b8aa, 0x90f2ee71); +const TSClassId CTrackViewNode::SuperClassId = CReferenceTarget::SuperClassId; +const CTrackViewNodeClassDesc TrackViewNodeClassDesc(&DllPluginDescBuiltin); + +void CTrackViewNode::parse(uint16 version) +{ + CReferenceTarget::parse(version); +} + +void CTrackViewNode::clean() +{ + CReferenceTarget::clean(); +} + +void CTrackViewNode::build(uint16 version) +{ + CReferenceTarget::build(version); +} + +void CTrackViewNode::disown() +{ + CReferenceTarget::disown(); +} + +void CTrackViewNode::init() +{ + CReferenceTarget::init(); +} + +bool CTrackViewNode::inherits(const NLMISC::CClassId classId) const +{ + if (classId == classDesc()->classId()) return true; + return CReferenceTarget::inherits(classId); +} + +const ISceneClassDesc *CTrackViewNode::classDesc() const +{ + return &TrackViewNodeClassDesc; +} + +void CTrackViewNode::toStringLocal(std::ostream &ostream, const std::string &pad) const +{ + CReferenceTarget::toStringLocal(ostream, pad); +} +/* +CReferenceMaker *CTrackViewNode::getReference(uint index) const +{ + if (m_References.size() <= index) return NULL; + return m_References[index]; +} + +void CTrackViewNode::setReference(uint index, CReferenceMaker *reference) +{ + if (m_References.size() <= index) m_References.resize(index + 1); + m_References[index] = reference; +} + +uint CTrackViewNode::nbReferences() const +{ + return m_References.size(); +} +*/ +IStorageObject *CTrackViewNode::createChunkById(uint16 id, bool container) +{ + switch (id) + { + case PMB_TVNODE_DISPLAYNAME_CHUNK_ID: + return new CStorageValue(); + case PMB_TVNODE_IDENTIFIER_CHUNK_ID: + return new CStorageValue(); + case PMB_TVNODE_INTEGER0130_CHUNK_ID: + return new CStorageValue(); + } + return CReferenceTarget::createChunkById(id, container); +} + +} /* namespace BUILTIN */ +} /* namespace MAX */ +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/builtin/track_view_node.h b/code/nel/tools/pipeline/max/builtin/track_view_node.h new file mode 100644 index 000000000..578a02b27 --- /dev/null +++ b/code/nel/tools/pipeline/max/builtin/track_view_node.h @@ -0,0 +1,108 @@ +/** + * \file track_view_node.h + * \brief CTrackViewNode + * \date 2012-08-24 09:44GMT + * \author Jan Boon (Kaetemi) + * CTrackViewNode + */ + +/* + * Copyright (C) 2012 by authors + * + * This file is part of RYZOM CORE PIPELINE. + * RYZOM CORE PIPELINE is free software: you can redistribute it + * and/or modify it under the terms of the GNU Affero General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * RYZOM CORE PIPELINE is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with RYZOM CORE PIPELINE. If not, see + * . + */ + +#ifndef PIPELINE_TRACK_VIEW_NODE_H +#define PIPELINE_TRACK_VIEW_NODE_H +#include + +// STL includes + +// NeL includes + +// Project includes +#include "reference_target.h" + +namespace PIPELINE { +namespace MAX { +namespace BUILTIN { + +/** + * \brief CTrackViewNode + * \date 2012-08-24 09:44GMT + * \author Jan Boon (Kaetemi) + * TVNode + */ +class CTrackViewNode : public CReferenceTarget +{ +public: + struct TChild + { + NLMISC::CRefPtr Reference; + ucstring DisplayName; + NLMISC::CClassId Identifier; + sint32 Integer0130; + }; + + CTrackViewNode(CScene *scene); + virtual ~CTrackViewNode(); + + // class desc + static const ucstring DisplayName; + static const char *InternalName; + static const NLMISC::CClassId ClassId; + static const TSClassId SuperClassId; + + // inherited + virtual void parse(uint16 version); + virtual void clean(); + virtual void build(uint16 version); + virtual void disown(); + 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; + + // reference maker + /*virtual CReferenceMaker *getReference(uint index) const; + virtual void setReference(uint index, CReferenceMaker *reference); + virtual uint nbReferences() const;*/ + + // read access + inline const std::vector &children() const { return m_Children; } + +protected: + // inherited + virtual IStorageObject *createChunkById(uint16 id, bool container); + +private: + CStorageRaw *m_Empty0140; + CStorageRaw *m_Empty0150; + + std::vector m_Children; + +}; /* class CTrackViewNode */ + +typedef CSceneClassDesc CTrackViewNodeClassDesc; +extern const CTrackViewNodeClassDesc TrackViewNodeClassDesc; + +} /* namespace BUILTIN */ +} /* namespace MAX */ +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_TRACK_VIEW_NODE_H */ + +/* end of file */