From 3184ce4edc884fab9b7e7cf7636fd929305a945d Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 22 Aug 2012 13:28:18 +0200 Subject: [PATCH] Added: #1440 First registration to the class registry --HG-- branch : build_pipeline_v3 --- .../tools/pipeline/max/builtin/animatable.cpp | 16 ++-- .../tools/pipeline/max/builtin/animatable.h | 8 +- .../tools/pipeline/max/builtin/builtin.cpp | 12 ++- code/nel/tools/pipeline/max/scene_class.h | 36 -------- .../tools/pipeline/max/scene_class_registry.h | 1 + .../tools/pipeline/max/super_class_desc.cpp | 49 +++++++++++ .../nel/tools/pipeline/max/super_class_desc.h | 83 +++++++++++++++++++ 7 files changed, 153 insertions(+), 52 deletions(-) create mode 100644 code/nel/tools/pipeline/max/super_class_desc.cpp create mode 100644 code/nel/tools/pipeline/max/super_class_desc.h diff --git a/code/nel/tools/pipeline/max/builtin/animatable.cpp b/code/nel/tools/pipeline/max/builtin/animatable.cpp index 21f0aa34b..13d2ac7aa 100644 --- a/code/nel/tools/pipeline/max/builtin/animatable.cpp +++ b/code/nel/tools/pipeline/max/builtin/animatable.cpp @@ -57,32 +57,32 @@ const char *CAnimatable::InternalName = "Animatable"; const char *CAnimatable::InternalNameUnknown = "AnimatableUnknown"; const NLMISC::CClassId CAnimatable::ClassId = NLMISC::CClassId(0x3101497b, 0x24af711b); /* Not official, please correct */ const TSClassId CAnimatable::SuperClassId = 0x77a60fbd;/* Not official, please correct */ -CAnimatableClassDesc AnimatableClassDesc(&DllPluginDescBuiltin); -CAnimatableSuperClassDesc AnimatableSuperClassDesc(&AnimatableClassDesc); +const CAnimatableClassDesc AnimatableClassDesc(&DllPluginDescBuiltin); +const CAnimatableSuperClassDesc AnimatableSuperClassDesc(&AnimatableClassDesc); void CAnimatable::parse(uint16 version, TParseLevel level) { - + CSceneClass::parse(version, level); } void CAnimatable::clean() { - + CSceneClass::clean(); } void CAnimatable::build(uint16 version) { - + CSceneClass:build(version); } void CAnimatable::disown() { - + CSceneClass::disown(); } void CAnimatable::init() { - + CSceneClass::init(); } // inherited @@ -93,7 +93,7 @@ const ISceneClassDesc *CAnimatable::classDesc() void CAnimatable::toStringLocal(std::ostream &ostream, const std::string &pad) const { - + CSceneClass::toStringLocal(ostream, pad); } } /* namespace BUILTIN */ diff --git a/code/nel/tools/pipeline/max/builtin/animatable.h b/code/nel/tools/pipeline/max/builtin/animatable.h index fe588ac43..f127ee2b8 100644 --- a/code/nel/tools/pipeline/max/builtin/animatable.h +++ b/code/nel/tools/pipeline/max/builtin/animatable.h @@ -35,7 +35,7 @@ // Project includes #include "../scene_class.h" -#include "../scene_class_unknown.h" +#include "../super_class_desc.h" namespace PIPELINE { namespace MAX { @@ -72,9 +72,9 @@ public: }; /* class CAnimatable */ typedef CSceneClassDesc CAnimatableClassDesc; -extern CAnimatableClassDesc AnimatableClassDesc; -typedef CSuperClassDesc > CAnimatableSuperClassDesc; -extern CAnimatableSuperClassDesc AnimatableSuperClassDesc; +extern const CAnimatableClassDesc AnimatableClassDesc; +typedef CSuperClassDesc CAnimatableSuperClassDesc; +extern const CAnimatableSuperClassDesc AnimatableSuperClassDesc; } /* namespace BUILTIN */ } /* namespace MAX */ diff --git a/code/nel/tools/pipeline/max/builtin/builtin.cpp b/code/nel/tools/pipeline/max/builtin/builtin.cpp index 45f71b5aa..dd9f1f136 100644 --- a/code/nel/tools/pipeline/max/builtin/builtin.cpp +++ b/code/nel/tools/pipeline/max/builtin/builtin.cpp @@ -35,9 +35,9 @@ // Project includes #include "../scene_class_registry.h" -#include "../animatable.h" -#include "../reference_maker.h" -#include "../reference_target.h" +#include "animatable.h" +#include "reference_maker.h" +#include "reference_target.h" // using namespace std; // using namespace NLMISC; @@ -56,7 +56,11 @@ CBuiltin::~CBuiltin() } -CBuiltin::registerClasses( +void CBuiltin::registerClasses(CSceneClassRegistry *registry) +{ + registry->add(&AnimatableClassDesc); + registry->add(&AnimatableSuperClassDesc); +} } /* namespace BUILTIN */ } /* namespace MAX */ diff --git a/code/nel/tools/pipeline/max/scene_class.h b/code/nel/tools/pipeline/max/scene_class.h index 77146735f..f90639d82 100644 --- a/code/nel/tools/pipeline/max/scene_class.h +++ b/code/nel/tools/pipeline/max/scene_class.h @@ -164,42 +164,6 @@ private: }; /* class CSceneClassDesc */ -/** - * \brief ISuperClassDesc - * \date 2012-08-22 09:42GMT - * \author Jan Boon (Kaetemi) - * ISuperClassDesc - */ -class ISuperClassDesc -{ -public: - /// Create an unknown class that inherits from this superclass - virtual CSceneClass *createUnknown(const NLMISC::CClassId classId, const ucstring &displayName, const ucstring &dllFilename, const ucstring &dllDescription) const = 0; - /// Get an internal name associated with unknown classes of this superclass - virtual const char *internalNameUnknown() const = 0; - /// Return the class description that directly implements this superclass - virtual const ISceneClassDesc *classDesc() const = 0; - -}; /* class ISceneClassDesc */ - -/** - * \brief CSuperClassDesc - * \date 2012-08-22 09:42GMT - * \author Jan Boon (Kaetemi) - * ISuperClassDesc - */ -template -class CSuperClassDesc : public ISuperClassDesc -{ -public: - CSuperClassDesc(const ISceneClassDesc *classDesc) : m_ClassDesc(classDesc) { } - virtual CSceneClass *createUnknown(const NLMISC::CClassId classId, const ucstring &displayName, const ucstring &dllFilename, const ucstring &dllDescription) const { return static_cast(new TUnknown(classId, m_ClassDesc->superClassId(), displayName,internalNameUnknown(), dllFilename, dllDescription)); } - virtual const char *internalNameUnknown() const { return T::InternalNameUnknown; } - virtual const ISceneClassDesc *classDesc() const { return m_ClassDesc; } -private: - const ISceneClassDesc *m_ClassDesc; -}; /* class ISceneClassDesc */ - } /* namespace MAX */ } /* namespace PIPELINE */ diff --git a/code/nel/tools/pipeline/max/scene_class_registry.h b/code/nel/tools/pipeline/max/scene_class_registry.h index a7f5ce0e4..3ade9fd31 100644 --- a/code/nel/tools/pipeline/max/scene_class_registry.h +++ b/code/nel/tools/pipeline/max/scene_class_registry.h @@ -35,6 +35,7 @@ // Project includes #include "scene_class.h" +#include "super_class_desc.h" namespace PIPELINE { namespace MAX { diff --git a/code/nel/tools/pipeline/max/super_class_desc.cpp b/code/nel/tools/pipeline/max/super_class_desc.cpp new file mode 100644 index 000000000..934a04eea --- /dev/null +++ b/code/nel/tools/pipeline/max/super_class_desc.cpp @@ -0,0 +1,49 @@ +/** + * \file super_class_desc.cpp + * \brief CSuperClassDesc + * \date 2012-08-22 11:19GMT + * \author Jan Boon (Kaetemi) + * CSuperClassDesc + */ + +/* + * 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 "super_class_desc.h" + +// STL includes + +// NeL includes +// #include + +// Project includes + +// using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { +namespace MAX { + +void nyannyannyan() { } + +} /* namespace MAX */ +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/super_class_desc.h b/code/nel/tools/pipeline/max/super_class_desc.h new file mode 100644 index 000000000..49c5d4b83 --- /dev/null +++ b/code/nel/tools/pipeline/max/super_class_desc.h @@ -0,0 +1,83 @@ +/** + * \file super_class_desc.h + * \brief CSuperClassDesc + * \date 2012-08-22 11:19GMT + * \author Jan Boon (Kaetemi) + * CSuperClassDesc + */ + +/* + * 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_SUPER_CLASS_DESC_H +#define PIPELINE_SUPER_CLASS_DESC_H +#include + +// STL includes + +// NeL includes + +// Project includes +#include "scene_class_unknown.h" + +namespace PIPELINE { +namespace MAX { + +/** + * \brief ISuperClassDesc + * \date 2012-08-22 09:42GMT + * \author Jan Boon (Kaetemi) + * ISuperClassDesc + */ +class ISuperClassDesc +{ +public: + /// Create an unknown class that inherits from this superclass + virtual CSceneClass *createUnknown(const NLMISC::CClassId classId, const ucstring &displayName, const ucstring &dllFilename, const ucstring &dllDescription) const = 0; + /// Get an internal name associated with unknown classes of this superclass + virtual const char *internalNameUnknown() const = 0; + /// Return the class description that directly implements this superclass + virtual const ISceneClassDesc *classDesc() const = 0; + +}; /* class ISceneClassDesc */ + +/** + * \brief CSuperClassDesc + * \date 2012-08-22 09:42GMT + * \author Jan Boon (Kaetemi) + * ISuperClassDesc + */ +template +class CSuperClassDesc : public ISuperClassDesc +{ +public: + CSuperClassDesc(const ISceneClassDesc *classDesc) : m_ClassDesc(classDesc) { } + virtual CSceneClass *createUnknown(const NLMISC::CClassId classId, const ucstring &displayName, const ucstring &dllFilename, const ucstring &dllDescription) const { return static_cast(new CSceneClassUnknown(classId, m_ClassDesc->superClassId(), displayName,internalNameUnknown(), dllFilename, dllDescription)); } + virtual const char *internalNameUnknown() const { return T::InternalNameUnknown; } + virtual const ISceneClassDesc *classDesc() const { return m_ClassDesc; } +private: + const ISceneClassDesc *m_ClassDesc; +}; /* class ISceneClassDesc */ + +} /* namespace MAX */ +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_SUPER_CLASS_DESC_H */ + +/* end of file */