Added: #1440 Base parser for CTrackViewNode

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent 359ee113a7
commit 028c5381d1

@ -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);

@ -34,6 +34,8 @@
// #include <nel/misc/debug.h>
// 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<CRootNode *>(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<CTrackViewNode *>(reference);
break;
case 7:
m_GridReference = reference;

@ -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<CReferenceMaker> m_MaterialEditor;
NLMISC::CRefPtr<CReferenceMaker> m_MtlBaseLib;
NLMISC::CRefPtr<CReferenceMaker> m_Sound;
NLMISC::CRefPtr<CReferenceMaker> m_RootNode;
NLMISC::CRefPtr<CRootNode> m_RootNode;
NLMISC::CRefPtr<CReferenceMaker> m_RenderEnvironment;
NLMISC::CRefPtr<CReferenceMaker> m_NamedSelSetList;
NLMISC::CRefPtr<CReferenceMaker> m_TVNode;
NLMISC::CRefPtr<CTrackViewNode> m_TrackViewNode;
NLMISC::CRefPtr<CReferenceMaker> m_GridReference;
NLMISC::CRefPtr<CReferenceMaker> m_RenderEffects;
NLMISC::CRefPtr<CReferenceMaker> m_ShadowMap;

@ -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
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "track_view_node.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// 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<ucstring>();
case PMB_TVNODE_IDENTIFIER_CHUNK_ID:
return new CStorageValue<NLMISC::CClassId>();
case PMB_TVNODE_INTEGER0130_CHUNK_ID:
return new CStorageValue<sint32>();
}
return CReferenceTarget::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -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
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_TRACK_VIEW_NODE_H
#define PIPELINE_TRACK_VIEW_NODE_H
#include <nel/misc/types_nl.h>
// 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<CReferenceMaker> 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<TChild> &children() const { return m_Children; }
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
private:
CStorageRaw *m_Empty0140;
CStorageRaw *m_Empty0150;
std::vector<TChild> m_Children;
}; /* class CTrackViewNode */
typedef CSceneClassDesc<CTrackViewNode> CTrackViewNodeClassDesc;
extern const CTrackViewNodeClassDesc TrackViewNodeClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_TRACK_VIEW_NODE_H */
/* end of file */
Loading…
Cancel
Save