~ubuntu-branches/ubuntu/wily/opencollada/wily-proposed

« back to all changes in this revision

Viewing changes to dae23ds/include/DAE23dsSceneGraphWriter.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2015-05-14 17:23:27 UTC
  • Revision ID: package-import@ubuntu.com-20150514172327-f862u8envms01fra
Tags: upstream-0.1.0~20140703.ddf8f47+dfsg1
ImportĀ upstreamĀ versionĀ 0.1.0~20140703.ddf8f47+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2009 NetAllied Systems GmbH
 
3
 
 
4
    This file is part of dae23ds.
 
5
        
 
6
    Licensed under the MIT Open Source License, 
 
7
    for details please see LICENSE file or the website
 
8
    http://www.opensource.org/licenses/mit-license.php
 
9
*/
 
10
 
 
11
#ifndef __DAE23DS_SCENEGRAPHWRITER_H__
 
12
#define __DAE23DS_SCENEGRAPHWRITER_H__
 
13
 
 
14
#include "DAE23dsPrerequisites.h"
 
15
#include "DAE23dsSceneGraphBase.h"
 
16
 
 
17
namespace DAE23ds
 
18
{
 
19
 
 
20
        class SceneGraphWriter : public SceneGraphBase 
 
21
        {
 
22
        private:
 
23
                struct NodeInfo
 
24
                {
 
25
                        NodeInfo( COLLADABU::Math::Matrix4 _worldTransformation)
 
26
                                : worldTransformation(_worldTransformation){}
 
27
                        COLLADABU::Math::Matrix4 worldTransformation;
 
28
                };
 
29
 
 
30
                typedef std::stack<NodeInfo> NodeInfoStack;
 
31
 
 
32
 
 
33
        private:
 
34
                Common::Buffer& mBuffer;
 
35
 
 
36
                NodeInfoStack mNodeInfoStack;
 
37
                Writer::UniqueIdNodeMap& mUniqueIdNodeMap;
 
38
 
 
39
                /** The 3ds node id that will be used by the next frame work node.*/
 
40
                short mNext3dsNodeId;
 
41
 
 
42
        public:
 
43
 
 
44
                SceneGraphWriter( Writer* writer3ds, const COLLADAFW::VisualScene* visualScene, const Writer::LibraryNodesList& libraryNodesList );
 
45
 
 
46
                virtual ~SceneGraphWriter();
 
47
 
 
48
                bool write( ChunkLength scenegraphLength );
 
49
 
 
50
 
 
51
        private:
 
52
 
 
53
                /** Disable default copy ctor. */
 
54
                SceneGraphWriter( const SceneGraphWriter& pre );
 
55
 
 
56
                /** Disable default assignment operator. */
 
57
                const SceneGraphWriter& operator= ( const SceneGraphWriter& pre );
 
58
 
 
59
                bool writeNodes(  const COLLADAFW::NodePointerArray& nodesToWriter, short parent3dsNodeId);
 
60
 
 
61
                bool writeNode(const char* objectRefName, ChunkLength objectRefLength, short nodeId, short parent3dsNodeId, const COLLADABU::Math::Matrix4& matrix );
 
62
 
 
63
                bool writeNode(  const COLLADAFW::Node* nodeToWriter, short parent3dsNodeId);
 
64
 
 
65
                void writeInstanceGeometries( const COLLADAFW::InstanceGeometryPointerArray& instanceGeometries, short parent3dsNodeId );
 
66
 
 
67
                void writeInstanceNodes( const COLLADAFW::InstanceNodePointerArray& instanceNodes, short parent3dsNodeIde);
 
68
 
 
69
        };
 
70
 
 
71
} // namespace DAE23ds
 
72
 
 
73
#endif // __DAE23DS_SCENEGRAPHWRITER_H__