Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGPhongMaterialBase.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *               Copyright (C) 2000-2002 by the OpenSG Forum                 *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 /*****************************************************************************\
00040  *****************************************************************************
00041  **                                                                         **
00042  **                  This file is automatically generated.                  **
00043  **                                                                         **
00044  **          Any changes made to this file WILL be lost when it is          **
00045  **           regenerated, which can become necessary at any time.          **
00046  **                                                                         **
00047  **     Do not change this file, changes should be done in the derived      **
00048  **     class PhongMaterial
00049  **                                                                         **
00050  *****************************************************************************
00051 \*****************************************************************************/
00052 
00053 
00054 #ifndef _OSGPHONGMATERIALBASE_H_
00055 #define _OSGPHONGMATERIALBASE_H_
00056 #ifdef __sgi
00057 #pragma once
00058 #endif
00059 
00060 
00061 #include <OSGConfig.h>
00062 #include <OSGSystemDef.h>
00063 
00064 #include <OSGBaseTypes.h>
00065 #include <OSGRefPtr.h>
00066 #include <OSGCoredNodePtr.h>
00067 
00068 #include <OSGChunkMaterial.h> // Parent
00069 
00070 #include <OSGColor3fFields.h> // Ambient type
00071 #include <OSGColor3fFields.h> // Diffuse type
00072 #include <OSGColor3fFields.h> // Specular type
00073 #include <OSGReal32Fields.h> // Shininess type
00074 #include <OSGColor3fFields.h> // Emission type
00075 #include <OSGReal32Fields.h> // Transparency type
00076 #include <OSGBoolFields.h> // Lit type
00077 #include <OSGGLenumFields.h> // ColorMaterial type
00078 
00079 #include <OSGPhongMaterialFields.h>
00080 
00081 OSG_BEGIN_NAMESPACE
00082 
00083 class PhongMaterial;
00084 class BinaryDataHandler;
00085 
00087 
00088 class OSG_SYSTEMLIB_DLLMAPPING PhongMaterialBase : public ChunkMaterial
00089 {
00090   private:
00091 
00092     typedef ChunkMaterial    Inherited;
00093 
00094     /*==========================  PUBLIC  =================================*/
00095   public:
00096 
00097     typedef PhongMaterialPtr  Ptr;
00098 
00099     enum
00100     {
00101         AmbientFieldId       = Inherited::NextFieldId,
00102         DiffuseFieldId       = AmbientFieldId       + 1,
00103         SpecularFieldId      = DiffuseFieldId       + 1,
00104         ShininessFieldId     = SpecularFieldId      + 1,
00105         EmissionFieldId      = ShininessFieldId     + 1,
00106         TransparencyFieldId  = EmissionFieldId      + 1,
00107         LitFieldId           = TransparencyFieldId  + 1,
00108         ColorMaterialFieldId = LitFieldId           + 1,
00109         NextFieldId          = ColorMaterialFieldId + 1
00110     };
00111 
00112     static const OSG::BitVector AmbientFieldMask;
00113     static const OSG::BitVector DiffuseFieldMask;
00114     static const OSG::BitVector SpecularFieldMask;
00115     static const OSG::BitVector ShininessFieldMask;
00116     static const OSG::BitVector EmissionFieldMask;
00117     static const OSG::BitVector TransparencyFieldMask;
00118     static const OSG::BitVector LitFieldMask;
00119     static const OSG::BitVector ColorMaterialFieldMask;
00120 
00121 
00122     static const OSG::BitVector MTInfluenceMask;
00123 
00124     /*---------------------------------------------------------------------*/
00128     static        FieldContainerType &getClassType    (void); 
00129     static        UInt32              getClassTypeId  (void); 
00130 
00132     /*---------------------------------------------------------------------*/
00136     virtual       FieldContainerType &getType  (void); 
00137     virtual const FieldContainerType &getType  (void) const; 
00138 
00139     virtual       UInt32              getContainerSize(void) const;
00140 
00142     /*---------------------------------------------------------------------*/
00146            SFColor3f           *getSFAmbient        (void);
00147            SFColor3f           *getSFDiffuse        (void);
00148            SFColor3f           *getSFSpecular       (void);
00149            SFReal32            *getSFShininess      (void);
00150            SFColor3f           *getSFEmission       (void);
00151            SFReal32            *getSFTransparency   (void);
00152            SFBool              *getSFLit            (void);
00153            SFGLenum            *getSFColorMaterial  (void);
00154 
00155            Color3f             &getAmbient        (void);
00156      const Color3f             &getAmbient        (void) const;
00157            Color3f             &getDiffuse        (void);
00158      const Color3f             &getDiffuse        (void) const;
00159            Color3f             &getSpecular       (void);
00160      const Color3f             &getSpecular       (void) const;
00161            Real32              &getShininess      (void);
00162      const Real32              &getShininess      (void) const;
00163            Color3f             &getEmission       (void);
00164      const Color3f             &getEmission       (void) const;
00165            Real32              &getTransparency   (void);
00166      const Real32              &getTransparency   (void) const;
00167            bool                &getLit            (void);
00168      const bool                &getLit            (void) const;
00169            GLenum              &getColorMaterial  (void);
00170      const GLenum              &getColorMaterial  (void) const;
00171 
00173     /*---------------------------------------------------------------------*/
00177      void setAmbient        ( const Color3f &value );
00178      void setDiffuse        ( const Color3f &value );
00179      void setSpecular       ( const Color3f &value );
00180      void setShininess      ( const Real32 &value );
00181      void setEmission       ( const Color3f &value );
00182      void setTransparency   ( const Real32 &value );
00183      void setLit            ( const bool &value );
00184      void setColorMaterial  ( const GLenum &value );
00185 
00187     /*---------------------------------------------------------------------*/
00192     /*---------------------------------------------------------------------*/
00196     virtual UInt32 getBinSize (const BitVector         &whichField);
00197     virtual void   copyToBin  (      BinaryDataHandler &pMem,
00198                                const BitVector         &whichField);
00199     virtual void   copyFromBin(      BinaryDataHandler &pMem,
00200                                const BitVector         &whichField);
00201 
00202 
00204     /*---------------------------------------------------------------------*/
00208     static  PhongMaterialPtr      create          (void); 
00209     static  PhongMaterialPtr      createEmpty     (void); 
00210 
00213     /*---------------------------------------------------------------------*/
00217     virtual FieldContainerPtr     shallowCopy     (void) const; 
00218 
00220     /*=========================  PROTECTED  ===============================*/
00221   protected:
00222 
00223     /*---------------------------------------------------------------------*/
00227     SFColor3f           _sfAmbient;
00228     SFColor3f           _sfDiffuse;
00229     SFColor3f           _sfSpecular;
00230     SFReal32            _sfShininess;
00231     SFColor3f           _sfEmission;
00232     SFReal32            _sfTransparency;
00233     SFBool              _sfLit;
00234     SFGLenum            _sfColorMaterial;
00235 
00237     /*---------------------------------------------------------------------*/
00241     PhongMaterialBase(void);
00242     PhongMaterialBase(const PhongMaterialBase &source);
00243 
00245     /*---------------------------------------------------------------------*/
00249     virtual ~PhongMaterialBase(void); 
00250 
00252     /*---------------------------------------------------------------------*/
00256 #if !defined(OSG_FIXED_MFIELDSYNC)
00257     void executeSyncImpl(      PhongMaterialBase *pOther,
00258                          const BitVector         &whichField);
00259 
00260     virtual void   executeSync(      FieldContainer    &other,
00261                                const BitVector         &whichField);
00262 #else
00263     void executeSyncImpl(      PhongMaterialBase *pOther,
00264                          const BitVector         &whichField,
00265                          const SyncInfo          &sInfo     );
00266 
00267     virtual void   executeSync(      FieldContainer    &other,
00268                                const BitVector         &whichField,
00269                                const SyncInfo          &sInfo);
00270 
00271     virtual void execBeginEdit     (const BitVector &whichField,
00272                                           UInt32     uiAspect,
00273                                           UInt32     uiContainerSize);
00274 
00275             void execBeginEditImpl (const BitVector &whichField,
00276                                           UInt32     uiAspect,
00277                                           UInt32     uiContainerSize);
00278 
00279     virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00280 #endif
00281 
00283     /*==========================  PRIVATE  ================================*/
00284   private:
00285 
00286     friend class FieldContainer;
00287 
00288     static FieldDescription   *_desc[];
00289     static FieldContainerType  _type;
00290 
00291 
00292     // prohibit default functions (move to 'public' if you need one)
00293     void operator =(const PhongMaterialBase &source);
00294 };
00295 
00296 //---------------------------------------------------------------------------
00297 //   Exported Types
00298 //---------------------------------------------------------------------------
00299 
00300 
00301 typedef PhongMaterialBase *PhongMaterialBaseP;
00302 
00303 typedef osgIF<PhongMaterialBase::isNodeCore,
00304               CoredNodePtr<PhongMaterial>,
00305               FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00306               >::_IRet PhongMaterialNodePtr;
00307 
00308 typedef RefPtr<PhongMaterialPtr> PhongMaterialRefPtr;
00309 
00310 OSG_END_NAMESPACE
00311 
00312 #define OSGPHONGMATERIALBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.38 2005/07/08 06:37:35 vossg Exp $"
00313 
00314 #endif /* _OSGPHONGMATERIALBASE_H_ */

Generated on Thu Aug 25 04:08:24 2005 for OpenSG by  doxygen 1.4.3