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

« back to all changes in this revision

Viewing changes to COLLADAFramework/include/COLLADAFWFormulaNewParam.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 COLLADAFramework.
 
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 __COLLADAFW_FORMULANEWPARAM_H__
 
12
#define __COLLADAFW_FORMULANEWPARAM_H__
 
13
 
 
14
#include "COLLADAFWPrerequisites.h"
 
15
 
 
16
#include "COLLADAFWPointerArray.h"
 
17
#include "COLLADAFWUniqueId.h"
 
18
 
 
19
 
 
20
namespace COLLADAFW
 
21
{
 
22
 
 
23
    /** New param as it appears in formula and kinematics */
 
24
        class FormulaNewParam   
 
25
        {
 
26
        public:
 
27
                enum ValueType { VALUETYPE_UNKNOWN, VALUETYPE_FLOAT, VALUETYPE_INT, VALUETYPE_BOOL, VALUETYPE_SIDREF};
 
28
        private:
 
29
        
 
30
                /** Value type of the new param.*/
 
31
                ValueType mValueType;
 
32
 
 
33
                union Value
 
34
                {
 
35
                        double _double;
 
36
                        int _int;
 
37
                        bool _bool;
 
38
                } mValue;
 
39
                
 
40
                /** The name of the new param (sid in COLLADA).*/
 
41
                String mName;
 
42
        public:
 
43
 
 
44
        /** Constructor. */
 
45
                FormulaNewParam(ValueType valueType) : mValueType(valueType){}
 
46
 
 
47
        /** Destructor. */
 
48
                virtual ~FormulaNewParam(){}
 
49
 
 
50
                /** Returns the value type of the new param.*/
 
51
                ValueType getValueType() const { return mValueType; }
 
52
 
 
53
                /** Sets the value type of the new param.*/
 
54
                void setValueType(ValueType valueType) { mValueType = valueType; }
 
55
 
 
56
                /** Returns the double value of the new param. Type must be VALUETYPE_FLOAT.*/
 
57
                double getDoubleValue() const { return mValue._double; }
 
58
 
 
59
                /** Sets the double value of the new param. Type will be set to VALUETYPE_FLOAT.*/
 
60
                void setDoubleValue(double doubleValue) { mValue._double = doubleValue; mValueType = VALUETYPE_FLOAT; }
 
61
 
 
62
                /** Returns the int value of the new param. Type must be VALUETYPE_INT.*/
 
63
                int getIntValue() const { return mValue._int; }
 
64
 
 
65
                /** Sets the int value of the new param. Type will be set to VALUETYPE_INT.*/
 
66
                void setIntValue(int intValue) { mValue._int = intValue; mValueType = VALUETYPE_INT; }
 
67
 
 
68
                /** Returns the bool value of the new param. Type must be VALUETYPE_BOOL.*/
 
69
                bool getBoolValue() const { return mValue._bool; }
 
70
 
 
71
                /** Sets the bool value of the new param. Type will be set to VALUETYPE_BOOL.*/
 
72
                void setBoolValue(bool boolValue) { mValue._bool = boolValue; mValueType = VALUETYPE_BOOL; }
 
73
 
 
74
                /** Returns the name of the new param (sid in COLLADA).*/
 
75
                const String& getName() const { return mName; }
 
76
 
 
77
                /** Returns the name of the new param (sid in COLLADA).*/
 
78
                void setName(const String& name) { mName = name; }
 
79
 
 
80
                FormulaNewParam* clone() const { return FW_NEW FormulaNewParam(*this); }
 
81
 
 
82
        };
 
83
 
 
84
        typedef PointerArray<FormulaNewParam> FormulaNewParamPointerArray;
 
85
 
 
86
} // namespace COLLADAFW
 
87
 
 
88
#endif // __COLLADAFW_FORMULANEWPARAM_H__