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

cybelevationgridc.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 1999  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 #ifndef CYBELEVATIONGRID_HC
00026 #define CYBELEVATIONGRID_HC
00027 
00028 #include "oaw/ctk/cybgeometryc.h"
00029 #include "oaw/ctk/cybcolorc.h"
00030 #include "oaw/ctk/cybnormalc.h"
00031 #include "oaw/ctk/cybtexturecoordinatec.h"
00032 #include "oaw/ctk/cybwrlfields.h"
00033 #include "../oawconfig.h"
00034 
00035 OAW_BEGIN_NAMESPACE
00036 
00037 
00038 typedef ArrayC<long> LongArray;
00039 
00040 class CybIsectLineChannelC;
00041 
00042 class OAW_DLLMAPPING CybElevationGridC : public CybGeometryC
00043 {
00044 public:
00045   CybElevationGridC(CybWorldC*);
00046   CybElevationGridC(const CybElevationGridC&);
00047   CybElevationGridC& operator = (const CybElevationGridC&);
00048   ~CybElevationGridC();
00049   virtual void CreateNewCopy(CybNodeC*);
00050   virtual void FinishInit();
00051   virtual long GetFieldEventID(const char*);
00052   virtual long GetFieldDataType(long);
00053   virtual void SetEvent(long,const void*, BaseI*);
00054   virtual int SetNode(CybNodeC*);
00055 
00056   virtual void ToChannelDefault(CybChannelC* pV, long lFlag);
00057   virtual void ToChannelTexture(CybChannelC* pV, long lFlag);
00058   virtual void ToIsectLineChannel(CybIsectLineChannelC* pIsectChan);
00059 protected:
00060   void InitDefault();
00061   virtual void LoadVRML(char*& iter, const char* iterEnd,long& znr);
00062   void SetColor(CybColorC*);
00063   void SetNormal(CybNormalC*);
00064   void SetTextureCoordinate(CybTextureCoordinateC*);
00065   void CalcPoints();
00066   void CalcBSphere();
00067   void CalcTris();
00068   void CreaseAngles();
00069   virtual void ClearArrays();
00070   virtual void EventCascadeEnd();
00071   virtual void PrepareRender();
00072 //private:
00073   ArrayC<VectorC> GetNormalsToVertex(long x, long y);
00074   VectorC CalcCreasedNormalOf(long x,long z, long t,long e);  
00075 protected:
00076   CybColorC* m_pColor;
00077   CybNormalC* m_pNormal;
00078   CybTextureCoordinateC* m_pTextureCoordinate;
00079 
00080   short m_bReCalc;
00081 
00082   MFFloat m_height;
00083   SFBool m_ccw;
00084   SFBool m_colorPerVertex;
00085   SFFloat m_creaseAngle;
00086   SFBool m_normalPerVertex;
00087   SFBool m_solid;
00088   SFInt32 m_xDimension;
00089   SFFloat m_xSpacing;
00090   SFInt32 m_zDimension;
00091   SFFloat m_zSpacing;
00092 
00093   
00094   static char VRMLKeyStrList[][30];
00095   // Vector which holds all the Points of the El.Grid
00096   // this will hopefully speed up BSphere Calculations and 
00097   // Rendering. Since it gets Only updated on new HeightField
00098   ArrayC<SFVec3f> m_vPoints;
00099   ArrayC<float> m_vTris;
00100   ArrayC<float> m_vTriColors;
00101   ArrayC<float> m_vTriNormals;
00102   ArrayC<float> m_vTriTexCoords;
00103   ArrayC<SFVec3f> m_vTriNormals_help;
00104 
00105 };
00106 
00107 OAW_END_NAMESPACE
00108 
00109 
00110 #endif

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