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

OSGLightBase.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 Light
00049  **                                                                         **
00050  *****************************************************************************
00051 \*****************************************************************************/
00052 
00053 
00054 #ifndef _OSGLIGHTBASE_H_
00055 #define _OSGLIGHTBASE_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 <OSGNodeCore.h> // Parent
00069 
00070 #include <OSGColor4fFields.h> // Ambient type
00071 #include <OSGColor4fFields.h> // Diffuse type
00072 #include <OSGColor4fFields.h> // Specular type
00073 #include <OSGNodeFields.h> // Beacon type
00074 #include <OSGBoolFields.h> // On type
00075 #include <OSGReal32Fields.h> // ConstantAttenuation type
00076 #include <OSGReal32Fields.h> // LinearAttenuation type
00077 #include <OSGReal32Fields.h> // QuadraticAttenuation type
00078 
00079 #include <OSGLightFields.h>
00080 
00081 OSG_BEGIN_NAMESPACE
00082 
00083 class Light;
00084 class BinaryDataHandler;
00085 
00087 
00088 class OSG_SYSTEMLIB_DLLMAPPING LightBase : public NodeCore
00089 {
00090   private:
00091 
00092     typedef NodeCore    Inherited;
00093 
00094     /*==========================  PUBLIC  =================================*/
00095   public:
00096 
00097     typedef LightPtr  Ptr;
00098 
00099     enum
00100     {
00101         AmbientFieldId              = Inherited::NextFieldId,
00102         DiffuseFieldId              = AmbientFieldId              + 1,
00103         SpecularFieldId             = DiffuseFieldId              + 1,
00104         BeaconFieldId               = SpecularFieldId             + 1,
00105         OnFieldId                   = BeaconFieldId               + 1,
00106         ConstantAttenuationFieldId  = OnFieldId                   + 1,
00107         LinearAttenuationFieldId    = ConstantAttenuationFieldId  + 1,
00108         QuadraticAttenuationFieldId = LinearAttenuationFieldId    + 1,
00109         NextFieldId                 = QuadraticAttenuationFieldId + 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 BeaconFieldMask;
00116     static const OSG::BitVector OnFieldMask;
00117     static const OSG::BitVector ConstantAttenuationFieldMask;
00118     static const OSG::BitVector LinearAttenuationFieldMask;
00119     static const OSG::BitVector QuadraticAttenuationFieldMask;
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            SFColor4f           *getSFAmbient        (void);
00147            SFColor4f           *getSFDiffuse        (void);
00148            SFColor4f           *getSFSpecular       (void);
00149            SFNodePtr           *getSFBeacon         (void);
00150            SFBool              *getSFOn             (void);
00151            SFReal32            *getSFConstantAttenuation(void);
00152            SFReal32            *getSFLinearAttenuation(void);
00153            SFReal32            *getSFQuadraticAttenuation(void);
00154 
00155            Color4f             &getAmbient        (void);
00156      const Color4f             &getAmbient        (void) const;
00157            Color4f             &getDiffuse        (void);
00158      const Color4f             &getDiffuse        (void) const;
00159            Color4f             &getSpecular       (void);
00160      const Color4f             &getSpecular       (void) const;
00161            NodePtr             &getBeacon         (void);
00162      const NodePtr             &getBeacon         (void) const;
00163            bool                &getOn             (void);
00164      const bool                &getOn             (void) const;
00165            Real32              &getConstantAttenuation(void);
00166      const Real32              &getConstantAttenuation(void) const;
00167            Real32              &getLinearAttenuation(void);
00168      const Real32              &getLinearAttenuation(void) const;
00169            Real32              &getQuadraticAttenuation(void);
00170      const Real32              &getQuadraticAttenuation(void) const;
00171 
00173     /*---------------------------------------------------------------------*/
00177      void setAmbient        ( const Color4f &value );
00178      void setDiffuse        ( const Color4f &value );
00179      void setSpecular       ( const Color4f &value );
00180      void setBeacon         ( const NodePtr &value );
00181      void setOn             ( const bool &value );
00182      void setConstantAttenuation( const Real32 &value );
00183      void setLinearAttenuation( const Real32 &value );
00184      void setQuadraticAttenuation( const Real32 &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     /*=========================  PROTECTED  ===============================*/
00205   protected:
00206 
00207     /*---------------------------------------------------------------------*/
00211     SFColor4f           _sfAmbient;
00212     SFColor4f           _sfDiffuse;
00213     SFColor4f           _sfSpecular;
00214     SFNodePtr           _sfBeacon;
00215     SFBool              _sfOn;
00216     SFReal32            _sfConstantAttenuation;
00217     SFReal32            _sfLinearAttenuation;
00218     SFReal32            _sfQuadraticAttenuation;
00219 
00221     /*---------------------------------------------------------------------*/
00225     LightBase(void);
00226     LightBase(const LightBase &source);
00227 
00229     /*---------------------------------------------------------------------*/
00233     virtual ~LightBase(void); 
00234 
00236     /*---------------------------------------------------------------------*/
00240 #if !defined(OSG_FIXED_MFIELDSYNC)
00241     void executeSyncImpl(      LightBase *pOther,
00242                          const BitVector         &whichField);
00243 
00244     virtual void   executeSync(      FieldContainer    &other,
00245                                const BitVector         &whichField);
00246 #else
00247     void executeSyncImpl(      LightBase *pOther,
00248                          const BitVector         &whichField,
00249                          const SyncInfo          &sInfo     );
00250 
00251     virtual void   executeSync(      FieldContainer    &other,
00252                                const BitVector         &whichField,
00253                                const SyncInfo          &sInfo);
00254 
00255     virtual void execBeginEdit     (const BitVector &whichField,
00256                                           UInt32     uiAspect,
00257                                           UInt32     uiContainerSize);
00258 
00259             void execBeginEditImpl (const BitVector &whichField,
00260                                           UInt32     uiAspect,
00261                                           UInt32     uiContainerSize);
00262 
00263     virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00264 #endif
00265 
00267     /*==========================  PRIVATE  ================================*/
00268   private:
00269 
00270     friend class FieldContainer;
00271 
00272     static FieldDescription   *_desc[];
00273     static FieldContainerType  _type;
00274 
00275 
00276     // prohibit default functions (move to 'public' if you need one)
00277     void operator =(const LightBase &source);
00278 };
00279 
00280 //---------------------------------------------------------------------------
00281 //   Exported Types
00282 //---------------------------------------------------------------------------
00283 
00284 
00285 typedef LightBase *LightBaseP;
00286 
00287 typedef osgIF<LightBase::isNodeCore,
00288               CoredNodePtr<Light>,
00289               FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00290               >::_IRet LightNodePtr;
00291 
00292 typedef RefPtr<LightPtr> LightRefPtr;
00293 
00294 OSG_END_NAMESPACE
00295 
00296 #define OSGLIGHTBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.38 2005/07/08 06:37:35 vossg Exp $"
00297 
00298 #endif /* _OSGLIGHTBASE_H_ */

Generated on Thu Aug 25 04:06:48 2005 for OpenSG by  doxygen 1.4.3