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

« back to all changes in this revision

Viewing changes to COLLADAMax/include/COLLADAMaxGeometriesExporter.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) 2008-2009 NetAllied Systems GmbH
 
3
 
 
4
        This file is part of COLLADAMax.
 
5
 
 
6
    Portions of the code are:
 
7
    Copyright (c) 2005-2007 Feeling Software Inc.
 
8
    Copyright (c) 2005-2007 Sony Computer Entertainment America
 
9
    
 
10
    Based on the 3dsMax COLLADASW Tools:
 
11
    Copyright (c) 2005-2006 Autodesk Media Entertainment
 
12
        
 
13
    Licensed under the MIT Open Source License, 
 
14
    for details please see LICENSE file or the website
 
15
    http://www.opensource.org/licenses/mit-license.php
 
16
*/
 
17
 
 
18
 
 
19
#ifndef __COLLADAMAX_GEOMETRIESEXPORTER_H__
 
20
#define __COLLADAMAX_GEOMETRIESEXPORTER_H__
 
21
 
 
22
#include "COLLADAMaxPrerequisites.h"
 
23
 
 
24
#include "COLLADASWStreamWriter.h"
 
25
#include "COLLADASWLibraryGeometries.h"
 
26
 
 
27
#include "COLLADAMaxDocumentExporter.h"
 
28
 
 
29
namespace COLLADAMax
 
30
{
 
31
 
 
32
    class ExportSceneGraph;
 
33
 
 
34
    class ExportNode;
 
35
 
 
36
    /** Class to exports all nodes in an export scene graph.*/
 
37
 
 
38
    class GeometriesExporter : public COLLADASW::LibraryGeometries
 
39
    {
 
40
 
 
41
        public:
 
42
                /** List of material ids.*/
 
43
                typedef std::vector<size_t> MaterialIDList;
 
44
 
 
45
                /** Maps Objects to material lists.*/
 
46
                typedef std::map<Object*, MaterialIDList> ObjectMaterialIDListMap;
 
47
 
 
48
    private:
 
49
        /** The export scene graph to export.*/
 
50
        ExportSceneGraph * mExportSceneGraph;
 
51
 
 
52
        /** The document exporter used to export the document.*/
 
53
        DocumentExporter * mDocumentExporter;
 
54
 
 
55
        /** Prefix of the symbol names.*/
 
56
        static const String SYMBOL_NAME_PREFIX;
 
57
 
 
58
                /** Maps exported geometry objects to their list of material ids.*/
 
59
                GeometriesExporter::ObjectMaterialIDListMap mExportedObjectMaterialIDListMap;
 
60
 
 
61
    public:
 
62
        /** Constructor
 
63
        @param streamWriter The stream the animation should be written to
 
64
        @param exportSceneGraph The scene graph to export
 
65
        @param documentExporter The document exporter this exporter belongs to
 
66
        */
 
67
        GeometriesExporter ( COLLADASW::StreamWriter * streamWriter, ExportSceneGraph * exportSceneGraph, DocumentExporter * documentExporter );
 
68
 
 
69
        /** Exports all geometries in the export scene graph.*/
 
70
        void doExport();
 
71
 
 
72
                /** Creates an id for the geometry, derived from the node id*/
 
73
                static String getGeometryId(const ExportNode& exportNode);
 
74
 
 
75
    private:
 
76
        GeometriesExporter ( const GeometriesExporter & geometriesExporter );
 
77
        GeometriesExporter &operator= ( const GeometriesExporter & geometriesExporter );
 
78
 
 
79
        friend class GeometryExporter;
 
80
 
 
81
        /** Exports all the geometries in @a node and all its child nodes.*/
 
82
        void doExport ( ExportNode* exportNode );
 
83
 
 
84
                /** Returns the map of exported geometry objects to their list of material ids.*/
 
85
                ObjectMaterialIDListMap& getExportedObjectMaterialIDListMap(){return mExportedObjectMaterialIDListMap;}
 
86
 
 
87
 
 
88
    };
 
89
 
 
90
}
 
91
 
 
92
#endif //__COLLADAMAX_GEOMETRIESEXPORTER_H__
 
93
 
 
94
 
 
95
 
 
96