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_PARAM_H__
12 #define __COLLADAFW_PARAM_H__
13 
14 #include "COLLADAFWPrerequisites.h"
15 #include "COLLADAFWValueType.h"
16 
17 
18 namespace COLLADAFW
19 {
20 
21     /**
22      * Declares parametric information for its parent element.
23      * A functional or programmatical format requires a means for users to specify parametric
24      * information. This information represents function parameter (argument) data.
25      * Material shader programs may contain code representing vertex or pixel programs. These
26      * programs require parameters as part of their state information.
27      * The basic declaration of a parameter describes the name, data type, and value data of the
28      * parameter. That parameter name identifies it to the function or program. The parameter type
29      * indicates the encoding of its value. The <param> element contains information of type
30      * xs:string, which is the parameter's actual value.
31      */
32     class Param
33     {
34 
35     private:
36 
37         /**
38          * xs:NCName The text string name of this element. Optional.
39          */
40         String mName;
41 
42         /**
43          * xs:NCName A text string value containing the subidentifier of this element.
44          * This value must be unique within the scope of the parent element. Optional.
45          */
46         String mSid;
47 
48         /**
49          * The type of the value data. This text string must be understood by
50          * the application. Required.
51          */
52         ValueType::ColladaType mType;
53 
54         /**
55          *  xs:NMTOKEN The user-defined meaning of the parameter. Optional.
56          */
57         String mSemantic;
58 
59         /**
60          * Value data of the parameter. The <param> element contains information of
61          * type xs:string, which is the parameter's actual value. The parameter type
62          * indicates the encoding of its value.
63          */
64         //Type mValue;
65 
66     public:
67 
68         /** Constructor. */
69         Param ( const ValueType::ColladaType paramType=ValueType::VALUE_TYPE_UNSPECIFIED )
mType(paramType)70         : mType ( paramType )
71         {}
72 
73         /** Destructor. */
~Param()74         virtual ~Param () {}
75 
76         /**
77          * The text string name of this element. Optional.
78          * @return const String The text string name of this element.
79          */
getName()80         const String getName () const { return mName; }
81 
82         /**
83          * The text string name of this element. Optional.
84          * @param name The text string name of this element.
85          */
setName(const String name)86         void setName ( const String name ) { mName = name; }
87 
88         /**
89          * A text string value containing the subidentifier of this element.
90          * This value must be unique within the scope of the parent element. Optional.
91          * @return const String The subidentifier of this element.
92          */
getSid()93         const String getSid () const { return mSid; }
94 
95         /**
96          * A text string value containing the subidentifier of this element.
97          * This value must be unique within the scope of the parent element. Optional.
98          * @param sid The subidentifier of this element.
99          */
setSid(const String sid)100         void setSid ( const String sid ) { mSid = sid; }
101 
102         /**
103          * The type of the value data. This text string must be understood by
104          * the application. Required.
105          * @return const ValueType::ColladaType The type of the value data.
106          */
getType()107         const ValueType::ColladaType getType () const { return mType; }
108 
109         /**
110          * The type of the value data. This text string must be understood by
111          * the application. Required.
112          * @param type The type of the value data.
113          */
setType(const ValueType::ColladaType type)114         void setType ( const ValueType::ColladaType type ) { mType = type; }
115 
116         /**
117          * The user-defined meaning of the parameter. Optional.
118          * @return const String The semantic of the parameter.
119          */
getSemantic()120         const String getSemantic () const { return mSemantic; }
121 
122         /**
123          * The user-defined meaning of the parameter. Optional.
124          * @param semantic The semantic of the parameter.
125          */
setSemantic(const String semantic)126         void setSemantic ( const String semantic ) { mSemantic = semantic; }
127 
128 //         /**
129 //         * Value data of the parameter. The <param> element contains information of
130 //         * type xs:string, which is the parameter's actual value. The parameter type
131 //         * indicates the encoding of its value.
132 //         */
133 //         template < class Type >
134 //         const Type getValue () const { return mValue; }
135 //
136 //         /**
137 //         * Value data of the parameter. The <param> element contains information of
138 //         * type xs:string, which is the parameter's actual value. The parameter type
139 //         * indicates the encoding of its value.
140 //         */
141 //         template < class Type >
142 //         void setValue ( const Type Value ) { mValue = Value; }
143 
144     };
145 
146 
147     /**
148      * Typedef for the array of parameters.
149      */
150     typedef Param* ParamArray;
151 
152 //    typedef Param < String >* ParamArrayString;
153 //    typedef Param < class Type >* ParamArray;
154 
155 }
156 
157 #endif // __COLLADAFW_PARAM_H__
158