From e5cd5eb497719dd756c7b3ec9c3906c0c4fc2560 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 26 Aug 2012 15:14:57 +0200 Subject: [PATCH] Added: #1440 Dummy classes for editable mesh, poly and patch --HG-- branch : build_pipeline_v3 --- code/nel/tools/pipeline/max/CMakeLists.txt | 4 +- .../tools/pipeline/max/builtin/builtin.cpp | 12 ++ .../pipeline/max/builtin/editable_patch.cpp | 111 +++++++++++++++++ .../pipeline/max/builtin/editable_patch.h | 86 ++++++++++++++ .../pipeline/max/builtin/patch_object.cpp | 56 ++++++++- .../tools/pipeline/max/builtin/patch_object.h | 27 ++++- .../pipeline/max/builtin/poly_object.cpp | 54 ++++++++- .../tools/pipeline/max/builtin/poly_object.h | 27 ++++- .../pipeline/max/builtin/storage/app_data.cpp | 61 +++++----- .../max/builtin/storage/geom_buffers.cpp | 34 ++++-- .../tools/pipeline/max/builtin/tri_object.cpp | 54 ++++++++- .../tools/pipeline/max/builtin/tri_object.h | 28 ++++- .../nel/tools/pipeline/max/derived_object.cpp | 55 +++++++++ code/nel/tools/pipeline/max/derived_object.h | 63 ++++++++++ .../pipeline/max/epoly/editable_poly.cpp | 112 ++++++++++++++++++ .../tools/pipeline/max/epoly/editable_poly.h | 86 ++++++++++++++ code/nel/tools/pipeline/max/epoly/epoly.cpp | 81 +++++++++++++ code/nel/tools/pipeline/max/epoly/epoly.h | 84 +++++++++++++ .../pipeline/max/scene_class_unknown.cpp | 10 +- .../tools/pipeline/max/scene_class_unknown.h | 4 +- code/nel/tools/pipeline/max/storage_file.cpp | 55 +++++++++ code/nel/tools/pipeline/max/storage_file.h | 63 ++++++++++ .../pipeline/max/update1/editable_mesh.cpp | 112 ++++++++++++++++++ .../pipeline/max/update1/editable_mesh.h | 86 ++++++++++++++ .../tools/pipeline/max/update1/update1.cpp | 81 +++++++++++++ code/nel/tools/pipeline/max/update1/update1.h | 84 +++++++++++++ .../tools/pipeline/max/wsm_derived_object.cpp | 55 +++++++++ .../tools/pipeline/max/wsm_derived_object.h | 63 ++++++++++ code/nel/tools/pipeline/max_dump/main.cpp | 21 ++-- 29 files changed, 1604 insertions(+), 65 deletions(-) create mode 100644 code/nel/tools/pipeline/max/builtin/editable_patch.cpp create mode 100644 code/nel/tools/pipeline/max/builtin/editable_patch.h create mode 100644 code/nel/tools/pipeline/max/derived_object.cpp create mode 100644 code/nel/tools/pipeline/max/derived_object.h create mode 100644 code/nel/tools/pipeline/max/epoly/editable_poly.cpp create mode 100644 code/nel/tools/pipeline/max/epoly/editable_poly.h create mode 100644 code/nel/tools/pipeline/max/epoly/epoly.cpp create mode 100644 code/nel/tools/pipeline/max/epoly/epoly.h create mode 100644 code/nel/tools/pipeline/max/storage_file.cpp create mode 100644 code/nel/tools/pipeline/max/storage_file.h create mode 100644 code/nel/tools/pipeline/max/update1/editable_mesh.cpp create mode 100644 code/nel/tools/pipeline/max/update1/editable_mesh.h create mode 100644 code/nel/tools/pipeline/max/update1/update1.cpp create mode 100644 code/nel/tools/pipeline/max/update1/update1.h create mode 100644 code/nel/tools/pipeline/max/wsm_derived_object.cpp create mode 100644 code/nel/tools/pipeline/max/wsm_derived_object.h diff --git a/code/nel/tools/pipeline/max/CMakeLists.txt b/code/nel/tools/pipeline/max/CMakeLists.txt index 8c9ef40cc..8d34c6647 100644 --- a/code/nel/tools/pipeline/max/CMakeLists.txt +++ b/code/nel/tools/pipeline/max/CMakeLists.txt @@ -14,8 +14,8 @@ ENDIF (NOT GLIB2_FOUND) INCLUDE_DIRECTORIES(${GLIB2_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${LIBGSF_INCLUDE_DIR}) -FILE(GLOB SRCS *.cpp builtin/*.cpp builtin/storage/*.cpp) -FILE(GLOB HDRS *.h builtin/*.h builtin/storage/*.h) +FILE(GLOB SRCS *.cpp builtin/*.cpp builtin/storage/*.cpp update1/*.cpp epoly/*.cpp) +FILE(GLOB HDRS *.h builtin/*.h builtin/storage/*.h update1/*.h epoly/*.h) NL_TARGET_LIB(pipeline_max ${SRCS} diff --git a/code/nel/tools/pipeline/max/builtin/builtin.cpp b/code/nel/tools/pipeline/max/builtin/builtin.cpp index 6c2f25264..5d5f6163c 100644 --- a/code/nel/tools/pipeline/max/builtin/builtin.cpp +++ b/code/nel/tools/pipeline/max/builtin/builtin.cpp @@ -51,6 +51,10 @@ #include "base_object.h" #include "object.h" #include "geom_object.h" +#include "tri_object.h" +#include "poly_object.h" +#include "patch_object.h" +#include "editable_patch.h" // using namespace std; // using namespace NLMISC; @@ -249,6 +253,14 @@ void CBuiltin::registerClasses(CSceneClassRegistry *registry) { registry->add(&GeomObjectSuperClassDesc); registry->add(&GeomObjectClassDesc); + { + registry->add(&TriObjectClassDesc); + registry->add(&PolyObjectClassDesc); + registry->add(&PatchObjectClassDesc); + { + registry->add(&EditablePatchClassDesc); + } + } } } diff --git a/code/nel/tools/pipeline/max/builtin/editable_patch.cpp b/code/nel/tools/pipeline/max/builtin/editable_patch.cpp new file mode 100644 index 000000000..83127675e --- /dev/null +++ b/code/nel/tools/pipeline/max/builtin/editable_patch.cpp @@ -0,0 +1,111 @@ +/** + * \file editable_patch.cpp + * \brief CEditablePatch + * \date 2012-08-26 12:12GMT + * \author Jan Boon (Kaetemi) + * CEditablePatch + */ + +/* + * 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 "editable_patch.h" + +// STL includes + +// NeL includes +// #include + +// Project includes + +// using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { +namespace MAX { +namespace BUILTIN { + +CEditablePatch::CEditablePatch(CScene *scene) : CPatchObject(scene) +{ + +} + +CEditablePatch::~CEditablePatch() +{ + +} + +const ucstring CEditablePatch::DisplayName = ucstring("EditablePatch"); +const char *CEditablePatch::InternalName = "EditablePatch"; +const NLMISC::CClassId CEditablePatch::ClassId = NLMISC::CClassId(0x00001030, 0x00000000); +const TSClassId CEditablePatch::SuperClassId = CPatchObject::SuperClassId; +const CEditablePatchClassDesc EditablePatchClassDesc(&DllPluginDescBuiltin); + +void CEditablePatch::parse(uint16 version) +{ + CPatchObject::parse(version); +} + +void CEditablePatch::clean() +{ + CPatchObject::clean(); +} + +void CEditablePatch::build(uint16 version) +{ + CPatchObject::build(version); +} + +void CEditablePatch::disown() +{ + CPatchObject::disown(); +} + +void CEditablePatch::init() +{ + CPatchObject::init(); +} + +bool CEditablePatch::inherits(const NLMISC::CClassId classId) const +{ + if (classId == classDesc()->classId()) return true; + return CPatchObject::inherits(classId); +} + +const ISceneClassDesc *CEditablePatch::classDesc() const +{ + return &EditablePatchClassDesc; +} + +void CEditablePatch::toStringLocal(std::ostream &ostream, const std::string &pad) const +{ + CPatchObject::toStringLocal(ostream, pad); +} + +IStorageObject *CEditablePatch::createChunkById(uint16 id, bool container) +{ + return CPatchObject::createChunkById(id, container); +} + +} /* namespace BUILTIN */ +} /* namespace MAX */ +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/builtin/editable_patch.h b/code/nel/tools/pipeline/max/builtin/editable_patch.h new file mode 100644 index 000000000..78efb2855 --- /dev/null +++ b/code/nel/tools/pipeline/max/builtin/editable_patch.h @@ -0,0 +1,86 @@ +/** + * \file editable_patch.h + * \brief CEditablePatch + * \date 2012-08-26 12:12GMT + * \author Jan Boon (Kaetemi) + * CEditablePatch + */ + +/* + * 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_EDITABLE_PATCH_H +#define PIPELINE_EDITABLE_PATCH_H +#include + +// STL includes + +// NeL includes + +// Project includes +#include "patch_object.h" + +namespace PIPELINE { +namespace MAX { +namespace BUILTIN { + +/** + * \brief CEditablePatch + * \date 2012-08-26 12:12GMT + * \author Jan Boon (Kaetemi) + * CEditablePatch + */ +class CEditablePatch : public CPatchObject +{ +public: + CEditablePatch(CScene *scene); + virtual ~CEditablePatch(); + + // 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; + +protected: + // inherited + virtual IStorageObject *createChunkById(uint16 id, bool container); + +}; /* class CEditablePatch */ + +typedef CSceneClassDesc CEditablePatchClassDesc; +extern const CEditablePatchClassDesc EditablePatchClassDesc; + +} /* namespace BUILTIN */ +} /* namespace MAX */ +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_EDITABLE_PATCH_H */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/builtin/patch_object.cpp b/code/nel/tools/pipeline/max/builtin/patch_object.cpp index 9ef811e9e..92e478173 100644 --- a/code/nel/tools/pipeline/max/builtin/patch_object.cpp +++ b/code/nel/tools/pipeline/max/builtin/patch_object.cpp @@ -35,14 +35,14 @@ // Project includes -using namespace std; +// using namespace std; // using namespace NLMISC; namespace PIPELINE { namespace MAX { namespace BUILTIN { -CPatchObject::CPatchObject(CScene *scene) : CObject(scene) +CPatchObject::CPatchObject(CScene *scene) : CGeomObject(scene) { } @@ -52,6 +52,58 @@ CPatchObject::~CPatchObject() } +const ucstring CPatchObject::DisplayName = ucstring("PatchObject"); +const char *CPatchObject::InternalName = "PatchObject"; +const NLMISC::CClassId CPatchObject::ClassId = NLMISC::CClassId(0xd0a6b36, 0x7dce4b64); /* Not official, please correct */ +const TSClassId CPatchObject::SuperClassId = CGeomObject::SuperClassId; +const CPatchObjectClassDesc PatchObjectClassDesc(&DllPluginDescBuiltin); + +void CPatchObject::parse(uint16 version) +{ + CGeomObject::parse(version); +} + +void CPatchObject::clean() +{ + CGeomObject::clean(); +} + +void CPatchObject::build(uint16 version) +{ + CGeomObject::build(version); +} + +void CPatchObject::disown() +{ + CGeomObject::disown(); +} + +void CPatchObject::init() +{ + CGeomObject::init(); +} + +bool CPatchObject::inherits(const NLMISC::CClassId classId) const +{ + if (classId == classDesc()->classId()) return true; + return CGeomObject::inherits(classId); +} + +const ISceneClassDesc *CPatchObject::classDesc() const +{ + return &PatchObjectClassDesc; +} + +void CPatchObject::toStringLocal(std::ostream &ostream, const std::string &pad) const +{ + CGeomObject::toStringLocal(ostream, pad); +} + +IStorageObject *CPatchObject::createChunkById(uint16 id, bool container) +{ + return CGeomObject::createChunkById(id, container); +} + } /* namespace BUILTIN */ } /* namespace MAX */ } /* namespace PIPELINE */ diff --git a/code/nel/tools/pipeline/max/builtin/patch_object.h b/code/nel/tools/pipeline/max/builtin/patch_object.h index ee4f0f984..06b836af4 100644 --- a/code/nel/tools/pipeline/max/builtin/patch_object.h +++ b/code/nel/tools/pipeline/max/builtin/patch_object.h @@ -34,7 +34,7 @@ // NeL includes // Project includes -#include "object.h" +#include "geom_object.h" namespace PIPELINE { namespace MAX { @@ -46,14 +46,37 @@ namespace BUILTIN { * \author Jan Boon (Kaetemi) * CPatchObject */ -class CPatchObject : public CObject +class CPatchObject : public CGeomObject { public: CPatchObject(CScene *scene); virtual ~CPatchObject(); + // 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; + +protected: + // inherited + virtual IStorageObject *createChunkById(uint16 id, bool container); + }; /* class CPatchObject */ +typedef CSceneClassDesc CPatchObjectClassDesc; +extern const CPatchObjectClassDesc PatchObjectClassDesc; + } /* namespace BUILTIN */ } /* namespace MAX */ } /* namespace PIPELINE */ diff --git a/code/nel/tools/pipeline/max/builtin/poly_object.cpp b/code/nel/tools/pipeline/max/builtin/poly_object.cpp index 414dd0637..cfcf80b19 100644 --- a/code/nel/tools/pipeline/max/builtin/poly_object.cpp +++ b/code/nel/tools/pipeline/max/builtin/poly_object.cpp @@ -42,7 +42,7 @@ namespace PIPELINE { namespace MAX { namespace BUILTIN { -CPolyObject::CPolyObject(CScene *scene) : CObject(scene) +CPolyObject::CPolyObject(CScene *scene) : CGeomObject(scene) { } @@ -52,6 +52,58 @@ CPolyObject::~CPolyObject() } +const ucstring CPolyObject::DisplayName = ucstring("PolyObject"); +const char *CPolyObject::InternalName = "PolyObject"; +const NLMISC::CClassId CPolyObject::ClassId = NLMISC::CClassId(0x59772461, 0x6e1141e8); /* Not official, please correct */ +const TSClassId CPolyObject::SuperClassId = CGeomObject::SuperClassId; +const CPolyObjectClassDesc PolyObjectClassDesc(&DllPluginDescBuiltin); + +void CPolyObject::parse(uint16 version) +{ + CGeomObject::parse(version); +} + +void CPolyObject::clean() +{ + CGeomObject::clean(); +} + +void CPolyObject::build(uint16 version) +{ + CGeomObject::build(version); +} + +void CPolyObject::disown() +{ + CGeomObject::disown(); +} + +void CPolyObject::init() +{ + CGeomObject::init(); +} + +bool CPolyObject::inherits(const NLMISC::CClassId classId) const +{ + if (classId == classDesc()->classId()) return true; + return CGeomObject::inherits(classId); +} + +const ISceneClassDesc *CPolyObject::classDesc() const +{ + return &PolyObjectClassDesc; +} + +void CPolyObject::toStringLocal(std::ostream &ostream, const std::string &pad) const +{ + CGeomObject::toStringLocal(ostream, pad); +} + +IStorageObject *CPolyObject::createChunkById(uint16 id, bool container) +{ + return CGeomObject::createChunkById(id, container); +} + } /* namespace BUILTIN */ } /* namespace MAX */ } /* namespace PIPELINE */ diff --git a/code/nel/tools/pipeline/max/builtin/poly_object.h b/code/nel/tools/pipeline/max/builtin/poly_object.h index 13d250376..a4eaf921a 100644 --- a/code/nel/tools/pipeline/max/builtin/poly_object.h +++ b/code/nel/tools/pipeline/max/builtin/poly_object.h @@ -34,7 +34,7 @@ // NeL includes // Project includes -#include "object.h" +#include "geom_object.h" namespace PIPELINE { namespace MAX { @@ -46,14 +46,37 @@ namespace BUILTIN { * \author Jan Boon (Kaetemi) * CPolyObject */ -class CPolyObject : public CObject +class CPolyObject : public CGeomObject { public: CPolyObject(CScene *scene); virtual ~CPolyObject(); + // 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; + +protected: + // inherited + virtual IStorageObject *createChunkById(uint16 id, bool container); + }; /* class CPolyObject */ +typedef CSceneClassDesc CPolyObjectClassDesc; +extern const CPolyObjectClassDesc PolyObjectClassDesc; + } /* namespace BUILTIN */ } /* namespace MAX */ } /* namespace PIPELINE */ diff --git a/code/nel/tools/pipeline/max/builtin/storage/app_data.cpp b/code/nel/tools/pipeline/max/builtin/storage/app_data.cpp index 46eea8733..01f862d29 100644 --- a/code/nel/tools/pipeline/max/builtin/storage/app_data.cpp +++ b/code/nel/tools/pipeline/max/builtin/storage/app_data.cpp @@ -47,6 +47,8 @@ namespace STORAGE { //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// +#define PMBS_APP_DATA_PARSE 1 + // Elevate warnings to errors in this file for stricter reading #undef nlwarning #define nlwarning nlerror @@ -151,52 +153,54 @@ void CAppData::toString(std::ostream &ostream, const std::string &pad) const void CAppData::parse(uint16 version) { - /*if (level & PARSE_BUILTIN) - {*/ - // Cannot be parsed yet - if (!m_ChunksOwnsPointers) { nlerror("Already parsed"); return; } +#if PMBS_APP_DATA_PARSE + // Cannot be parsed yet + if (!m_ChunksOwnsPointers) { nlerror("Already parsed"); return; } - // First parse all the child nodes - CStorageContainer::parse(version); + // First parse all the child nodes + CStorageContainer::parse(version); - // Verify - if (m_Chunks.size() < 2) { nlwarning("Bad container size %i", m_Chunks.size()); disown(); return; } + // Verify + if (m_Chunks.size() < 2) { nlwarning("Bad container size %i", m_Chunks.size()); disown(); return; } - // Header - TStorageObjectContainer::iterator it = m_Chunks.begin(); - if (it->first != PMBS_APP_DATA_HEADER_CHUNK_ID) { nlwarning("Bad id %x, expected %x", (uint32)it->first, PMBS_APP_DATA_HEADER_CHUNK_ID); disown(); return; } - uint32 headerSize = static_cast *>(it->second)->Value; - ++it; + // Header + TStorageObjectContainer::iterator it = m_Chunks.begin(); + if (it->first != PMBS_APP_DATA_HEADER_CHUNK_ID) { nlwarning("Bad id %x, expected %x", (uint32)it->first, PMBS_APP_DATA_HEADER_CHUNK_ID); disown(); return; } + uint32 headerSize = static_cast *>(it->second)->Value; + ++it; - // Entries - for (TStorageObjectContainer::iterator end = m_Chunks.end(); it != end; ++it) - { - if (it->first != PMBS_APP_DATA_ENTRY_CHUNK_ID) { nlwarning("Bad id %x, expected %x", (uint32)it->first, PMBS_APP_DATA_ENTRY_CHUNK_ID); disown(); return; } - CAppDataEntry *entry = static_cast(it->second); - TKey key(entry->key()->ClassId, entry->key()->SuperClassId, entry->key()->SubId); - if (m_Entries.find(key) != m_Entries.end()) { nlwarning("Duplicate entry"); disown(); return; } - m_Entries[key] = entry; - } + // Entries + for (TStorageObjectContainer::iterator end = m_Chunks.end(); it != end; ++it) + { + if (it->first != PMBS_APP_DATA_ENTRY_CHUNK_ID) { nlwarning("Bad id %x, expected %x", (uint32)it->first, PMBS_APP_DATA_ENTRY_CHUNK_ID); disown(); return; } + CAppDataEntry *entry = static_cast(it->second); + TKey key(entry->key()->ClassId, entry->key()->SuperClassId, entry->key()->SubId); + if (m_Entries.find(key) != m_Entries.end()) { nlwarning("Duplicate entry"); disown(); return; } + m_Entries[key] = entry; + } - // Verify or fail - if (m_Entries.size() != headerSize) { nlwarning("Entry count %i does not match header %i", m_Entries.size(), headerSize); disown(); return; } + // Verify or fail + if (m_Entries.size() != headerSize) { nlwarning("Entry count %i does not match header %i", m_Entries.size(), headerSize); disown(); return; } - // Take local ownership - m_ChunksOwnsPointers = false; - /*}*/ + // Take local ownership + m_ChunksOwnsPointers = false; +#endif } void CAppData::clean() { +#if PMBS_APP_DATA_PARSE if (m_ChunksOwnsPointers) { nldebug("Not parsed, or disowned"); return; } // Must have local ownership if (m_Chunks.size() == 0) { nlwarning("Already cleaned (or did not build due to coding error)"); return; } // Already cleaned if (m_Chunks.begin()->first != PMBS_APP_DATA_HEADER_CHUNK_ID) { nlerror("Bad id %x, expected %x", (uint32)m_Chunks.begin()->first, PMBS_APP_DATA_HEADER_CHUNK_ID); return; } // Cannot happen, because we won't have local ownership if parsing failed delete m_Chunks.begin()->second; // Delete the header chunk, since we own it m_Chunks.clear(); // Clear the remaining chunks +#endif } void CAppData::build(uint16 version) { +#if PMBS_APP_DATA_PARSE // Must be clean first if (!m_ChunksOwnsPointers && m_Chunks.size() != 0) { nlerror("Not cleaned"); return; } if (m_Chunks.size() != 0) { nldebug("Not parsed, or disowned"); return; } @@ -209,10 +213,12 @@ void CAppData::build(uint16 version) // Set up the entries for (TMap::iterator it = m_Entries.begin(), end = m_Entries.end(); it != end; ++it) m_Chunks.push_back(TStorageObjectWithId(PMBS_APP_DATA_ENTRY_CHUNK_ID, it->second)); +#endif } void CAppData::disown() { +#if PMBS_APP_DATA_PARSE if (m_ChunksOwnsPointers) { nldebug("Not parsed"); } if (!m_ChunksOwnsPointers && (m_Chunks.size() != (m_Entries.size() + 1))) { nlerror("Not built"); return; } // If chunks is not the owner, built chunks must match the parsed data // NOTE: m_Chunks must be valid at this point! @@ -225,6 +231,7 @@ void CAppData::disown() // Disown all the child chunks CStorageContainer::disown(); +#endif } void CAppData::init() diff --git a/code/nel/tools/pipeline/max/builtin/storage/geom_buffers.cpp b/code/nel/tools/pipeline/max/builtin/storage/geom_buffers.cpp index 1b7dcb16a..fd527b2f6 100644 --- a/code/nel/tools/pipeline/max/builtin/storage/geom_buffers.cpp +++ b/code/nel/tools/pipeline/max/builtin/storage/geom_buffers.cpp @@ -49,6 +49,8 @@ namespace STORAGE { //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// +#define PMBS_GEOM_BUFFERS_PARSE 1 + // Elevate warnings to errors in this file for stricter reading #undef nlwarning #define nlwarning nlerror @@ -152,13 +154,13 @@ CGeomPolyFaceInfo::CGeomPolyFaceInfo() : I1(0), Material(0), SmoothingGroups(0) void CGeomPolyFaceInfo::serial(NLMISC::IStream &stream) { - nldebug("go"); + // nldebug("go"); stream.serialCont(Vertices); - nldebug("%i vertices", Vertices.size()); + // nldebug("%i vertices", Vertices.size()); uint16 bitfield; if (!stream.isReading()) { - nldebug("writing"); + /*nldebug("writing");*/ bitfield = 0x0000; if (I1) bitfield |= 0x0001; // bitfield |= 0x0002; @@ -170,31 +172,31 @@ void CGeomPolyFaceInfo::serial(NLMISC::IStream &stream) // bitfield |= 0x0080; } stream.serial(bitfield); - nldebug("bitfield 0x%x", (uint32)bitfield); - if (bitfield & 0x0001) { nldebug("i1"); stream.serial(I1); nlassert(I1); bitfield &= ~0x0001; } + // nldebug("bitfield 0x%x", (uint32)bitfield); + if (bitfield & 0x0001) { /*nldebug("i1");*/ stream.serial(I1); nlassert(I1); bitfield &= ~0x0001; } else I1 = 0; - if (bitfield & 0x0008) { nldebug("material"); stream.serial(Material); nlassert(Material); bitfield &= ~0x0008; } + if (bitfield & 0x0008) { /*nldebug("material");*/ stream.serial(Material); nlassert(Material); bitfield &= ~0x0008; } else Material = 0; - if (bitfield & 0x0010) { nldebug("smoothing"); stream.serial(SmoothingGroups); nlassert(SmoothingGroups); bitfield &= ~0x0010; } + if (bitfield & 0x0010) { /*nldebug("smoothing");*/ stream.serial(SmoothingGroups); nlassert(SmoothingGroups); bitfield &= ~0x0010; } else SmoothingGroups = 0; if (bitfield & 0x0020) { - nldebug("triangles"); + /*nldebug("triangles");*/ if (stream.isReading()) Triangulation.resize(Vertices.size() - 3); else nlassert(Triangulation.size() == Vertices.size() - 3); for (std::vector >::size_type i = 0; i < Triangulation.size(); ++i) { stream.serial(Triangulation[i].first); - nldebug("cut from %i", Triangulation[i].first); + /*nldebug("cut from %i", Triangulation[i].first);*/ nlassert(Triangulation[i].first < Vertices.size()); stream.serial(Triangulation[i].second); - nldebug("to %i", Triangulation[i].second); + /*nldebug("to %i", Triangulation[i].second);*/ nlassert(Triangulation[i].second < Vertices.size()); } nlassert(Triangulation.size()); bitfield &= ~0x0020; } - if (bitfield) nlerror("Remaining bitfield value 0x%x", (uint32)bitfield); + if (bitfield) nlerror("Remaining bitfield value 0x%x, please debug and implement", (uint32)bitfield); } std::string CGeomPolyFaceInfo::toString() const @@ -230,26 +232,35 @@ void CGeomBuffers::toString(std::ostream &ostream, const std::string &pad) const void CGeomBuffers::parse(uint16 version) { +#if PMBS_GEOM_BUFFERS_PARSE CStorageContainer::parse(version); +#endif } void CGeomBuffers::clean() { +#if PMBS_GEOM_BUFFERS_PARSE CStorageContainer::clean(); +#endif } void CGeomBuffers::build(uint16 version) { +#if PMBS_GEOM_BUFFERS_PARSE CStorageContainer::build(version); +#endif } void CGeomBuffers::disown() { +#if PMBS_GEOM_BUFFERS_PARSE CStorageContainer::disown(); +#endif } IStorageObject *CGeomBuffers::createChunkById(uint16 id, bool container) { +#if PMBS_GEOM_BUFFERS_PARSE switch (id) { // nlassert(!container); @@ -279,6 +290,7 @@ IStorageObject *CGeomBuffers::createChunkById(uint16 id, bool container) nlassert(!container); return new CStorageArraySizePre(); } +#endif return CStorageContainer::createChunkById(id, container); } diff --git a/code/nel/tools/pipeline/max/builtin/tri_object.cpp b/code/nel/tools/pipeline/max/builtin/tri_object.cpp index 0a355446e..0428a44f2 100644 --- a/code/nel/tools/pipeline/max/builtin/tri_object.cpp +++ b/code/nel/tools/pipeline/max/builtin/tri_object.cpp @@ -42,7 +42,7 @@ namespace PIPELINE { namespace MAX { namespace BUILTIN { -CTriObject::CTriObject(CScene *scene) : CObject(scene) +CTriObject::CTriObject(CScene *scene) : CGeomObject(scene) { } @@ -52,6 +52,58 @@ CTriObject::~CTriObject() } +const ucstring CTriObject::DisplayName = ucstring("TriObject"); +const char *CTriObject::InternalName = "TriObject"; +const NLMISC::CClassId CTriObject::ClassId = NLMISC::CClassId(0x4553fa6, 0x30f8421e); /* Not official, please correct */ +const TSClassId CTriObject::SuperClassId = CGeomObject::SuperClassId; +const CTriObjectClassDesc TriObjectClassDesc(&DllPluginDescBuiltin); + +void CTriObject::parse(uint16 version) +{ + CGeomObject::parse(version); +} + +void CTriObject::clean() +{ + CGeomObject::clean(); +} + +void CTriObject::build(uint16 version) +{ + CGeomObject::build(version); +} + +void CTriObject::disown() +{ + CGeomObject::disown(); +} + +void CTriObject::init() +{ + CGeomObject::init(); +} + +bool CTriObject::inherits(const NLMISC::CClassId classId) const +{ + if (classId == classDesc()->classId()) return true; + return CGeomObject::inherits(classId); +} + +const ISceneClassDesc *CTriObject::classDesc() const +{ + return &TriObjectClassDesc; +} + +void CTriObject::toStringLocal(std::ostream &ostream, const std::string &pad) const +{ + CGeomObject::toStringLocal(ostream, pad); +} + +IStorageObject *CTriObject::createChunkById(uint16 id, bool container) +{ + return CGeomObject::createChunkById(id, container); +} + } /* namespace BUILTIN */ } /* namespace MAX */ } /* namespace PIPELINE */ diff --git a/code/nel/tools/pipeline/max/builtin/tri_object.h b/code/nel/tools/pipeline/max/builtin/tri_object.h index 9f979cd3b..826cfae52 100644 --- a/code/nel/tools/pipeline/max/builtin/tri_object.h +++ b/code/nel/tools/pipeline/max/builtin/tri_object.h @@ -34,7 +34,7 @@ // NeL includes // Project includes -#include "object.h" +#include "geom_object.h" namespace PIPELINE { namespace MAX { @@ -46,15 +46,37 @@ namespace BUILTIN { * \author Jan Boon (Kaetemi) * CTriObject */ -class CTriObject : public CObject +class CTriObject : public CGeomObject { - public: CTriObject(CScene *scene); virtual ~CTriObject(); + // 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; + +protected: + // inherited + virtual IStorageObject *createChunkById(uint16 id, bool container); + }; /* class CTriObject */ +typedef CSceneClassDesc CTriObjectClassDesc; +extern const CTriObjectClassDesc TriObjectClassDesc; + } /* namespace BUILTIN */ } /* namespace MAX */ } /* namespace PIPELINE */ diff --git a/code/nel/tools/pipeline/max/derived_object.cpp b/code/nel/tools/pipeline/max/derived_object.cpp new file mode 100644 index 000000000..21f26e074 --- /dev/null +++ b/code/nel/tools/pipeline/max/derived_object.cpp @@ -0,0 +1,55 @@ +/** + * \file derived_object.cpp + * \brief CDerivedObject + * \date 2012-08-26 12:04GMT + * \author Jan Boon (Kaetemi) + * CDerivedObject + */ + +/* + * 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 "derived_object.h" + +// STL includes + +// NeL includes +// #include + +// Project includes + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { + +CDerivedObject::CDerivedObject() +{ + +} + +CDerivedObject::~CDerivedObject() +{ + +} + +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/derived_object.h b/code/nel/tools/pipeline/max/derived_object.h new file mode 100644 index 000000000..273dbdfd6 --- /dev/null +++ b/code/nel/tools/pipeline/max/derived_object.h @@ -0,0 +1,63 @@ +/** + * \file derived_object.h + * \brief CDerivedObject + * \date 2012-08-26 12:04GMT + * \author Jan Boon (Kaetemi) + * CDerivedObject + */ + +/* + * 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_DERIVED_OBJECT_H +#define PIPELINE_DERIVED_OBJECT_H +#include + +// STL includes + +// NeL includes + +// Project includes + +namespace PIPELINE { + +/** + * \brief CDerivedObject + * \date 2012-08-26 12:04GMT + * \author Jan Boon (Kaetemi) + * CDerivedObject + */ +class CDerivedObject +{ +protected: + // pointers + // ... + + // instances + // ... +public: + CDerivedObject(); + virtual ~CDerivedObject(); +}; /* class CDerivedObject */ + +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_DERIVED_OBJECT_H */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/epoly/editable_poly.cpp b/code/nel/tools/pipeline/max/epoly/editable_poly.cpp new file mode 100644 index 000000000..6f1248349 --- /dev/null +++ b/code/nel/tools/pipeline/max/epoly/editable_poly.cpp @@ -0,0 +1,112 @@ +/** + * \file editable_poly.cpp + * \brief CEditablePoly + * \date 2012-08-26 12:02GMT + * \author Jan Boon (Kaetemi) + * CEditablePoly + */ + +/* + * 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 "editable_poly.h" + +// STL includes + +// NeL includes +// #include + +// Project includes +#include "epoly.h" + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { +namespace MAX { +namespace EPOLY { + +CEditablePoly::CEditablePoly(CScene *scene) : CPolyObject(scene) +{ + +} + +CEditablePoly::~CEditablePoly() +{ + +} + +const ucstring CEditablePoly::DisplayName = ucstring("EditablePoly"); +const char *CEditablePoly::InternalName = "EditablePoly"; +const NLMISC::CClassId CEditablePoly::ClassId = NLMISC::CClassId(0x1bf8338d, 0x192f6098); +const TSClassId CEditablePoly::SuperClassId = CPolyObject::SuperClassId; +const CEditablePolyClassDesc EditablePolyClassDesc(&DllPluginDescEPoly); + +void CEditablePoly::parse(uint16 version) +{ + CPolyObject::parse(version); +} + +void CEditablePoly::clean() +{ + CPolyObject::clean(); +} + +void CEditablePoly::build(uint16 version) +{ + CPolyObject::build(version); +} + +void CEditablePoly::disown() +{ + CPolyObject::disown(); +} + +void CEditablePoly::init() +{ + CPolyObject::init(); +} + +bool CEditablePoly::inherits(const NLMISC::CClassId classId) const +{ + if (classId == classDesc()->classId()) return true; + return CPolyObject::inherits(classId); +} + +const ISceneClassDesc *CEditablePoly::classDesc() const +{ + return &EditablePolyClassDesc; +} + +void CEditablePoly::toStringLocal(std::ostream &ostream, const std::string &pad) const +{ + CPolyObject::toStringLocal(ostream, pad); +} + +IStorageObject *CEditablePoly::createChunkById(uint16 id, bool container) +{ + return CPolyObject::createChunkById(id, container); +} + +} /* namespace EPOLY */ +} /* namespace MAX */ +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/epoly/editable_poly.h b/code/nel/tools/pipeline/max/epoly/editable_poly.h new file mode 100644 index 000000000..33b14cfba --- /dev/null +++ b/code/nel/tools/pipeline/max/epoly/editable_poly.h @@ -0,0 +1,86 @@ +/** + * \file editable_poly.h + * \brief CEditablePoly + * \date 2012-08-26 12:02GMT + * \author Jan Boon (Kaetemi) + * CEditablePoly + */ + +/* + * 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_EDITABLE_POLY_H +#define PIPELINE_EDITABLE_POLY_H +#include + +// STL includes + +// NeL includes + +// Project includes +#include "../builtin/poly_object.h" + +namespace PIPELINE { +namespace MAX { +namespace EPOLY { + +/** + * \brief CEditablePoly + * \date 2012-08-26 12:02GMT + * \author Jan Boon (Kaetemi) + * CEditablePoly + */ +class CEditablePoly : public PIPELINE::MAX::BUILTIN::CPolyObject +{ +public: + CEditablePoly(CScene *scene); + virtual ~CEditablePoly(); + + // 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; + +protected: + // inherited + virtual IStorageObject *createChunkById(uint16 id, bool container); + +}; /* class CEditablePoly */ + +typedef CSceneClassDesc CEditablePolyClassDesc; +extern const CEditablePolyClassDesc EditablePolyClassDesc; + +} /* namespace EPOLY */ +} /* namespace MAX */ +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_EDITABLE_POLY_H */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/epoly/epoly.cpp b/code/nel/tools/pipeline/max/epoly/epoly.cpp new file mode 100644 index 000000000..120605fa7 --- /dev/null +++ b/code/nel/tools/pipeline/max/epoly/epoly.cpp @@ -0,0 +1,81 @@ +/** + * \file epoly.cpp + * \brief CEPoly + * \date 2012-08-26 12:03GMT + * \author Jan Boon (Kaetemi) + * CEPoly + */ + +/* + * 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 "epoly.h" + +// STL includes + +// NeL includes +// #include + +// Project includes +#include "../scene_class_registry.h" + +#include "editable_poly.h" + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { +namespace MAX { +namespace EPOLY { + +CEPoly::CEPoly() +{ + +} + +CEPoly::~CEPoly() +{ + +} + +void CEPoly::registerClasses(CSceneClassRegistry *registry) +{ + registry->add(&EditablePolyClassDesc); +} + +const ucchar *CDllPluginDescEPoly::displayName() const +{ + static const ucstring value = ucstring("Editable Poly Object (Ryzom Core)"); + return value.c_str(); +} + +const ucchar *CDllPluginDescEPoly::internalName() const +{ + static const ucstring value = ucstring("EPoly.dlo"); + return value.c_str(); +} + +const CDllPluginDescEPoly DllPluginDescEPoly; + +} /* namespace EPOLY */ +} /* namespace MAX */ +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/epoly/epoly.h b/code/nel/tools/pipeline/max/epoly/epoly.h new file mode 100644 index 000000000..7d0823bce --- /dev/null +++ b/code/nel/tools/pipeline/max/epoly/epoly.h @@ -0,0 +1,84 @@ +/** + * \file epoly.h + * \brief CEPoly + * \date 2012-08-26 12:03GMT + * \author Jan Boon (Kaetemi) + * CEPoly + */ + +/* + * 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_EPOLY_H +#define PIPELINE_EPOLY_H +#include + +// STL includes + +// NeL includes + +// Project includes +#include "../dll_plugin_desc.h" + +namespace PIPELINE { +namespace MAX { + +class CSceneClassRegistry; + +namespace EPOLY { + +/** + * \brief CEPoly + * \date 2012-08-26 12:03GMT + * \author Jan Boon (Kaetemi) + * CEPoly + */ +class CEPoly +{ +public: + static void registerClasses(CSceneClassRegistry *registry); + +public: + CEPoly(); + virtual ~CEPoly(); + +}; /* class CEPoly */ + +/** + * \brief CDllPluginDescEPoly + * \date 2012-08-26 12:03GMT + * \author Jan Boon (Kaetemi) + * CDllPluginDescEPoly + */ +class CDllPluginDescEPoly : public IDllPluginDescInternal +{ +public: + virtual const ucchar *displayName() const; + virtual const ucchar *internalName() const; +}; /* class CDllPluginDescScript */ + +extern const CDllPluginDescEPoly DllPluginDescEPoly; + +} /* namespace EPOLY */ +} /* namespace MAX */ +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_EPOLY_H */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/scene_class_unknown.cpp b/code/nel/tools/pipeline/max/scene_class_unknown.cpp index 1e68c302f..f5179a7d3 100644 --- a/code/nel/tools/pipeline/max/scene_class_unknown.cpp +++ b/code/nel/tools/pipeline/max/scene_class_unknown.cpp @@ -45,19 +45,19 @@ namespace MAX { //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// -CSceneClassUnknownDllPluginDesc::CSceneClassUnknownDllPluginDesc(const ucstring &dllFilename, const ucstring &dllDescription) : m_DisplayName(dllFilename), m_InternalName(dllDescription) +CSceneClassUnknownDllPluginDesc::CSceneClassUnknownDllPluginDesc(const ucstring &dllFilename, const ucstring &dllDescription) : m_InternalName(dllFilename), m_DisplayName(dllDescription) { } -const ucchar *CSceneClassUnknownDllPluginDesc::displayName() const +const ucchar *CSceneClassUnknownDllPluginDesc::internalName() const { - return m_DisplayName.c_str(); + return m_InternalName.c_str(); } -const ucchar *CSceneClassUnknownDllPluginDesc::internalName() const +const ucchar *CSceneClassUnknownDllPluginDesc::displayName() const { - return m_InternalName.c_str(); + return m_DisplayName.c_str(); } //////////////////////////////////////////////////////////////////////// diff --git a/code/nel/tools/pipeline/max/scene_class_unknown.h b/code/nel/tools/pipeline/max/scene_class_unknown.h index 7034ba00c..46fb44a39 100644 --- a/code/nel/tools/pipeline/max/scene_class_unknown.h +++ b/code/nel/tools/pipeline/max/scene_class_unknown.h @@ -49,12 +49,12 @@ class CSceneClassUnknownDllPluginDesc : public IDllPluginDescInternal { public: CSceneClassUnknownDllPluginDesc(const ucstring &dllFilename, const ucstring &dllDescription); - virtual const ucchar *displayName() const; virtual const ucchar *internalName() const; + virtual const ucchar *displayName() const; private: - ucstring m_DisplayName; ucstring m_InternalName; + ucstring m_DisplayName; }; diff --git a/code/nel/tools/pipeline/max/storage_file.cpp b/code/nel/tools/pipeline/max/storage_file.cpp new file mode 100644 index 000000000..083075424 --- /dev/null +++ b/code/nel/tools/pipeline/max/storage_file.cpp @@ -0,0 +1,55 @@ +/** + * \file storage_file.cpp + * \brief CStorageFile + * \date 2012-08-20 13:35GMT + * \author Jan Boon (Kaetemi) + * CStorageFile + */ + +/* + * 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 "storage_file.h" + +// STL includes + +// NeL includes +// #include + +// Project includes + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { + +CStorageFile::CStorageFile() +{ + +} + +CStorageFile::~CStorageFile() +{ + +} + +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/storage_file.h b/code/nel/tools/pipeline/max/storage_file.h new file mode 100644 index 000000000..596016e16 --- /dev/null +++ b/code/nel/tools/pipeline/max/storage_file.h @@ -0,0 +1,63 @@ +/** + * \file storage_file.h + * \brief CStorageFile + * \date 2012-08-20 13:35GMT + * \author Jan Boon (Kaetemi) + * CStorageFile + */ + +/* + * 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_STORAGE_FILE_H +#define PIPELINE_STORAGE_FILE_H +#include + +// STL includes + +// NeL includes + +// Project includes + +namespace PIPELINE { + +/** + * \brief CStorageFile + * \date 2012-08-20 13:35GMT + * \author Jan Boon (Kaetemi) + * CStorageFile + */ +class CStorageFile +{ +protected: + // pointers + // ... + + // instances + // ... +public: + CStorageFile(); + virtual ~CStorageFile(); +}; /* class CStorageFile */ + +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_STORAGE_FILE_H */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/update1/editable_mesh.cpp b/code/nel/tools/pipeline/max/update1/editable_mesh.cpp new file mode 100644 index 000000000..3cf8a6ef4 --- /dev/null +++ b/code/nel/tools/pipeline/max/update1/editable_mesh.cpp @@ -0,0 +1,112 @@ +/** + * \file editable_mesh.cpp + * \brief CEditableMesh + * \date 2012-08-26 12:11GMT + * \author Jan Boon (Kaetemi) + * CEditableMesh + */ + +/* + * 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 "editable_mesh.h" + +// STL includes + +// NeL includes +// #include + +// Project includes +#include "update1.h" + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { +namespace MAX { +namespace UPDATE1 { + +CEditableMesh::CEditableMesh(CScene *scene) : CTriObject(scene) +{ + +} + +CEditableMesh::~CEditableMesh() +{ + +} + +const ucstring CEditableMesh::DisplayName = ucstring("EditableMesh"); +const char *CEditableMesh::InternalName = "EditableMesh"; +const NLMISC::CClassId CEditableMesh::ClassId = NLMISC::CClassId(0xe44f10b3, 0x00000000); +const TSClassId CEditableMesh::SuperClassId = CTriObject::SuperClassId; +const CEditableMeshClassDesc EditableMeshClassDesc(&DllPluginDescUpdate1); + +void CEditableMesh::parse(uint16 version) +{ + CTriObject::parse(version); +} + +void CEditableMesh::clean() +{ + CTriObject::clean(); +} + +void CEditableMesh::build(uint16 version) +{ + CTriObject::build(version); +} + +void CEditableMesh::disown() +{ + CTriObject::disown(); +} + +void CEditableMesh::init() +{ + CTriObject::init(); +} + +bool CEditableMesh::inherits(const NLMISC::CClassId classId) const +{ + if (classId == classDesc()->classId()) return true; + return CTriObject::inherits(classId); +} + +const ISceneClassDesc *CEditableMesh::classDesc() const +{ + return &EditableMeshClassDesc; +} + +void CEditableMesh::toStringLocal(std::ostream &ostream, const std::string &pad) const +{ + CTriObject::toStringLocal(ostream, pad); +} + +IStorageObject *CEditableMesh::createChunkById(uint16 id, bool container) +{ + return CTriObject::createChunkById(id, container); +} + +} /* namespace UPDATE1 */ +} /* namespace MAX */ +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/update1/editable_mesh.h b/code/nel/tools/pipeline/max/update1/editable_mesh.h new file mode 100644 index 000000000..d1ac46277 --- /dev/null +++ b/code/nel/tools/pipeline/max/update1/editable_mesh.h @@ -0,0 +1,86 @@ +/** + * \file editable_mesh.h + * \brief CEditableMesh + * \date 2012-08-26 12:11GMT + * \author Jan Boon (Kaetemi) + * CEditableMesh + */ + +/* + * 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_EDITABLE_MESH_H +#define PIPELINE_EDITABLE_MESH_H +#include + +// STL includes + +// NeL includes + +// Project includes +#include "../builtin/tri_object.h" + +namespace PIPELINE { +namespace MAX { +namespace UPDATE1 { + +/** + * \brief CEditableMesh + * \date 2012-08-26 12:11GMT + * \author Jan Boon (Kaetemi) + * CEditableMesh + */ +class CEditableMesh : public PIPELINE::MAX::BUILTIN::CTriObject +{ +public: + CEditableMesh(CScene *scene); + virtual ~CEditableMesh(); + + // 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; + +protected: + // inherited + virtual IStorageObject *createChunkById(uint16 id, bool container); + +}; /* class CEditableMesh */ + +typedef CSceneClassDesc CEditableMeshClassDesc; +extern const CEditableMeshClassDesc EditableMeshClassDesc; + +} /* namespace UPDATE1 */ +} /* namespace MAX */ +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_EDITABLE_MESH_H */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/update1/update1.cpp b/code/nel/tools/pipeline/max/update1/update1.cpp new file mode 100644 index 000000000..d4c923e9d --- /dev/null +++ b/code/nel/tools/pipeline/max/update1/update1.cpp @@ -0,0 +1,81 @@ +/** + * \file update1.cpp + * \brief CUpdate1 + * \date 2012-08-26 12:11GMT + * \author Jan Boon (Kaetemi) + * CUpdate1 + */ + +/* + * 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 "update1.h" + +// STL includes + +// NeL includes +// #include + +// Project includes +#include "../scene_class_registry.h" + +#include "editable_mesh.h" + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { +namespace MAX { +namespace UPDATE1 { + +CUpdate1::CUpdate1() +{ + +} + +CUpdate1::~CUpdate1() +{ + +} + +void CUpdate1::registerClasses(CSceneClassRegistry *registry) +{ + registry->add(&EditableMeshClassDesc); +} + +const ucchar *CDllPluginDescUpdate1::displayName() const +{ + static const ucstring value = ucstring("Editable Mesh Object (Ryzom Core)"); + return value.c_str(); +} + +const ucchar *CDllPluginDescUpdate1::internalName() const +{ + static const ucstring value = ucstring("update1.dlo"); + return value.c_str(); +} + +const CDllPluginDescUpdate1 DllPluginDescUpdate1; + +} /* namespace UPDATE1 */ +} /* namespace MAX */ +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/update1/update1.h b/code/nel/tools/pipeline/max/update1/update1.h new file mode 100644 index 000000000..a3727e982 --- /dev/null +++ b/code/nel/tools/pipeline/max/update1/update1.h @@ -0,0 +1,84 @@ +/** + * \file update1.h + * \brief CUpdate1 + * \date 2012-08-26 12:11GMT + * \author Jan Boon (Kaetemi) + * CUpdate1 + */ + +/* + * 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_UPDATE1_H +#define PIPELINE_UPDATE1_H +#include + +// STL includes + +// NeL includes + +// Project includes +#include "../dll_plugin_desc.h" + +namespace PIPELINE { +namespace MAX { + +class CSceneClassRegistry; + +namespace UPDATE1 { + +/** + * \brief CUpdate1 + * \date 2012-08-26 12:11GMT + * \author Jan Boon (Kaetemi) + * CUpdate1 + */ +class CUpdate1 +{ +public: + static void registerClasses(CSceneClassRegistry *registry); + +public: + CUpdate1(); + virtual ~CUpdate1(); + +}; /* class CUpdate1 */ + +/** + * \brief CDllPluginDescUpdate1 + * \date 2012-08-26 12:03GMT + * \author Jan Boon (Kaetemi) + * CDllPluginDescUpdate1 + */ +class CDllPluginDescUpdate1 : public IDllPluginDescInternal +{ +public: + virtual const ucchar *displayName() const; + virtual const ucchar *internalName() const; +}; /* class CDllPluginDescScript */ + +extern const CDllPluginDescUpdate1 DllPluginDescUpdate1; + +} /* namespace UPDATE1 */ +} /* namespace MAX */ +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_UPDATE1_H */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/wsm_derived_object.cpp b/code/nel/tools/pipeline/max/wsm_derived_object.cpp new file mode 100644 index 000000000..864d3a4f4 --- /dev/null +++ b/code/nel/tools/pipeline/max/wsm_derived_object.cpp @@ -0,0 +1,55 @@ +/** + * \file wsm_derived_object.cpp + * \brief CWSMDerivedObject + * \date 2012-08-26 12:05GMT + * \author Jan Boon (Kaetemi) + * CWSMDerivedObject + */ + +/* + * 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 "wsm_derived_object.h" + +// STL includes + +// NeL includes +// #include + +// Project includes + +using namespace std; +// using namespace NLMISC; + +namespace PIPELINE { + +CWSMDerivedObject::CWSMDerivedObject() +{ + +} + +CWSMDerivedObject::~CWSMDerivedObject() +{ + +} + +} /* namespace PIPELINE */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max/wsm_derived_object.h b/code/nel/tools/pipeline/max/wsm_derived_object.h new file mode 100644 index 000000000..fe0984733 --- /dev/null +++ b/code/nel/tools/pipeline/max/wsm_derived_object.h @@ -0,0 +1,63 @@ +/** + * \file wsm_derived_object.h + * \brief CWSMDerivedObject + * \date 2012-08-26 12:05GMT + * \author Jan Boon (Kaetemi) + * CWSMDerivedObject + */ + +/* + * 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_WSM_DERIVED_OBJECT_H +#define PIPELINE_WSM_DERIVED_OBJECT_H +#include + +// STL includes + +// NeL includes + +// Project includes + +namespace PIPELINE { + +/** + * \brief CWSMDerivedObject + * \date 2012-08-26 12:05GMT + * \author Jan Boon (Kaetemi) + * CWSMDerivedObject + */ +class CWSMDerivedObject +{ +protected: + // pointers + // ... + + // instances + // ... +public: + CWSMDerivedObject(); + virtual ~CWSMDerivedObject(); +}; /* class CWSMDerivedObject */ + +} /* namespace PIPELINE */ + +#endif /* #ifndef PIPELINE_WSM_DERIVED_OBJECT_H */ + +/* end of file */ diff --git a/code/nel/tools/pipeline/max_dump/main.cpp b/code/nel/tools/pipeline/max_dump/main.cpp index d3f353423..afd736c9f 100644 --- a/code/nel/tools/pipeline/max_dump/main.cpp +++ b/code/nel/tools/pipeline/max_dump/main.cpp @@ -30,21 +30,27 @@ #include "../max/scene_class_registry.h" // Testing +#include "../max/builtin/builtin.h" +#include "../max/update1/update1.h" +#include "../max/epoly/epoly.h" + #include "../max/builtin/storage/app_data.h" #include "../max/builtin/storage/geom_buffers.h" -#include "../max/builtin/builtin.h" #include "../max/builtin/scene_impl.h" #include "../max/builtin/i_node.h" using namespace PIPELINE::MAX; using namespace PIPELINE::MAX::BUILTIN; using namespace PIPELINE::MAX::BUILTIN::STORAGE; +using namespace PIPELINE::MAX::UPDATE1; +using namespace PIPELINE::MAX::EPOLY; //static const char *filename = "/srv/work/database/interfaces/anims_max/cp_fy_hof_species.max"; -static const char *filename = "/home/kaetemi/source/minimax/GE_Acc_MikotoBaniere.max"; +//static const char *filename = "/home/kaetemi/source/minimax/GE_Acc_MikotoBaniere.max"; //static const char *filename = "/home/kaetemi/3dsMax/scenes/test2008.max"; //static const char *filename = "/home/kaetemi/3dsMax/scenes/teapot_test_scene.max"; //static const char *filename = "/home/kaetemi/3dsMax/scenes/testplane.max"; +static const char *filename = "/home/kaetemi/3dsMax/scenes/geomobjects.max"; static const char *streamname = "Scene"; void exportObj(const std::string &fileName, const CReferenceMaker *triObject) @@ -71,10 +77,11 @@ int main(int argc, char **argv) g_set_prgname(me); gsf_init(); - - PIPELINE::MAX::CSceneClassRegistry sceneClassRegistry; - PIPELINE::MAX::BUILTIN::CBuiltin::registerClasses(&sceneClassRegistry); - + // Register all plugin classes + CSceneClassRegistry sceneClassRegistry; + CBuiltin::registerClasses(&sceneClassRegistry); + CUpdate1::registerClasses(&sceneClassRegistry); + CEPoly::registerClasses(&sceneClassRegistry); GsfInfile *infile; GError *error = NULL; @@ -192,7 +199,7 @@ int main(int argc, char **argv) nldebug("CLEAN"); //## scene.clean(); // cleanup unused file structure, don't clean up if we want direct access to chunks as well // <- TEST - //## scene.toString(std::cout); + scene.toString(std::cout);//## std::cout << "\n"; //classDirectory3.build(PIPELINE::MAX::VersionUnknown); //classDirectory3.disown();