From dee1431c9790c3a52b96ed111949209ce2dc4026 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 20 Aug 2012 16:09:08 +0200 Subject: [PATCH] Added: #1440 Parser for unknown scene classes --HG-- branch : build_pipeline_v3 --- .../pipeline/max/scene_class_unknown.cpp | 163 ++++++++++++++++++ .../tools/pipeline/max/scene_class_unknown.h | 126 ++++++++++++++ 2 files changed, 289 insertions(+) create mode 100644 code/nel/tools/pipeline/max/scene_class_unknown.cpp create mode 100644 code/nel/tools/pipeline/max/scene_class_unknown.h diff --git a/code/nel/tools/pipeline/max/scene_class_unknown.cpp b/code/nel/tools/pipeline/max/scene_class_unknown.cpp new file mode 100644 index 000000000..415cb24a7 --- /dev/null +++ b/code/nel/tools/pipeline/max/scene_class_unknown.cpp @@ -0,0 +1,163 @@ +/** + * \file scene_class_unknown.cpp + * \brief CSceneClassUnknown + * \date 2012-08-20 13:23GMT + * \author Jan Boon (Kaetemi) + * CSceneClassUnknown + */ + +/* + * 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 "scene_class_unknown.h" + +// STL includes + +// NeL includes +// #include + +// Project includes + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { +namespace MAX { + +//////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// + +CSceneClassUnknownDllPluginDesc::CSceneClassUnknownDllPluginDesc(const CDllEntry *dllEntry) : m_DisplayName(dllEntry->dllDescription()), m_InternalName(dllEntry->dllFilename()) +{ + +} + +const ucchar *CSceneClassUnknownDllPluginDesc::displayName() const +{ + return m_DisplayName.c_str(); +} + +const ucchar *CSceneClassUnknownDllPluginDesc::internalName() const +{ + return m_InternalName.c_str(); +} + +//////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// + +CSceneClassUnknownDesc::CSceneClassUnknownDesc(const CDllEntry *dllEntry, const CClassEntry *classEntry) : m_DisplayName(classEntry->displayName()), m_ClassId(classEntry->classId()), m_SuperClassId(classEntry->superClassId()), m_DllPluginDesc(dllEntry) +{ + +} + +CSceneClass *CSceneClassUnknownDesc::create() const +{ + nlassert(false); +} + +void CSceneClassUnknownDesc::destroy(CSceneClass *sc) const +{ + nlassert(false); +} + +const ucchar *CSceneClassUnknownDesc::displayName() const +{ + return m_DisplayName.c_str(); +} + +const char *CSceneClassUnknownDesc::internalName() const +{ + return "SceneClassUnknown"; +} + +NLMISC::CClassId CSceneClassUnknownDesc::classId() const +{ + return m_ClassId; +} + +TSClassId CSceneClassUnknownDesc::superClassId() const +{ + return m_SuperClassId; +} + +const IDllPluginDescInternal *CSceneClassUnknownDesc::dllPluginDesc() const +{ + return &m_DllPluginDesc; +} + +//////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// + +CSceneClassUnknown::CSceneClassUnknown(const CDllEntry *dllEntry, const CClassEntry *classEntry) : m_Desc(dllEntry, classEntry) +{ + +} + +CSceneClassUnknown::~CSceneClassUnknown() +{ + +} + +void CSceneClassUnknown::toString(std::ostream &ostream, const std::string &pad) +{ + CSceneClass::toString(ostream, pad); +} + +void CSceneClassUnknown::parse(uint16 version, TParseLevel level) +{ + CSceneClass::parse(version, level); +} + +void CSceneClassUnknown::clean() +{ + CSceneClass::clean(); +} + +void CSceneClassUnknown::build(uint16 version) +{ + CSceneClass::build(version); +} + +void CSceneClassUnknown::disown() +{ + CSceneClass::disown(); +} + +IStorageObject *CSceneClassUnknown::createChunkById(uint16 id, bool container) +{ + return CSceneClass::createChunkById(id, container); +} + +const ISceneClassDesc *CSceneClassUnknown::getClassDesc() +{ + return &m_Desc; +} + +//////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// + +} /* namespace MAX */ +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/scene_class_unknown.h b/code/nel/tools/pipeline/max/scene_class_unknown.h new file mode 100644 index 000000000..aa4275bce --- /dev/null +++ b/code/nel/tools/pipeline/max/scene_class_unknown.h @@ -0,0 +1,126 @@ +/** + * \file scene_class_unknown.h + * \brief CSceneClassUnknown + * \date 2012-08-20 13:23GMT + * \author Jan Boon (Kaetemi) + * CSceneClassUnknown + */ + +/* + * 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_SCENE_CLASS_UNKNOWN_H +#define PIPELINE_SCENE_CLASS_UNKNOWN_H +#include + +// STL includes + +// NeL includes + +// Project includes +#include "scene_class.h" +#include "dll_directory.h" +#include "class_directory_3.h" + +namespace PIPELINE { +namespace MAX { + +/** + * \brief CSceneClassUnknownDllPluginDesc + * \date 2012-08-20 13:23GMT + * \author Jan Boon (Kaetemi) + * CSceneClassUnknownDllPluginDesc + */ +class CSceneClassUnknownDllPluginDesc : public IDllPluginDescInternal +{ +public: + CSceneClassUnknownDllPluginDesc(const CDllEntry *dllEntry); + virtual const ucchar *displayName() const; + virtual const ucchar *internalName() const; + +private: + ucstring m_DisplayName; + ucstring m_InternalName; + +}; + +/** + * \brief CSceneClassUnknownDesc + * \date 2012-08-20 13:23GMT + * \author Jan Boon (Kaetemi) + * CSceneClassUnknownDesc + */ +class CSceneClassUnknownDesc : public ISceneClassDesc +{ +public: + CSceneClassUnknownDesc(const CDllEntry *dllEntry, const CClassEntry *classEntry); + virtual CSceneClass *create() const; + virtual void destroy(CSceneClass *sc) const; + virtual const ucchar *displayName() const; + virtual const char *internalName() const; + virtual NLMISC::CClassId classId() const; + virtual TSClassId superClassId() const; + virtual const IDllPluginDescInternal *dllPluginDesc() const; + +private: + ucstring m_DisplayName; + std::string m_InternalName; + NLMISC::CClassId m_ClassId; + TSClassId m_SuperClassId; + CSceneClassUnknownDllPluginDesc m_DllPluginDesc; + +}; /* class ISceneClassDesc */ + +/** + * \brief CSceneClassUnknown + * \date 2012-08-20 13:23GMT + * \author Jan Boon (Kaetemi) + * Utility class for parsing unknown scene classes and keeping them + * in storage as is. + */ +class CSceneClassUnknown : public CSceneClass +{ +public: + CSceneClassUnknown(const CDllEntry *dllEntry, const CClassEntry *classEntry); + virtual ~CSceneClassUnknown(); + + // inherited + virtual void toString(std::ostream &ostream, const std::string &pad = ""); + virtual void parse(uint16 version, TParseLevel level); + virtual void clean(); + virtual void build(uint16 version); + virtual void disown(); + + // virtual + virtual const ISceneClassDesc *getClassDesc(); + +protected: + virtual IStorageObject *createChunkById(uint16 id, bool container); + +private: + CSceneClassUnknownDesc m_Desc; + +}; /* class CSceneClass */ + +} /* namespace MAX */ +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_SCENE_CLASS_UNKNOWN_H */ + +/* end of file */