Main Page   Class Hierarchy   Compound List   File List   Compound Members  

ViewportController.h

00001 // Mesh Algorithms: a library of algorithms to manipulate 3D meshes
00002 // Copyright (C) 2001 Tim Garthwaite and Jason Reposa
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 #ifndef VIEWPORT_CONTROLLER_H
00018 #define VIEWPORT_CONTROLLER_H
00019 
00020 #define VIEWPORT_CONTROLLER_DEBUG false
00021 
00022 #include "options.h"
00023 #include <vector>
00024 #include <cmath>
00025 #include "Viewport.h"
00026 
00028 
00031 class ViewportController {
00032   std::vector <Viewport> viewportList;
00033   Viewport * currentViewport;
00034   int width;
00035   int height;
00036   std::string filename;
00037   Viewport * remove(Viewport * v);
00038   Viewport * getViewport(int viewportID);
00039   void fixViewportIDs(int viewportID);
00040 
00041  public:
00042   ViewportController(int maxNumViewports, int w, int h);
00043   ~ViewportController();
00044 
00045   void renderScene();
00046   int numViewports();
00047   Scene * getScene(int viewportID);
00048   bool selectCurrentViewport(int x, int y);
00049   bool deleteViewport();
00050   bool createViewport(std::string file = "NONE_SPECIFIED");
00051   bool resizeScene(int Width, int Height);
00052 
00053   std::string getFilename();
00054   int getWidth();
00055   int getHeight();
00056 
00057   bool save();
00058   bool save(std::string file);
00059   bool decimateEvent(GLfloat f, GLint TYPE);
00060 
00061   void reportStatistics();
00062   void resetViewport();
00063   void makeSmooth();
00064   void makeFlat();
00065   void switchViewPoints();
00066   void switchViewEdges();
00067   void switchViewTriangles();
00068   void switchLighting();
00069   void switchNormals();
00070   void switchVertNormals();
00071 
00072   void setCameraControl(int control);
00073 
00074   void decreaseX_Off();
00075   void increaseX_Off();
00076   void decreaseY_Off();
00077   void increaseY_Off();
00078   void decreaseZ_Off();
00079   void increaseZ_Off();
00080 
00081   void mouseX_Rot(float f);
00082   void mouseY_Rot(float f);
00083   void mouseZ_Rot(float f);
00084 
00085   void decreaseX_Rot();
00086   void increaseX_Rot();
00087   void decreaseY_Rot();
00088   void increaseY_Rot();
00089   void decreaseZ_Rot();
00090   void increaseZ_Rot();
00091 };
00092 
00093 #endif
00094 

Generated on Fri Dec 21 00:16:49 2001 for Mesh Decimation by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001