Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

cybcolorc.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 1999-2003  Carsten Winkelholz
00003 
00004 Address:  FGAN Forschungsgesellschaft fr Angewandte Naturwissenschaften e. V.
00005       Neuenahrer Str. 20
00006       D - 53343 Wachtberg
00007       
00008 Email:    winkelholz@fgan.de
00009 
00010 This program is free software; you can redistribute it and/or
00011 modify it under the terms of the GNU General Public License
00012 as published by the Free Software Foundation; either version 2
00013 of the License, or (at your option) any later version.
00014 
00015 This program is distributed in the hope that it will be useful,
00016 but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 GNU General Public License for more details.
00019 
00020 You should have received a copy of the GNU General Public License
00021 along with this program; if not, write to the Free Software
00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00023 */
00024 
00025 
00026 #ifndef CYBCOLOR_HC
00027 #define CYBCOLOR_HC
00028 
00029 #include "oaw/ctk/cybnodec.h"
00030 #include "oaw/misc/arrayc.h"
00031 #include "../oawconfig.h"
00032 
00033 OAW_BEGIN_NAMESPACE
00034 
00035 
00036 
00037 class OAW_DLLMAPPING SFColor{
00038 public:
00039   SFColor(){m_r=m_g=m_b=0;m_a=1;}
00040   SFColor(float r, float g, float b){m_r=r;m_g=g;m_b=b;m_a=1;}
00041   inline float& operator [](long i){return ((float*)this)[i];} 
00042   void Set(float rr, float gg, float bb){m_r=rr;m_g=gg;m_b=bb;}
00043   int operator == (const SFColor& v);
00044   int operator != (const SFColor& v);
00045   SFColor operator  - (const SFColor&);
00046   SFColor operator  + (const SFColor&);
00047   float m_r,m_g,m_b,m_a;  
00048 };
00049 
00050 OAW_DLLMAPPING SFColor operator * (const float&,const SFColor&);
00051 
00052 typedef ArrayC<SFColor> MFColor;
00053 
00054 class OAW_DLLMAPPING CybColorC : public CybNodeC
00055 {
00056 public:
00057   CybColorC(CybWorldC*);
00058   virtual ~CybColorC();
00059   CybColorC(float**,long,CybWorldC*);
00060   CybColorC(const CybColorC&);
00061   CybColorC& operator = (const CybColorC&);  
00062   inline float* GetColor_fv(long i){return m_color+4*i;}
00063   long GetLength(){return m_length/4;}
00064   virtual void LoadVRML(char*& iter, const char* iterEnd, long& znr);  
00065   virtual void EventCascadeEnd();
00066 
00067   virtual void SetEvent(long,const void*, BaseI*);
00068   virtual long BufEvent(long,const void*, BaseI*);
00069   virtual long GetEventBufMaxDataSize();
00070   virtual long GetEventBufMinDataSize();
00071   virtual short CopyEventBuf(AnyC&,long);
00072   virtual short SetEventBuf(AnyC&, BaseI*);
00073 protected:
00074   virtual void CreateNewCopy(CybNodeC*);
00075 protected:
00076   long m_length;
00077   float* m_color;
00078   long m_lengthBuf;
00079   float* m_colorBuf;
00080   short m_updateFlag;
00081   long m_copyEventBufState;
00082 };
00083 
00084 OAW_END_NAMESPACE
00085 
00086 #endif
00087 
00088 
00089 
00090 
00091 
00092 

Generated on Tue Jul 29 14:24:09 2003 for Open ActiveWrl by doxygen1.3-rc2