surface_param_drawable.hpp

Go to the documentation of this file.
00001 /*
00002 **    TP 4ETI CPE Lyon
00003 **    Copyright (C) 2012 Damien Rohmer
00004 **
00005 **    This program is free software: you can redistribute it and/or modify
00006 **    it under the terms of the GNU General Public License as published by
00007 **    the Free Software Foundation, either version 3 of the License, or
00008 **    (at your option) any later version.
00009 **
00010 **   This program is distributed in the hope that it will be useful,
00011 **    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 **    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 **    GNU General Public License for more details.
00014 **
00015 **    You should have received a copy of the GNU General Public License
00016 **    along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 
00020 #ifndef _SURFACE_PARAM_DRAWABLE_HPP_
00021 #define _SURFACE_PARAM_DRAWABLE_HPP_
00022 
00023 #include <surface_param.hpp>
00024 #include <v3.hpp>
00025 #include <quad_index.hpp>
00026 
00027 namespace cpe
00028 {
00029 
00030 
00031 
00033 class surface_param_drawable : public surface_param
00034 {
00035     public:
00036 
00037         // ********************************************* //
00038         // ********************************************* //
00039         //  CONSTRUCTORS
00040         // ********************************************* //
00041         // ********************************************* //
00042 
00044         surface_param_drawable();
00046         surface_param_drawable(const unsigned int& Nu,const unsigned int& Nv);
00047 
00048         // ********************************************* //
00049         // ********************************************* //
00050         //  Update drawing parameters
00051         // ********************************************* //
00052         // ********************************************* //
00053 
00055         void update_connectivity();
00057         void update_normal();
00058 
00060         void set_normal(const unsigned int ku,const unsigned int kv,const cpe::v3 n);
00061 
00062 
00063         // ********************************************* //
00064         // ********************************************* //
00065         //  Get drawing pointers
00066         // ********************************************* //
00067         // ********************************************* //
00068 
00070         const unsigned int* pointer_draw_connectivity() const;
00072         const double* pointer_draw_normal() const;
00074         const double* pointer_draw_vertices() const;
00075 
00076 
00077 
00078 
00079 
00080     private:
00081 
00083         void build_connectivity();
00084 
00086         std::vector<quad_index> internal_connectivity;
00088         std::vector<v3> internal_normal;
00089 
00091         unsigned int internal_old_size_u;
00093         unsigned int internal_old_size_v;
00094 };
00095 }
00096 
00097 #endif
Generated on Mon Feb 27 17:40:02 2012 by  doxygen 1.6.3