00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef COIN_SOVRMLELEVATIONGRID_H
00025 #define COIN_SOVRMLELEVATIONGRID_H
00026
00027 #include <Inventor/nodes/SoSubNode.h>
00028 #include <Inventor/VRMLnodes/SoVRMLGeometry.h>
00029 #include <Inventor/fields/SoSFBool.h>
00030 #include <Inventor/fields/SoSFFloat.h>
00031 #include <Inventor/fields/SoSFInt32.h>
00032 #include <Inventor/fields/SoSFBool.h>
00033 #include <Inventor/fields/SoSFFloat.h>
00034 #include <Inventor/fields/SoMFFloat.h>
00035 #include <Inventor/fields/SoSFNode.h>
00036
00037 class SoChildList;
00038
00039 class SoVRMLElevationGridP;
00040
00041 class COIN_DLL_API SoVRMLElevationGrid : public SoVRMLGeometry
00042 {
00043 typedef SoVRMLGeometry inherited;
00044 SO_NODE_HEADER(SoVRMLElevationGrid);
00045
00046 public:
00047 static void initClass(void);
00048 SoVRMLElevationGrid(void);
00049
00050 SoSFBool ccw;
00051 SoSFBool solid;
00052 SoSFFloat creaseAngle;
00053 SoSFInt32 zDimension;
00054 SoSFInt32 xDimension;
00055 SoSFFloat zSpacing;
00056 SoSFFloat xSpacing;
00057 SoMFFloat height;
00058 SoSFNode texCoord;
00059 SoSFNode normal;
00060 SoSFNode color;
00061 SoSFBool colorPerVertex;
00062 SoSFBool normalPerVertex;
00063
00064 virtual void GLRender(SoGLRenderAction * action);
00065 virtual void rayPick(SoRayPickAction * action);
00066 virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
00067
00068 protected:
00069 virtual ~SoVRMLElevationGrid(void);
00070
00071 virtual void notify(SoNotList * list);
00072 virtual void generatePrimitives( SoAction * action );
00073 virtual void computeBBox(SoAction * action, SbBox3f & bbox,
00074 SbVec3f & center);
00075
00076 private:
00077 friend class SoVRMLElevationGridP;
00078
00079 enum Binding {
00080 OVERALL,
00081 PER_QUAD,
00082 PER_VERTEX
00083 };
00084
00085 Binding findMaterialBinding(void) const;
00086 Binding findNormalBinding(void) const;
00087
00088 const SbVec3f * updateNormalCache(Binding & nbind);
00089
00090 SoVRMLElevationGridP * pimpl;
00091
00092 };
00093
00094 #endif // ! COIN_SOVRMLELEVATIONGRID_H