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 MaterialChunk!
48 *****************************************************************************
49 \*****************************************************************************/
55 //! access the type of the class
57 OSG::FieldContainerType &MaterialChunkBase::getClassType(void)
62 //! access the numerical type of the class
64 OSG::UInt32 MaterialChunkBase::getClassTypeId(void)
70 OSG::UInt16 MaterialChunkBase::getClassGroupId(void)
72 return _type.getGroupId();
75 /*------------------------------ get -----------------------------------*/
77 //! Get the value of the MaterialChunk::_sfDiffuse field.
80 Color4f &MaterialChunkBase::editDiffuse(void)
82 editSField(DiffuseFieldMask);
84 return _sfDiffuse.getValue();
87 //! Get the value of the MaterialChunk::_sfDiffuse field.
89 const Color4f &MaterialChunkBase::getDiffuse(void) const
91 return _sfDiffuse.getValue();
94 //! Set the value of the MaterialChunk::_sfDiffuse field.
96 void MaterialChunkBase::setDiffuse(const Color4f &value)
98 editSField(DiffuseFieldMask);
100 _sfDiffuse.setValue(value);
102 //! Get the value of the MaterialChunk::_sfAmbient field.
105 Color4f &MaterialChunkBase::editAmbient(void)
107 editSField(AmbientFieldMask);
109 return _sfAmbient.getValue();
112 //! Get the value of the MaterialChunk::_sfAmbient field.
114 const Color4f &MaterialChunkBase::getAmbient(void) const
116 return _sfAmbient.getValue();
119 //! Set the value of the MaterialChunk::_sfAmbient field.
121 void MaterialChunkBase::setAmbient(const Color4f &value)
123 editSField(AmbientFieldMask);
125 _sfAmbient.setValue(value);
127 //! Get the value of the MaterialChunk::_sfSpecular field.
130 Color4f &MaterialChunkBase::editSpecular(void)
132 editSField(SpecularFieldMask);
134 return _sfSpecular.getValue();
137 //! Get the value of the MaterialChunk::_sfSpecular field.
139 const Color4f &MaterialChunkBase::getSpecular(void) const
141 return _sfSpecular.getValue();
144 //! Set the value of the MaterialChunk::_sfSpecular field.
146 void MaterialChunkBase::setSpecular(const Color4f &value)
148 editSField(SpecularFieldMask);
150 _sfSpecular.setValue(value);
152 //! Get the value of the MaterialChunk::_sfEmission field.
155 Color4f &MaterialChunkBase::editEmission(void)
157 editSField(EmissionFieldMask);
159 return _sfEmission.getValue();
162 //! Get the value of the MaterialChunk::_sfEmission field.
164 const Color4f &MaterialChunkBase::getEmission(void) const
166 return _sfEmission.getValue();
169 //! Set the value of the MaterialChunk::_sfEmission field.
171 void MaterialChunkBase::setEmission(const Color4f &value)
173 editSField(EmissionFieldMask);
175 _sfEmission.setValue(value);
177 //! Get the value of the MaterialChunk::_sfShininess field.
180 Real32 &MaterialChunkBase::editShininess(void)
182 editSField(ShininessFieldMask);
184 return _sfShininess.getValue();
187 //! Get the value of the MaterialChunk::_sfShininess field.
189 Real32 MaterialChunkBase::getShininess(void) const
191 return _sfShininess.getValue();
194 //! Set the value of the MaterialChunk::_sfShininess field.
196 void MaterialChunkBase::setShininess(const Real32 value)
198 editSField(ShininessFieldMask);
200 _sfShininess.setValue(value);
202 //! Get the value of the MaterialChunk::_sfLit field.
205 bool &MaterialChunkBase::editLit(void)
207 editSField(LitFieldMask);
209 return _sfLit.getValue();
212 //! Get the value of the MaterialChunk::_sfLit field.
214 bool MaterialChunkBase::getLit(void) const
216 return _sfLit.getValue();
219 //! Set the value of the MaterialChunk::_sfLit field.
221 void MaterialChunkBase::setLit(const bool value)
223 editSField(LitFieldMask);
225 _sfLit.setValue(value);
227 //! Get the value of the MaterialChunk::_sfColorMaterial field.
230 GLenum &MaterialChunkBase::editColorMaterial(void)
232 editSField(ColorMaterialFieldMask);
234 return _sfColorMaterial.getValue();
237 //! Get the value of the MaterialChunk::_sfColorMaterial field.
239 const GLenum &MaterialChunkBase::getColorMaterial(void) const
241 return _sfColorMaterial.getValue();
244 //! Set the value of the MaterialChunk::_sfColorMaterial field.
246 void MaterialChunkBase::setColorMaterial(const GLenum &value)
248 editSField(ColorMaterialFieldMask);
250 _sfColorMaterial.setValue(value);
252 //! Get the value of the MaterialChunk::_sfBackMaterial field.
255 bool &MaterialChunkBase::editBackMaterial(void)
257 editSField(BackMaterialFieldMask);
259 return _sfBackMaterial.getValue();
262 //! Get the value of the MaterialChunk::_sfBackMaterial field.
264 bool MaterialChunkBase::getBackMaterial(void) const
266 return _sfBackMaterial.getValue();
269 //! Set the value of the MaterialChunk::_sfBackMaterial field.
271 void MaterialChunkBase::setBackMaterial(const bool value)
273 editSField(BackMaterialFieldMask);
275 _sfBackMaterial.setValue(value);
277 //! Get the value of the MaterialChunk::_sfBackDiffuse field.
280 Color4f &MaterialChunkBase::editBackDiffuse(void)
282 editSField(BackDiffuseFieldMask);
284 return _sfBackDiffuse.getValue();
287 //! Get the value of the MaterialChunk::_sfBackDiffuse field.
289 const Color4f &MaterialChunkBase::getBackDiffuse(void) const
291 return _sfBackDiffuse.getValue();
294 //! Set the value of the MaterialChunk::_sfBackDiffuse field.
296 void MaterialChunkBase::setBackDiffuse(const Color4f &value)
298 editSField(BackDiffuseFieldMask);
300 _sfBackDiffuse.setValue(value);
302 //! Get the value of the MaterialChunk::_sfBackAmbient field.
305 Color4f &MaterialChunkBase::editBackAmbient(void)
307 editSField(BackAmbientFieldMask);
309 return _sfBackAmbient.getValue();
312 //! Get the value of the MaterialChunk::_sfBackAmbient field.
314 const Color4f &MaterialChunkBase::getBackAmbient(void) const
316 return _sfBackAmbient.getValue();
319 //! Set the value of the MaterialChunk::_sfBackAmbient field.
321 void MaterialChunkBase::setBackAmbient(const Color4f &value)
323 editSField(BackAmbientFieldMask);
325 _sfBackAmbient.setValue(value);
327 //! Get the value of the MaterialChunk::_sfBackSpecular field.
330 Color4f &MaterialChunkBase::editBackSpecular(void)
332 editSField(BackSpecularFieldMask);
334 return _sfBackSpecular.getValue();
337 //! Get the value of the MaterialChunk::_sfBackSpecular field.
339 const Color4f &MaterialChunkBase::getBackSpecular(void) const
341 return _sfBackSpecular.getValue();
344 //! Set the value of the MaterialChunk::_sfBackSpecular field.
346 void MaterialChunkBase::setBackSpecular(const Color4f &value)
348 editSField(BackSpecularFieldMask);
350 _sfBackSpecular.setValue(value);
352 //! Get the value of the MaterialChunk::_sfBackEmission field.
355 Color4f &MaterialChunkBase::editBackEmission(void)
357 editSField(BackEmissionFieldMask);
359 return _sfBackEmission.getValue();
362 //! Get the value of the MaterialChunk::_sfBackEmission field.
364 const Color4f &MaterialChunkBase::getBackEmission(void) const
366 return _sfBackEmission.getValue();
369 //! Set the value of the MaterialChunk::_sfBackEmission field.
371 void MaterialChunkBase::setBackEmission(const Color4f &value)
373 editSField(BackEmissionFieldMask);
375 _sfBackEmission.setValue(value);
377 //! Get the value of the MaterialChunk::_sfBackShininess field.
380 Real32 &MaterialChunkBase::editBackShininess(void)
382 editSField(BackShininessFieldMask);
384 return _sfBackShininess.getValue();
387 //! Get the value of the MaterialChunk::_sfBackShininess field.
389 Real32 MaterialChunkBase::getBackShininess(void) const
391 return _sfBackShininess.getValue();
394 //! Set the value of the MaterialChunk::_sfBackShininess field.
396 void MaterialChunkBase::setBackShininess(const Real32 value)
398 editSField(BackShininessFieldMask);
400 _sfBackShininess.setValue(value);
402 //! Get the value of the MaterialChunk::_sfBackColorMaterial field.
405 GLenum &MaterialChunkBase::editBackColorMaterial(void)
407 editSField(BackColorMaterialFieldMask);
409 return _sfBackColorMaterial.getValue();
412 //! Get the value of the MaterialChunk::_sfBackColorMaterial field.
414 const GLenum &MaterialChunkBase::getBackColorMaterial(void) const
416 return _sfBackColorMaterial.getValue();
419 //! Set the value of the MaterialChunk::_sfBackColorMaterial field.
421 void MaterialChunkBase::setBackColorMaterial(const GLenum &value)
423 editSField(BackColorMaterialFieldMask);
425 _sfBackColorMaterial.setValue(value);
429 #ifdef OSG_MT_CPTR_ASPECT
431 void MaterialChunkBase::execSync ( MaterialChunkBase *pFrom,
432 ConstFieldMaskArg whichField,
433 AspectOffsetStore &oOffsets,
434 ConstFieldMaskArg syncMode,
435 const UInt32 uiSyncInfo)
437 Inherited::execSync(pFrom, whichField, oOffsets, syncMode, uiSyncInfo);
439 if(FieldBits::NoField != (DiffuseFieldMask & whichField))
440 _sfDiffuse.syncWith(pFrom->_sfDiffuse);
442 if(FieldBits::NoField != (AmbientFieldMask & whichField))
443 _sfAmbient.syncWith(pFrom->_sfAmbient);
445 if(FieldBits::NoField != (SpecularFieldMask & whichField))
446 _sfSpecular.syncWith(pFrom->_sfSpecular);
448 if(FieldBits::NoField != (EmissionFieldMask & whichField))
449 _sfEmission.syncWith(pFrom->_sfEmission);
451 if(FieldBits::NoField != (ShininessFieldMask & whichField))
452 _sfShininess.syncWith(pFrom->_sfShininess);
454 if(FieldBits::NoField != (LitFieldMask & whichField))
455 _sfLit.syncWith(pFrom->_sfLit);
457 if(FieldBits::NoField != (ColorMaterialFieldMask & whichField))
458 _sfColorMaterial.syncWith(pFrom->_sfColorMaterial);
460 if(FieldBits::NoField != (BackMaterialFieldMask & whichField))
461 _sfBackMaterial.syncWith(pFrom->_sfBackMaterial);
463 if(FieldBits::NoField != (BackDiffuseFieldMask & whichField))
464 _sfBackDiffuse.syncWith(pFrom->_sfBackDiffuse);
466 if(FieldBits::NoField != (BackAmbientFieldMask & whichField))
467 _sfBackAmbient.syncWith(pFrom->_sfBackAmbient);
469 if(FieldBits::NoField != (BackSpecularFieldMask & whichField))
470 _sfBackSpecular.syncWith(pFrom->_sfBackSpecular);
472 if(FieldBits::NoField != (BackEmissionFieldMask & whichField))
473 _sfBackEmission.syncWith(pFrom->_sfBackEmission);
475 if(FieldBits::NoField != (BackShininessFieldMask & whichField))
476 _sfBackShininess.syncWith(pFrom->_sfBackShininess);
478 if(FieldBits::NoField != (BackColorMaterialFieldMask & whichField))
479 _sfBackColorMaterial.syncWith(pFrom->_sfBackColorMaterial);
485 const Char8 *MaterialChunkBase::getClassname(void)
487 return "MaterialChunk";
489 OSG_GEN_CONTAINERPTR(MaterialChunk);