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

« back to all changes in this revision

Viewing changes to COLLADAStreamWriter/include/COLLADASWAsset.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 COLLADAStreamWriter.
 
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 __COLLADASTREAMWRITER_ASSET_H__
 
12
#define __COLLADASTREAMWRITER_ASSET_H__
 
13
 
 
14
#include "COLLADASWPrerequisites.h"
 
15
#include "COLLADASWElementWriter.h"
 
16
 
 
17
namespace COLLADASW
 
18
{
 
19
 
 
20
 
 
21
    /** A class to add an Asset to the stream*/
 
22
 
 
23
    class Asset : public ElementWriter
 
24
    {
 
25
 
 
26
    public:
 
27
        /** Data related to a contributor that worked on the parent element.*/
 
28
        struct Contributor
 
29
        {
 
30
            String mAuthor;
 
31
            String mAuthoringTool;
 
32
            String mComments;
 
33
            String mCopyright;
 
34
            String mSourceData;
 
35
        };
 
36
 
 
37
        /** Descriptive information about unit of measure. Its optional attributes are:*/
 
38
        struct Unit
 
39
        {
 
40
            /** 
 
41
            * The name of the distance unit to use in the scene. For example, 
 
42
            * "meter", "centimeter", "inches", or "parsec". This can be the 
 
43
            * real name of a measurement, or an imaginary name.
 
44
            */
 
45
            String mName;
 
46
 
 
47
            /** 
 
48
            * The length of one unit with respect to the meter.
 
49
            * For example, 1.0 for the name "meter"; 1000 for the 
 
50
            * name "kilometer"; 0.3048 for the name "foot".
 
51
            */
 
52
            double mMeter;
 
53
        };
 
54
 
 
55
        /*Descriptive information about the coordinate system
 
56
        of the geometric data. All coordinates are right handed
 
57
        by definition. Valid values are X_UP, Y_UP,
 
58
        or Z_UP. This element specifies which axis is
 
59
        considered upward, which is considered to the
 
60
        right, and which is considered inward.*/
 
61
        enum UpAxisType
 
62
        {
 
63
            NONE,
 
64
            X_UP,
 
65
            Y_UP,
 
66
            Z_UP
 
67
        };
 
68
 
 
69
 
 
70
    private:
 
71
 
 
72
        /** Data related to a contributor that worked on the parent element.*/
 
73
        Contributor mContributor;
 
74
 
 
75
        /** A list of words used as search criteria for the parent element.*/
 
76
        String mKeywords;
 
77
 
 
78
        /** Revision information for the parent element.*/
 
79
        String mRevision;
 
80
 
 
81
        /** A description of the topical subject of the parent element.*/
 
82
        String mSubject;
 
83
 
 
84
        /** Title information for the parent element.*/
 
85
        String mTitle;
 
86
 
 
87
        /** Descriptive information about unit of measure. Its optional attributes are:*/
 
88
        Unit mUnit;
 
89
 
 
90
        /* Descriptive information about the coordinate system of the geometric data. 
 
91
        All coordinates are right handed by definition. Valid values are X_UP, Y_UP,
 
92
        or Z_UP. This element specifies which axis is considered upward, which is considered 
 
93
        to the right, and which is considered inward. */
 
94
        UpAxisType mUpAxisType;
 
95
 
 
96
    public:
 
97
        /** Constructor that sets the stream the asset should be written to*/
 
98
        Asset ( StreamWriter * streamWriter );
 
99
 
 
100
        /** Adds the asset to the stream, i.e. performes the actual writing*/
 
101
        void add();
 
102
 
 
103
        /** Returns a reference to the contributor of th asset*/
 
104
        Contributor& getContributor()
 
105
        {
 
106
            return mContributor;
 
107
        }
 
108
 
 
109
        /** Sets the list of words used as search criteria for the parent element.*/
 
110
        void setKeywords ( const String& keywords )
 
111
        {
 
112
            mKeywords = keywords;
 
113
        }
 
114
 
 
115
        /** Returns a reference to the list of words used as search criteria for the parent element.*/
 
116
        const String& getKeywords() const
 
117
        {
 
118
            return mKeywords;
 
119
        }
 
120
 
 
121
 
 
122
        /** Sets the revision information for the parent element.*/
 
123
        void setRevision ( const String& revision )
 
124
        {
 
125
            mRevision = revision;
 
126
        }
 
127
 
 
128
        /** Returns a reference to the revision information for the parent element.*/
 
129
        const String& getRevision() const
 
130
        {
 
131
            return mRevision;
 
132
        }
 
133
 
 
134
        /** Sets the description of the topical subject of the parent element.*/
 
135
        void setSubject ( const String& subject )
 
136
        {
 
137
            mSubject = subject;
 
138
        }
 
139
 
 
140
        /** Returns a reference to the description of the topical subject of the parent element.*/
 
141
        const String& getSubject() const
 
142
        {
 
143
            return mSubject;
 
144
        }
 
145
 
 
146
        /** Sets the title information for the parent element.*/
 
147
        void setTitle ( const String& title )
 
148
        {
 
149
            mTitle = title;
 
150
        }
 
151
 
 
152
        /** Returns a reference to the title information for the parent element.*/
 
153
        const String& getTitle() const
 
154
        {
 
155
            return mTitle;
 
156
        }
 
157
 
 
158
        /** Sets the unit used by the document
 
159
        @param unit The unit to use.
 
160
        */
 
161
        void setUnit ( const Unit& unit )
 
162
        {
 
163
            mUnit = unit;
 
164
        }
 
165
 
 
166
        /** 
 
167
        * Sets the unit used by the document
 
168
        * @param name The name of the unit to use. The name of the distance 
 
169
        *               unit. For example, "meter", "centimeter", "inches", or 
 
170
        *               "parsec". This can be the real name of a measurement, 
 
171
        *               or an imaginary name.
 
172
        * @param meter The length of one unit in meter. 
 
173
        *               For example, 1.0 for the name "meter"; 1000 for the 
 
174
        *               name "kilometer"; 0.3048 for the name "foot".
 
175
        */
 
176
        void setUnit ( const String& name, double meter )
 
177
        {
 
178
            mUnit.mName = name;
 
179
            mUnit.mMeter = meter;
 
180
        }
 
181
 
 
182
        /** Returns the unit*/
 
183
        const Unit& getUnit()
 
184
        {
 
185
            return mUnit;
 
186
        }
 
187
 
 
188
        /** Sets the up axis of the document*/
 
189
        void setUpAxisType ( const UpAxisType& upAxisType )
 
190
        {
 
191
            mUpAxisType = upAxisType;
 
192
        }
 
193
 
 
194
        /** Returns the up axis*/
 
195
        const UpAxisType& getUpAxisType()
 
196
        {
 
197
            return mUpAxisType;
 
198
        }
 
199
 
 
200
 
 
201
    };
 
202
 
 
203
} //namespace COLLADASW
 
204
 
 
205
 
 
206
 
 
207
#endif //__COLLADASTREAMWRITER_ASSET_H__
 
208