1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
7 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
9 \*---------------------------------------------------------------------------*/
10 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
26 \*---------------------------------------------------------------------------*/
27 /*---------------------------------------------------------------------------*\
35 \*---------------------------------------------------------------------------*/
37 /*****************************************************************************\
38 *****************************************************************************
40 ** This file is automatically generated. **
42 ** Any changes made to this file WILL be lost when it is **
43 ** regenerated, which can become necessary at any time. **
45 ** Do not change this file, changes should be done in the derived **
46 ** class SimpleMaterial!
48 *****************************************************************************
49 \*****************************************************************************/
55 //! access the type of the class
57 OSG::FieldContainerType &SimpleMaterialBase::getClassType(void)
62 //! access the numerical type of the class
64 OSG::UInt32 SimpleMaterialBase::getClassTypeId(void)
70 OSG::UInt16 SimpleMaterialBase::getClassGroupId(void)
72 return _type.getGroupId();
75 /*------------------------------ get -----------------------------------*/
77 //! Get the value of the SimpleMaterial::_sfAmbient field.
80 Color3f &SimpleMaterialBase::editAmbient(void)
82 editSField(AmbientFieldMask);
84 return _sfAmbient.getValue();
87 //! Get the value of the SimpleMaterial::_sfAmbient field.
89 const Color3f &SimpleMaterialBase::getAmbient(void) const
91 return _sfAmbient.getValue();
94 //! Set the value of the SimpleMaterial::_sfAmbient field.
96 void SimpleMaterialBase::setAmbient(const Color3f &value)
98 editSField(AmbientFieldMask);
100 _sfAmbient.setValue(value);
102 //! Get the value of the SimpleMaterial::_sfDiffuse field.
105 Color3f &SimpleMaterialBase::editDiffuse(void)
107 editSField(DiffuseFieldMask);
109 return _sfDiffuse.getValue();
112 //! Get the value of the SimpleMaterial::_sfDiffuse field.
114 const Color3f &SimpleMaterialBase::getDiffuse(void) const
116 return _sfDiffuse.getValue();
119 //! Set the value of the SimpleMaterial::_sfDiffuse field.
121 void SimpleMaterialBase::setDiffuse(const Color3f &value)
123 editSField(DiffuseFieldMask);
125 _sfDiffuse.setValue(value);
127 //! Get the value of the SimpleMaterial::_sfSpecular field.
130 Color3f &SimpleMaterialBase::editSpecular(void)
132 editSField(SpecularFieldMask);
134 return _sfSpecular.getValue();
137 //! Get the value of the SimpleMaterial::_sfSpecular field.
139 const Color3f &SimpleMaterialBase::getSpecular(void) const
141 return _sfSpecular.getValue();
144 //! Set the value of the SimpleMaterial::_sfSpecular field.
146 void SimpleMaterialBase::setSpecular(const Color3f &value)
148 editSField(SpecularFieldMask);
150 _sfSpecular.setValue(value);
152 //! Get the value of the SimpleMaterial::_sfShininess field.
155 Real32 &SimpleMaterialBase::editShininess(void)
157 editSField(ShininessFieldMask);
159 return _sfShininess.getValue();
162 //! Get the value of the SimpleMaterial::_sfShininess field.
164 Real32 SimpleMaterialBase::getShininess(void) const
166 return _sfShininess.getValue();
169 //! Set the value of the SimpleMaterial::_sfShininess field.
171 void SimpleMaterialBase::setShininess(const Real32 value)
173 editSField(ShininessFieldMask);
175 _sfShininess.setValue(value);
177 //! Get the value of the SimpleMaterial::_sfEmission field.
180 Color3f &SimpleMaterialBase::editEmission(void)
182 editSField(EmissionFieldMask);
184 return _sfEmission.getValue();
187 //! Get the value of the SimpleMaterial::_sfEmission field.
189 const Color3f &SimpleMaterialBase::getEmission(void) const
191 return _sfEmission.getValue();
194 //! Set the value of the SimpleMaterial::_sfEmission field.
196 void SimpleMaterialBase::setEmission(const Color3f &value)
198 editSField(EmissionFieldMask);
200 _sfEmission.setValue(value);
202 //! Get the value of the SimpleMaterial::_sfTransparency field.
205 Real32 &SimpleMaterialBase::editTransparency(void)
207 editSField(TransparencyFieldMask);
209 return _sfTransparency.getValue();
212 //! Get the value of the SimpleMaterial::_sfTransparency field.
214 Real32 SimpleMaterialBase::getTransparency(void) const
216 return _sfTransparency.getValue();
219 //! Set the value of the SimpleMaterial::_sfTransparency field.
221 void SimpleMaterialBase::setTransparency(const Real32 value)
223 editSField(TransparencyFieldMask);
225 _sfTransparency.setValue(value);
227 //! Get the value of the SimpleMaterial::_sfLit field.
230 bool &SimpleMaterialBase::editLit(void)
232 editSField(LitFieldMask);
234 return _sfLit.getValue();
237 //! Get the value of the SimpleMaterial::_sfLit field.
239 bool SimpleMaterialBase::getLit(void) const
241 return _sfLit.getValue();
244 //! Set the value of the SimpleMaterial::_sfLit field.
246 void SimpleMaterialBase::setLit(const bool value)
248 editSField(LitFieldMask);
250 _sfLit.setValue(value);
252 //! Get the value of the SimpleMaterial::_sfColorMaterial field.
255 GLenum &SimpleMaterialBase::editColorMaterial(void)
257 editSField(ColorMaterialFieldMask);
259 return _sfColorMaterial.getValue();
262 //! Get the value of the SimpleMaterial::_sfColorMaterial field.
264 const GLenum &SimpleMaterialBase::getColorMaterial(void) const
266 return _sfColorMaterial.getValue();
269 //! Set the value of the SimpleMaterial::_sfColorMaterial field.
271 void SimpleMaterialBase::setColorMaterial(const GLenum &value)
273 editSField(ColorMaterialFieldMask);
275 _sfColorMaterial.setValue(value);
279 #ifdef OSG_MT_CPTR_ASPECT
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);
317 const Char8 *SimpleMaterialBase::getClassname(void)
319 return "SimpleMaterial";
321 OSG_GEN_CONTAINERPTR(SimpleMaterial);