Coin Logo http://www.sim.no
http://www.coin3d.org

SoVRMLElevationGrid.h

00001 /**************************************************************************\
00002  *
00003  *  This file is part of the Coin 3D visualization library.
00004  *  Copyright (C) 1998-2007 by Systems in Motion.  All rights reserved.
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU General Public License
00008  *  ("GPL") version 2 as published by the Free Software Foundation.
00009  *  See the file LICENSE.GPL at the root directory of this source
00010  *  distribution for additional information about the GNU GPL.
00011  *
00012  *  For using Coin with software that can not be combined with the GNU
00013  *  GPL, and for taking advantage of the additional benefits of our
00014  *  support services, please contact Systems in Motion about acquiring
00015  *  a Coin Professional Edition License.
00016  *
00017  *  See http://www.coin3d.org/ for more information.
00018  *
00019  *  Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
00020  *  http://www.sim.no/  sales@sim.no  coin-support@coin3d.org
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 }; // class SoVRMLElevationGrid
00093 
00094 #endif // ! COIN_SOVRMLELEVATIONGRID_H

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Mon Feb 28 2011 10:11:59 for Coin by Doxygen. 1.7.3