From 1f49f906badb4e8227a16b8e02af04fe8a9f6c70 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 22 Aug 2012 21:59:33 +0200 Subject: [PATCH] Added: #1440 INode --HG-- branch : build_pipeline_v3 --- .../tools/pipeline/max/builtin/builtin.cpp | 12 +- .../nel/tools/pipeline/max/builtin/i_node.cpp | 113 ++++++++++++++++++ code/nel/tools/pipeline/max/builtin/i_node.h | 89 ++++++++++++++ 3 files changed, 210 insertions(+), 4 deletions(-) create mode 100644 code/nel/tools/pipeline/max/builtin/i_node.cpp create mode 100644 code/nel/tools/pipeline/max/builtin/i_node.h diff --git a/code/nel/tools/pipeline/max/builtin/builtin.cpp b/code/nel/tools/pipeline/max/builtin/builtin.cpp index 43ccb2b1f..262061a85 100644 --- a/code/nel/tools/pipeline/max/builtin/builtin.cpp +++ b/code/nel/tools/pipeline/max/builtin/builtin.cpp @@ -38,6 +38,7 @@ #include "animatable.h" #include "reference_maker.h" #include "reference_target.h" +#include "i_node.h" // using namespace std; // using namespace NLMISC; @@ -95,11 +96,11 @@ const CMtlSuperClassDesc MtlSuperClassDesc(&ReferenceTargetClassDesc, "MtlSuperC // 0xd00, soundobj, under reftarget directly typedef CSuperClassDescUnknown CSoundObjSuperClassDesc; const CSoundObjSuperClassDesc SoundObjSuperClassDesc(&ReferenceTargetClassDesc, "SoundObjSuperClassUnknown"); - +/* // 0x1, node; under reftarget directly; classid 1 is node, 2 is rootnode -typedef CSuperClassDescUnknown CNodeSuperClassDesc; +typedef CSuperClassDescUnknown CNodeSuperClassDesc; const CNodeSuperClassDesc NodeSuperClassDesc(&ReferenceTargetClassDesc, "NodeSuperClassUnknown"); - +*/ // 0x900b, controlposition, under control??? typedef CSuperClassDescUnknown CControlPositionSuperClassDesc; const CControlPositionSuperClassDesc ControlPositionSuperClassDesc(&ReferenceTargetClassDesc, "ControlPositionSuperClassUnknown"); @@ -211,6 +212,9 @@ void CBuiltin::registerClasses(CSceneClassRegistry *registry) registry->add(&ReferenceTargetClassDesc); registry->add(&ReferenceTargetSuperClassDesc); + registry->add(&NodeClassDesc); + registry->add(&NodeSuperClassDesc); + // invalid registry->add(&NullSuperClassDesc); @@ -226,7 +230,7 @@ void CBuiltin::registerClasses(CSceneClassRegistry *registry) registry->add(&SamplerSuperClassDesc); registry->add(&MtlSuperClassDesc); registry->add(&SoundObjSuperClassDesc); - registry->add(&NodeSuperClassDesc); + // registry->add(&NodeSuperClassDesc); registry->add(&ControlPositionSuperClassDesc); registry->add(&ControlRotationSuperClassDesc); registry->add(&ControlScaleSuperClassDesc); diff --git a/code/nel/tools/pipeline/max/builtin/i_node.cpp b/code/nel/tools/pipeline/max/builtin/i_node.cpp new file mode 100644 index 000000000..6859884b3 --- /dev/null +++ b/code/nel/tools/pipeline/max/builtin/i_node.cpp @@ -0,0 +1,113 @@ +/** + * \file i_node.cpp + * \brief INode + * \date 2012-08-22 19:45GMT + * \author Jan Boon (Kaetemi) + * INode + */ + +/* + * 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 "i_node.h" + +// STL includes + +// NeL includes +// #include + +// Project includes + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { +namespace MAX { +namespace BUILTIN { + +INode::INode() +{ + +} + +INode::~INode() +{ + +} + +const ucchar *INode::DisplayName = ucstring("Node").c_str(); +const char *INode::InternalName = "Node"; +const char *INode::InternalNameUnknown = "NodeUnknown"; +const NLMISC::CClassId INode::ClassId = NLMISC::CClassId(0x8f5b13, 0x624d477d); /* Not official, please correct */ +const TSClassId INode::SuperClassId = 0x00000001; +const CNodeClassDesc NodeClassDesc(&DllPluginDescBuiltin); +const CNodeSuperClassDesc NodeSuperClassDesc(&NodeClassDesc); + +void INode::parse(uint16 version, TParseLevel level) +{ + CReferenceTarget::parse(version, level); +} + +void INode::clean() +{ + CReferenceTarget::clean(); +} + +void INode::build(uint16 version) +{ + CReferenceTarget::build(version); +} + +void INode::disown() +{ + CReferenceTarget::disown(); +} + +void INode::init() +{ + CReferenceTarget::init(); +} + +bool INode::inherits(const NLMISC::CClassId classId) const +{ + if (classId == classDesc()->classId()) return true; + return CReferenceTarget::inherits(classId); +} + +const ISceneClassDesc *INode::classDesc() const +{ + return &NodeClassDesc; +} + +void INode::toStringLocal(std::ostream &ostream, const std::string &pad) const +{ + CReferenceTarget::toStringLocal(ostream, pad); +} + +IStorageObject *INode::createChunkById(uint16 id, bool container) +{ + return CReferenceTarget::createChunkById(id, container); +} + +} /* namespace BUILTIN */ +} /* namespace MAX */ +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/builtin/i_node.h b/code/nel/tools/pipeline/max/builtin/i_node.h new file mode 100644 index 000000000..10024d758 --- /dev/null +++ b/code/nel/tools/pipeline/max/builtin/i_node.h @@ -0,0 +1,89 @@ +/** + * \file i_node.h + * \brief INode + * \date 2012-08-22 19:45GMT + * \author Jan Boon (Kaetemi) + * INode + */ + +/* + * 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_I_NODE_H +#define PIPELINE_I_NODE_H +#include + +// STL includes + +// NeL includes + +// Project includes +#include "reference_target.h" + +namespace PIPELINE { +namespace MAX { +namespace BUILTIN { + +/** + * \brief INode + * \date 2012-08-22 19:45GMT + * \author Jan Boon (Kaetemi) + * INode + */ +class INode : public CReferenceTarget +{ +public: + INode(); + virtual ~INode(); + + // class desc + static const ucchar *DisplayName; + static const char *InternalName; + static const char *InternalNameUnknown; + static const NLMISC::CClassId ClassId; + static const TSClassId SuperClassId; + + // inherited + virtual void parse(uint16 version, TParseLevel level); + 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; + +protected: + // inherited + virtual IStorageObject *createChunkById(uint16 id, bool container); + +}; /* class INode */ + +typedef CSceneClassDesc CNodeClassDesc; +extern const CNodeClassDesc NodeClassDesc; +typedef CSuperClassDesc CNodeSuperClassDesc; +extern const CNodeSuperClassDesc NodeSuperClassDesc; + +} /* namespace BUILTIN */ +} /* namespace MAX */ +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_I_NODE_H */ + +/* end of file */