fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Material / Base / OSGSimpleMaterialBase.inl
blob21b7cf98bcfc8dfff9da2fb6e707b9abeda09fe8
1 /*---------------------------------------------------------------------------*\
2  *                                OpenSG                                     *
3  *                                                                           *
4  *                                                                           *
5  *               Copyright (C) 2000-2013 by the OpenSG Forum                 *
6  *                                                                           *
7  * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net  *
8  *                                                                           *
9 \*---------------------------------------------------------------------------*/
10 /*---------------------------------------------------------------------------*\
11  *                                License                                    *
12  *                                                                           *
13  * This library is free software; you can redistribute it and/or modify it   *
14  * under the terms of the GNU Library General Public License as published    *
15  * by the Free Software Foundation, version 2.                               *
16  *                                                                           *
17  * This library is distributed in the hope that it will be useful, but       *
18  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
20  * Library General Public License for more details.                          *
21  *                                                                           *
22  * You should have received a copy of the GNU Library General Public         *
23  * License along with this library; if not, write to the Free Software       *
24  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
25  *                                                                           *
26 \*---------------------------------------------------------------------------*/
27 /*---------------------------------------------------------------------------*\
28  *                                Changes                                    *
29  *                                                                           *
30  *                                                                           *
31  *                                                                           *
32  *                                                                           *
33  *                                                                           *
34  *                                                                           *
35 \*---------------------------------------------------------------------------*/
37 /*****************************************************************************\
38  *****************************************************************************
39  **                                                                         **
40  **                  This file is automatically generated.                  **
41  **                                                                         **
42  **          Any changes made to this file WILL be lost when it is          **
43  **           regenerated, which can become necessary at any time.          **
44  **                                                                         **
45  **     Do not change this file, changes should be done in the derived      **
46  **     class SimpleMaterial!
47  **                                                                         **
48  *****************************************************************************
49 \*****************************************************************************/
51 OSG_BEGIN_NAMESPACE
55 //! access the type of the class
56 inline
57 OSG::FieldContainerType &SimpleMaterialBase::getClassType(void)
59     return _type;
62 //! access the numerical type of the class
63 inline
64 OSG::UInt32 SimpleMaterialBase::getClassTypeId(void)
66     return _type.getId();
69 inline
70 OSG::UInt16 SimpleMaterialBase::getClassGroupId(void)
72     return _type.getGroupId();
75 /*------------------------------ get -----------------------------------*/
77 //! Get the value of the SimpleMaterial::_sfAmbient field.
79 inline
80 Color3f &SimpleMaterialBase::editAmbient(void)
82     editSField(AmbientFieldMask);
84     return _sfAmbient.getValue();
87 //! Get the value of the SimpleMaterial::_sfAmbient field.
88 inline
89 const Color3f &SimpleMaterialBase::getAmbient(void) const
91     return _sfAmbient.getValue();
94 //! Set the value of the SimpleMaterial::_sfAmbient field.
95 inline
96 void SimpleMaterialBase::setAmbient(const Color3f &value)
98     editSField(AmbientFieldMask);
100     _sfAmbient.setValue(value);
102 //! Get the value of the SimpleMaterial::_sfDiffuse field.
104 inline
105 Color3f &SimpleMaterialBase::editDiffuse(void)
107     editSField(DiffuseFieldMask);
109     return _sfDiffuse.getValue();
112 //! Get the value of the SimpleMaterial::_sfDiffuse field.
113 inline
114 const Color3f &SimpleMaterialBase::getDiffuse(void) const
116     return _sfDiffuse.getValue();
119 //! Set the value of the SimpleMaterial::_sfDiffuse field.
120 inline
121 void SimpleMaterialBase::setDiffuse(const Color3f &value)
123     editSField(DiffuseFieldMask);
125     _sfDiffuse.setValue(value);
127 //! Get the value of the SimpleMaterial::_sfSpecular field.
129 inline
130 Color3f &SimpleMaterialBase::editSpecular(void)
132     editSField(SpecularFieldMask);
134     return _sfSpecular.getValue();
137 //! Get the value of the SimpleMaterial::_sfSpecular field.
138 inline
139 const Color3f &SimpleMaterialBase::getSpecular(void) const
141     return _sfSpecular.getValue();
144 //! Set the value of the SimpleMaterial::_sfSpecular field.
145 inline
146 void SimpleMaterialBase::setSpecular(const Color3f &value)
148     editSField(SpecularFieldMask);
150     _sfSpecular.setValue(value);
152 //! Get the value of the SimpleMaterial::_sfShininess field.
154 inline
155 Real32 &SimpleMaterialBase::editShininess(void)
157     editSField(ShininessFieldMask);
159     return _sfShininess.getValue();
162 //! Get the value of the SimpleMaterial::_sfShininess field.
163 inline
164       Real32  SimpleMaterialBase::getShininess(void) const
166     return _sfShininess.getValue();
169 //! Set the value of the SimpleMaterial::_sfShininess field.
170 inline
171 void SimpleMaterialBase::setShininess(const Real32 value)
173     editSField(ShininessFieldMask);
175     _sfShininess.setValue(value);
177 //! Get the value of the SimpleMaterial::_sfEmission field.
179 inline
180 Color3f &SimpleMaterialBase::editEmission(void)
182     editSField(EmissionFieldMask);
184     return _sfEmission.getValue();
187 //! Get the value of the SimpleMaterial::_sfEmission field.
188 inline
189 const Color3f &SimpleMaterialBase::getEmission(void) const
191     return _sfEmission.getValue();
194 //! Set the value of the SimpleMaterial::_sfEmission field.
195 inline
196 void SimpleMaterialBase::setEmission(const Color3f &value)
198     editSField(EmissionFieldMask);
200     _sfEmission.setValue(value);
202 //! Get the value of the SimpleMaterial::_sfTransparency field.
204 inline
205 Real32 &SimpleMaterialBase::editTransparency(void)
207     editSField(TransparencyFieldMask);
209     return _sfTransparency.getValue();
212 //! Get the value of the SimpleMaterial::_sfTransparency field.
213 inline
214       Real32  SimpleMaterialBase::getTransparency(void) const
216     return _sfTransparency.getValue();
219 //! Set the value of the SimpleMaterial::_sfTransparency field.
220 inline
221 void SimpleMaterialBase::setTransparency(const Real32 value)
223     editSField(TransparencyFieldMask);
225     _sfTransparency.setValue(value);
227 //! Get the value of the SimpleMaterial::_sfLit field.
229 inline
230 bool &SimpleMaterialBase::editLit(void)
232     editSField(LitFieldMask);
234     return _sfLit.getValue();
237 //! Get the value of the SimpleMaterial::_sfLit field.
238 inline
239       bool  SimpleMaterialBase::getLit(void) const
241     return _sfLit.getValue();
244 //! Set the value of the SimpleMaterial::_sfLit field.
245 inline
246 void SimpleMaterialBase::setLit(const bool value)
248     editSField(LitFieldMask);
250     _sfLit.setValue(value);
252 //! Get the value of the SimpleMaterial::_sfColorMaterial field.
254 inline
255 GLenum &SimpleMaterialBase::editColorMaterial(void)
257     editSField(ColorMaterialFieldMask);
259     return _sfColorMaterial.getValue();
262 //! Get the value of the SimpleMaterial::_sfColorMaterial field.
263 inline
264 const GLenum &SimpleMaterialBase::getColorMaterial(void) const
266     return _sfColorMaterial.getValue();
269 //! Set the value of the SimpleMaterial::_sfColorMaterial field.
270 inline
271 void SimpleMaterialBase::setColorMaterial(const GLenum &value)
273     editSField(ColorMaterialFieldMask);
275     _sfColorMaterial.setValue(value);
279 #ifdef OSG_MT_CPTR_ASPECT
280 inline
281 void SimpleMaterialBase::execSync (      SimpleMaterialBase *pFrom,
282                                         ConstFieldMaskArg  whichField,
283                                         AspectOffsetStore &oOffsets,
284                                         ConstFieldMaskArg  syncMode,
285                                   const UInt32             uiSyncInfo)
287     Inherited::execSync(pFrom, whichField, oOffsets, syncMode, uiSyncInfo);
289     if(FieldBits::NoField != (AmbientFieldMask & whichField))
290         _sfAmbient.syncWith(pFrom->_sfAmbient);
292     if(FieldBits::NoField != (DiffuseFieldMask & whichField))
293         _sfDiffuse.syncWith(pFrom->_sfDiffuse);
295     if(FieldBits::NoField != (SpecularFieldMask & whichField))
296         _sfSpecular.syncWith(pFrom->_sfSpecular);
298     if(FieldBits::NoField != (ShininessFieldMask & whichField))
299         _sfShininess.syncWith(pFrom->_sfShininess);
301     if(FieldBits::NoField != (EmissionFieldMask & whichField))
302         _sfEmission.syncWith(pFrom->_sfEmission);
304     if(FieldBits::NoField != (TransparencyFieldMask & whichField))
305         _sfTransparency.syncWith(pFrom->_sfTransparency);
307     if(FieldBits::NoField != (LitFieldMask & whichField))
308         _sfLit.syncWith(pFrom->_sfLit);
310     if(FieldBits::NoField != (ColorMaterialFieldMask & whichField))
311         _sfColorMaterial.syncWith(pFrom->_sfColorMaterial);
313 #endif
316 inline
317 const Char8 *SimpleMaterialBase::getClassname(void)
319     return "SimpleMaterial";
321 OSG_GEN_CONTAINERPTR(SimpleMaterial);
323 OSG_END_NAMESPACE