2
Copyright (c) 2008-2009 NetAllied Systems GmbH
4
This file is part of COLLADAFramework.
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
11
#ifndef __COLLADAFW_FORMULANEWPARAM_H__
12
#define __COLLADAFW_FORMULANEWPARAM_H__
14
#include "COLLADAFWPrerequisites.h"
16
#include "COLLADAFWPointerArray.h"
17
#include "COLLADAFWUniqueId.h"
23
/** New param as it appears in formula and kinematics */
27
enum ValueType { VALUETYPE_UNKNOWN, VALUETYPE_FLOAT, VALUETYPE_INT, VALUETYPE_BOOL, VALUETYPE_SIDREF};
30
/** Value type of the new param.*/
40
/** The name of the new param (sid in COLLADA).*/
45
FormulaNewParam(ValueType valueType) : mValueType(valueType){}
48
virtual ~FormulaNewParam(){}
50
/** Returns the value type of the new param.*/
51
ValueType getValueType() const { return mValueType; }
53
/** Sets the value type of the new param.*/
54
void setValueType(ValueType valueType) { mValueType = valueType; }
56
/** Returns the double value of the new param. Type must be VALUETYPE_FLOAT.*/
57
double getDoubleValue() const { return mValue._double; }
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; }
62
/** Returns the int value of the new param. Type must be VALUETYPE_INT.*/
63
int getIntValue() const { return mValue._int; }
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; }
68
/** Returns the bool value of the new param. Type must be VALUETYPE_BOOL.*/
69
bool getBoolValue() const { return mValue._bool; }
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; }
74
/** Returns the name of the new param (sid in COLLADA).*/
75
const String& getName() const { return mName; }
77
/** Returns the name of the new param (sid in COLLADA).*/
78
void setName(const String& name) { mName = name; }
80
FormulaNewParam* clone() const { return FW_NEW FormulaNewParam(*this); }
84
typedef PointerArray<FormulaNewParam> FormulaNewParamPointerArray;
86
} // namespace COLLADAFW
88
#endif // __COLLADAFW_FORMULANEWPARAM_H__