00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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