src/waterplan.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2007 by                                                 *
00003  *         Pierre-yves JEZEQUEL, Julien MICHOT, Loic MOISAN,               *
00004  *         Julien PAPILLON, Sebastien PINEAUD, Barthelemy SERRES           *
00005  *                                                                         *
00006  *   https://sourceforge.net/projects/anidam                               *
00007  *                                                                         *
00008  *   This program is free software; you can redistribute it and/or modify  *
00009  *   it under the terms of the GNU General Public License as published by  *
00010  *   the Free Software Foundation; either version 2 of the License, or     *
00011  *   (at your option) any later version.                                   *
00012  *                                                                         *
00013  *   This program is distributed in the hope that it will be useful,       *
00014  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00015  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00016  *   GNU General Public License for more details.                          *
00017  *                                                                         *
00018  *   You should have received a copy of the GNU General Public License     *
00019  *   along with this program; if not, write to the                         *
00020  *   Free Software Foundation, Inc.,                                       *
00021  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00022  ***************************************************************************/
00023 #ifndef WATERPLAN_H
00024 #define WATERPLAN_H
00025 
00026 #include <iostream>
00027 #include <string>
00028 #include <osg/Node>
00029 #include <osg/Geometry>
00030 #include <osg/Texture2D>
00031 #include <osg/Texture3D>
00032 
00033 #include <osgDB/Registry>
00034 #include <osgDB/ReadFile>
00035 #include <osgProducer/Viewer>
00036 #include <osg/TexGen>
00037 #include <osg/BlendFunc>
00038 
00039 class ConstructStateCallback  ;
00040 
00044 class waterPlan{
00045         private:
00046                 float xMin, xMax, yMin, yMax, z;
00047                 
00049                 float densite_texture;
00050                 std::string texture;
00051                 
00053                 osg::Vec4 deplacement_texture;
00054                 
00055                 
00056                 osg::Geometry* water_geometry;
00057                 osg::Geode* water_geode;
00058                 
00059         public:
00060                 waterPlan();
00061                  ~waterPlan();
00062                  float getZ(){ return z; }
00063                  void setPlan(float xMin,float xMax,float yMin,float yMax,float z);
00064                  void setTexture(std::string tex, float densite);
00065                  void setDeplacementWater(osg::Vec4 depl);
00066                  
00068                  osg::Drawable* createMirrorSurface();
00069                  osg::Drawable* createMirrorSurfaceForTheDam(float x);
00070                  osg::Drawable* createSurfaceBehindForTheDam(float x,float dz);
00071                  osg::Drawable* getOrCreateDrawable();
00073                  osg::StateSet* createMirrorTexturedState();
00075                  osg::Geode* getOrCreateGeodeWater(osg::StateSet* stateset=NULL);
00076                  osg::Geode* createGeodeUnderWater(float x,float dz);
00078                  static ConstructStateCallback* getStateCallback(osg::Node* node1,osg::Node* node2);
00079 };
00080 
00081 #endif

Generated on Tue Jun 5 16:56:49 2007 for Anidam by  doxygen 1.5.1