Added: #1440 Skeleton for scene parser

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent 444b71ba92
commit 7eb1eb3313

@ -43,7 +43,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CAnimatable::CAnimatable(PIPELINE::MAX::CScene *scene) : CSceneClass(scene), m_AppData(NULL)
CAnimatable::CAnimatable(CScene *scene) : CSceneClass(scene), m_AppData(NULL)
{
}

@ -56,7 +56,7 @@ class CAppData;
class CAnimatable : public CSceneClass
{
public:
CAnimatable(PIPELINE::MAX::CScene *scene);
CAnimatable(CScene *scene);
virtual ~CAnimatable();
// class desc

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CBaseObject::CBaseObject(PIPELINE::MAX::CScene *scene) : CReferenceTarget(scene)
CBaseObject::CBaseObject(CScene *scene) : CReferenceTarget(scene)
{
}

@ -49,7 +49,7 @@ namespace BUILTIN {
class CBaseObject : public CReferenceTarget
{
public:
CBaseObject(PIPELINE::MAX::CScene *scene);
CBaseObject(CScene *scene);
virtual ~CBaseObject();
}; /* class CBaseObject */

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CBitmapTex::CBitmapTex(PIPELINE::MAX::CScene *scene) : CTexmap(scene)
CBitmapTex::CBitmapTex(CScene *scene) : CTexmap(scene)
{
}

@ -49,7 +49,7 @@ namespace BUILTIN {
class CBitmapTex : public CTexmap
{
public:
CBitmapTex(PIPELINE::MAX::CScene *scene);
CBitmapTex(CScene *scene);
virtual ~CBitmapTex();
}; /* class CBitmapTex */

@ -40,6 +40,8 @@
#include "reference_maker.h"
#include "reference_target.h"
#include "scene_impl.h"
#include "i_node.h"
#include "node_impl.h"
@ -218,7 +220,10 @@ void CBuiltin::registerClasses(CSceneClassRegistry *registry)
registry->add(&ReferenceTargetClassDesc);
registry->add(&ReferenceTargetSuperClassDesc);
// node
// scene (inh ReferenceMaker)
registry->add(&SceneImplClassDesc);
// node (inh ReferenceTarget)
registry->add(&NodeSuperClassDesc);
{
registry->add(&NodeClassDesc);

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
INode::INode(PIPELINE::MAX::CScene *scene) : CReferenceTarget(scene)
INode::INode(CScene *scene) : CReferenceTarget(scene)
{
}

@ -49,7 +49,7 @@ namespace BUILTIN {
class INode : public CReferenceTarget
{
public:
INode(PIPELINE::MAX::CScene *scene);
INode(CScene *scene);
virtual ~INode();
// class desc

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CModifier::CModifier(PIPELINE::MAX::CScene *scene) : CBaseObject(scene)
CModifier::CModifier(CScene *scene) : CBaseObject(scene)
{
}

@ -49,7 +49,7 @@ namespace BUILTIN {
class CModifier : public CBaseObject
{
public:
CModifier(PIPELINE::MAX::CScene *scene);
CModifier(CScene *scene);
virtual ~CModifier();
}; /* class CModifier */

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CMtl::CMtl(PIPELINE::MAX::CScene *scene) : CMtlBase(scene)
CMtl::CMtl(CScene *scene) : CMtlBase(scene)
{
}

@ -49,7 +49,7 @@ namespace BUILTIN {
class CMtl : public CMtlBase
{
public:
CMtl(PIPELINE::MAX::CScene *scene);
CMtl(CScene *scene);
virtual ~CMtl();
}; /* class CMtl */

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CMtlBase::CMtlBase(PIPELINE::MAX::CScene *scene) : CReferenceTarget(scene)
CMtlBase::CMtlBase(CScene *scene) : CReferenceTarget(scene)
{
}

@ -49,7 +49,7 @@ namespace BUILTIN {
class CMtlBase : public CReferenceTarget
{
public:
CMtlBase(PIPELINE::MAX::CScene *scene);
CMtlBase(CScene *scene);
virtual ~CMtlBase();
}; /* class CMtlBase */

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CNodeImpl::CNodeImpl(PIPELINE::MAX::CScene *scene) : INode(scene)
CNodeImpl::CNodeImpl(CScene *scene) : INode(scene)
{
}

@ -49,7 +49,7 @@ namespace BUILTIN {
class CNodeImpl : public INode
{
public:
CNodeImpl(PIPELINE::MAX::CScene *scene);
CNodeImpl(CScene *scene);
virtual ~CNodeImpl();
// class desc

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CObject::CObject(PIPELINE::MAX::CScene *scene) : CBaseObject(scene)
CObject::CObject(CScene *scene) : CBaseObject(scene)
{
}

@ -49,7 +49,7 @@ namespace BUILTIN {
class CObject : public CBaseObject
{
public:
CObject(PIPELINE::MAX::CScene *scene);
CObject(CScene *scene);
virtual ~CObject();
}; /* class CObject */

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CParamBlock::CParamBlock(PIPELINE::MAX::CScene *scene) : CReferenceTarget(scene)
CParamBlock::CParamBlock(CScene *scene) : CReferenceTarget(scene)
{
}

@ -49,7 +49,7 @@ namespace BUILTIN {
class CParamBlock : public CReferenceTarget
{
public:
CParamBlock(PIPELINE::MAX::CScene *scene);
CParamBlock(CScene *scene);
virtual ~CParamBlock();
}; /* class CParamBlock */

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CParamBlock2::CParamBlock2(PIPELINE::MAX::CScene *scene) : CReferenceTarget(scene)
CParamBlock2::CParamBlock2(CScene *scene) : CReferenceTarget(scene)
{
}

@ -49,7 +49,7 @@ namespace BUILTIN {
class CParamBlock2 : public CReferenceTarget
{
public:
CParamBlock2(PIPELINE::MAX::CScene *scene);
CParamBlock2(CScene *scene);
virtual ~CParamBlock2();
}; /* class CParamBlock2 */

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CPatchObject::CPatchObject(PIPELINE::MAX::CScene *scene) : CObject(scene)
CPatchObject::CPatchObject(CScene *scene) : CObject(scene)
{
}

@ -49,7 +49,7 @@ namespace BUILTIN {
class CPatchObject : public CObject
{
public:
CPatchObject(PIPELINE::MAX::CScene *scene);
CPatchObject(CScene *scene);
virtual ~CPatchObject();
}; /* class CPatchObject */

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CPolyObject::CPolyObject(PIPELINE::MAX::CScene *scene) : CObject(scene)
CPolyObject::CPolyObject(CScene *scene) : CObject(scene)
{
}

@ -49,7 +49,7 @@ namespace BUILTIN {
class CPolyObject : public CObject
{
public:
CPolyObject(PIPELINE::MAX::CScene *scene);
CPolyObject(CScene *scene);
virtual ~CPolyObject();
}; /* class CPolyObject */

@ -64,7 +64,7 @@ namespace BUILTIN {
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CReferenceMaker::CReferenceMaker(PIPELINE::MAX::CScene *scene) : CAnimatable(scene), m_ReferenceMap(false), m_References2035Value0(0)
CReferenceMaker::CReferenceMaker(CScene *scene) : CAnimatable(scene), m_ReferenceMap(false), m_References2035Value0(0)
{
}

@ -50,7 +50,7 @@ namespace BUILTIN {
class CReferenceMaker : public CAnimatable
{
public:
CReferenceMaker(PIPELINE::MAX::CScene *scene);
CReferenceMaker(CScene *scene);
virtual ~CReferenceMaker();
// class desc

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CReferenceTarget::CReferenceTarget(PIPELINE::MAX::CScene *scene) : CReferenceMaker(scene)
CReferenceTarget::CReferenceTarget(CScene *scene) : CReferenceMaker(scene)
{
}

@ -50,7 +50,7 @@ namespace BUILTIN {
class CReferenceTarget : public CReferenceMaker
{
public:
CReferenceTarget(PIPELINE::MAX::CScene *scene);
CReferenceTarget(CScene *scene);
virtual ~CReferenceTarget();
// class desc

@ -0,0 +1,111 @@
/**
* \file scene_impl.cpp
* \brief CSceneImpl
* \date 2012-08-24 12:33GMT
* \author Jan Boon (Kaetemi)
* CSceneImpl
*/
/*
* 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 "scene_impl.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CSceneImpl::CSceneImpl(CScene *scene) : CReferenceMaker(scene)
{
}
CSceneImpl::~CSceneImpl()
{
}
const ucstring CSceneImpl::DisplayName = ucstring("Scene");
const char *CSceneImpl::InternalName = "SceneImpl";
const NLMISC::CClassId CSceneImpl::ClassId = NLMISC::CClassId(0x00002222, 0x00000000);
const TSClassId CSceneImpl::SuperClassId = CReferenceMaker::SuperClassId;
const CSceneImplClassDesc SceneImplClassDesc(&DllPluginDescBuiltin);
void CSceneImpl::parse(uint16 version, TParseLevel level)
{
CReferenceMaker::parse(version, level);
}
void CSceneImpl::clean()
{
CReferenceMaker::clean();
}
void CSceneImpl::build(uint16 version)
{
CReferenceMaker::build(version);
}
void CSceneImpl::disown()
{
CReferenceMaker::disown();
}
void CSceneImpl::init()
{
CReferenceMaker::init();
}
bool CSceneImpl::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CReferenceMaker::inherits(classId);
}
const ISceneClassDesc *CSceneImpl::classDesc() const
{
return &SceneImplClassDesc;
}
void CSceneImpl::toStringLocal(std::ostream &ostream, const std::string &pad) const
{
CReferenceMaker::toStringLocal(ostream, pad);
}
IStorageObject *CSceneImpl::createChunkById(uint16 id, bool container)
{
return CReferenceMaker::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,86 @@
/**
* \file scene_impl.h
* \brief CSceneImpl
* \date 2012-08-24 12:33GMT
* \author Jan Boon (Kaetemi)
* CSceneImpl
*/
/*
* 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_SCENE_IMPL_H
#define PIPELINE_SCENE_IMPL_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "reference_maker.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CSceneImpl
* \date 2012-08-22 08:53GMT
* \author Jan Boon (Kaetemi)
* Scene implementation
*/
class CSceneImpl : public CReferenceMaker
{
public:
CSceneImpl(CScene *scene);
virtual ~CSceneImpl();
// 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, 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 CSceneImpl */
typedef CSceneClassDesc<CSceneImpl> CSceneImplClassDesc;
extern const CSceneImplClassDesc SceneImplClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_SCENE_IMPL_H */
/* end of file */

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CStdMat::CStdMat(PIPELINE::MAX::CScene *scene) : CMtl(scene)
CStdMat::CStdMat(CScene *scene) : CMtl(scene)
{
}

@ -49,7 +49,7 @@ namespace BUILTIN {
class CStdMat : public CMtl
{
public:
CStdMat(PIPELINE::MAX::CScene *scene);
CStdMat(CScene *scene);
virtual ~CStdMat();
}; /* class CStdMat */

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CStdMat2::CStdMat2(PIPELINE::MAX::CScene *scene) : CStdMat(scene)
CStdMat2::CStdMat2(CScene *scene) : CStdMat(scene)
{
}

@ -55,7 +55,7 @@ protected:
// instances
// ...
public:
CStdMat2(PIPELINE::MAX::CScene *scene);
CStdMat2(CScene *scene);
virtual ~CStdMat2();
}; /* class CStdMat2 */

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CTexmap::CTexmap(PIPELINE::MAX::CScene *scene) : CMtlBase(scene)
CTexmap::CTexmap(CScene *scene) : CMtlBase(scene)
{
}

@ -49,7 +49,7 @@ namespace BUILTIN {
class CTexmap : public CMtlBase
{
public:
CTexmap(PIPELINE::MAX::CScene *scene);
CTexmap(CScene *scene);
virtual ~CTexmap();
}; /* class CTexmap */

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CTriObject::CTriObject(PIPELINE::MAX::CScene *scene) : CObject(scene)
CTriObject::CTriObject(CScene *scene) : CObject(scene)
{
}

@ -50,7 +50,7 @@ class CTriObject : public CObject
{
public:
CTriObject(PIPELINE::MAX::CScene *scene);
CTriObject(CScene *scene);
virtual ~CTriObject();
}; /* class CTriObject */

@ -40,6 +40,7 @@
#include "class_directory_3.h"
#include "scene_class_registry.h"
#include "scene_class_unknown.h"
#include "builtin/scene_impl.h"
using namespace std;
// using namespace NLMISC;
@ -119,7 +120,7 @@ IStorageObject *CScene::createChunkById(uint16 id, bool container)
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CSceneClassContainer::CSceneClassContainer(CScene *scene, const CSceneClassRegistry *sceneClassRegistry, CDllDirectory *dllDirectory, CClassDirectory3 *classDirectory3) : m_Scene(scene), m_SceneClassRegistry(sceneClassRegistry), m_DllDirectory(dllDirectory), m_ClassDirectory3(classDirectory3)
CSceneClassContainer::CSceneClassContainer(CScene *scene, const CSceneClassRegistry *sceneClassRegistry, CDllDirectory *dllDirectory, CClassDirectory3 *classDirectory3) : m_Scene(scene), m_SceneClassRegistry(sceneClassRegistry), m_DllDirectory(dllDirectory), m_ClassDirectory3(classDirectory3), m_BuiltinScene(NULL)
{
}
@ -149,6 +150,10 @@ void CSceneClassContainer::parse(uint16 version, TParseLevel level)
m_StorageObjectByIndex[i] = static_cast<CSceneClass *>(it->second);
++it;
}
CSceneClass *builtinScene = m_StorageObjectByIndex[m_StorageObjectByIndex.size() - 1];
nlassert(builtinScene);
m_BuiltinScene = dynamic_cast<BUILTIN::CSceneImpl *>(builtinScene);
nlassert(m_BuiltinScene);
CStorageContainer::parse(version, level);
}

@ -42,7 +42,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
class CScene;
class CSceneImpl;
}
@ -122,7 +122,7 @@ protected:
public:
/// Return the single instance of the builtin scene class
inline BUILTIN::CScene *scene() { return NULL; }
inline BUILTIN::CSceneImpl *scene() const { return m_BuiltinScene; }
private:
CScene *m_Scene;
@ -134,6 +134,8 @@ private:
std::vector<CSceneClass *> m_StorageObjectByIndex;
std::map<CSceneClass *, uint32> m_StorageObjectToIndex;
BUILTIN::CSceneImpl *m_BuiltinScene;
}; /* class CSceneClassContainer */
} /* namespace MAX */

@ -46,7 +46,7 @@ namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
class CScene;
class CSceneImpl;
}
@ -124,7 +124,7 @@ public:
//! \name Scene utility access
//@{
/// Return the scene scene class
inline BUILTIN::CScene *scene() const { return m_Scene->container()->scene(); }
inline BUILTIN::CSceneImpl *scene() const { return m_Scene->container()->scene(); }
/// Return the scene version
inline uint16 version() const { return m_Scene->version(); }
/// Return the scene container

@ -31,8 +31,8 @@
#include "../max/builtin/storage/app_data.h"
#include "../max/builtin/builtin.h"
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 = "/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/3dsMax/scenes/test2008.max";
//static const char *filename = "/home/kaetemi/3dsMax/scenes/teapot_test_scene.max";
static const char *streamname = "Scene";

Loading…
Cancel
Save