MC_mesh_index_vector_draw.hpp

Go to the documentation of this file.
00001 
00002 /*
00003 **    Mesh Converter
00004 **    Copyright (C) 2009 Damien Rohmer
00005 **
00006 **    This program is free software: you can redistribute it and/or modify
00007 **    it under the terms of the GNU General Public License as published by
00008 **    the Free Software Foundation, either version 3 of the License, or
00009 **    (at your option) any later version.
00010 **
00011 **   This program is distributed in the hope that it will be useful,
00012 **    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 **    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 **    GNU General Public License for more details.
00015 **
00016 **    You should have received a copy of the GNU General Public License
00017 **    along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018 */
00019 
00020 #ifndef _MC_MESH_INDEX_VECTOR_DRAW_HPP_
00021 #define _MC_MESH_INDEX_VECTOR_DRAW_HPP_
00022 
00023 #include <MC_mesh_index_vector.hpp>
00024 
00025 #include <MC_v3d_vector.hpp>
00026 #include <MC_double_vector.hpp>
00027 
00028 namespace mesh_conv
00029 {
00030 
00031 
00033     class MC_mesh_index_vector_draw : public MC_mesh_index_vector
00034     {
00035     public:
00036 
00037         //*********************************************//
00038         //*********************************************//
00039         // CONSTRUCTORS
00040         //*********************************************//
00041         //*********************************************//
00042 
00044         MC_mesh_index_vector_draw();
00046         MC_mesh_index_vector_draw(const MC_v3d_vector& input_point_set,const MC_connectivity_index& input_connectivity);
00048         MC_mesh_index_vector_draw(const MC_mesh_index_vector& mesh);
00050         MC_mesh_index_vector_draw(const MC_mesh_index_vector_draw& mesh);
00051 
00052         //*********************************************//
00053         //*********************************************//
00054         // Get
00055         //*********************************************//
00056         //*********************************************//
00057 
00059         MC_v3d_vector& normal();
00061         const MC_v3d_vector& normal() const;
00063         MC_v3d_vector& color();
00065         const MC_v3d_vector& color() const;
00067         MC_v3d_vector& texture();
00069         const MC_v3d_vector& texture() const;
00071         const MC_connectivity_index& texture_connectivity() const;
00073         MC_connectivity_index& texture_connectivity();
00075         MC_double_vector& alpha();
00077         const MC_double_vector& alpha() const;
00078 
00079 
00080         //*********************************************//
00081         //*********************************************//
00082         // COLOR MANAGER
00083         //*********************************************//
00084         //*********************************************//
00085 
00087         MC_mesh_index_vector_draw& fill_color(const MC_v3d& color);
00089         MC_mesh_index_vector_draw& fill_color(const MC_v3d_vector& color);
00090 
00091         //*********************************************//
00092         //*********************************************//
00093         // Texture
00094         //*********************************************//
00095         //*********************************************//
00096 
00098         MC_mesh_index_vector_draw& set_texture(const std::pair<MC_v3d_vector,MC_connectivity_index>& _texture);
00100         MC_mesh_index_vector_draw& set_texture(const MC_mesh_index_vector& texture_mesh);
00101 
00102         //*********************************************//
00103         //*********************************************//
00104         // Special shape
00105         //*********************************************//
00106         //*********************************************//
00107 
00124         static std::vector <MC_mesh_index_vector_draw> build_local_basis();
00125 
00126         //*********************************************//
00127         //*********************************************//
00128         // Manipulation
00129         //*********************************************//
00130         //*********************************************//
00131 
00137         friend MC_mesh_index_vector_draw operator<<(const MC_mesh_index_vector_draw& vec0,const MC_mesh_index_vector_draw& vec1);
00138 
00144         MC_mesh_index_vector_draw& concatenation(const MC_mesh_index_vector_draw& vec1);
00145 
00146 
00147         //*********************************************//
00148         //*********************************************//
00149         // Math
00150         //*********************************************//
00151         //*********************************************//
00152 
00154         friend MC_mesh_index_vector_draw operator*(const MC_matrix& M,const MC_mesh_index_vector_draw& mesh);
00156         friend MC_mesh_index_vector_draw operator*(const MC_mesh_index_vector_draw& mesh,const MC_matrix& M);
00157 
00159         friend MC_mesh_index_vector_draw operator*(const double& s,const MC_mesh_index_vector_draw& mesh);
00161         friend MC_mesh_index_vector_draw operator*(const MC_mesh_index_vector_draw& mesh,const double& s);
00162 
00164         friend MC_mesh_index_vector_draw operator+(const MC_mesh_index_vector_draw& vec,const MC_v3d& to_add);
00166         friend MC_mesh_index_vector_draw operator-(const MC_mesh_index_vector_draw& vec,const MC_v3d& to_sub);
00168         friend MC_mesh_index_vector_draw operator+(const MC_mesh_index_vector_draw& vec,const MC_v3d_vector& to_add);
00170         friend MC_mesh_index_vector_draw operator-(const MC_mesh_index_vector_draw& vec,const MC_v3d_vector& to_sub);
00171 
00173         friend MC_mesh_index_vector_draw operator+(const MC_v3d& to_add,const MC_mesh_index_vector_draw& vec);
00175         friend MC_mesh_index_vector_draw operator-(const MC_v3d& to_sub,const MC_mesh_index_vector_draw& vec);
00177         friend MC_mesh_index_vector_draw operator+(const MC_v3d_vector& to_add,const MC_mesh_index_vector_draw& vec);
00179         friend MC_mesh_index_vector_draw operator-(const MC_v3d_vector& to_sub,const MC_mesh_index_vector_draw& vec);
00180 
00182         friend MC_mesh_index_vector_draw operator/(const MC_mesh_index_vector_draw& vec,const double& to_subdiv);
00183 
00185         MC_mesh_index_vector_draw& operator+=(const MC_v3d& to_add);
00187         MC_mesh_index_vector_draw& operator-=(const MC_v3d& to_sub);
00189         MC_mesh_index_vector_draw& operator+=(const MC_v3d_vector& to_add);
00191         MC_mesh_index_vector_draw& operator-=(const MC_v3d_vector& to_sub);
00193         MC_mesh_index_vector_draw& operator*=(const double& to_mult);
00195         MC_mesh_index_vector_draw& operator/=(const double& to_subdiv);
00196 
00197 
00198 
00199         //*********************************************//
00200         //*********************************************//
00201         // Normal (fast)
00202         //*********************************************//
00203         //*********************************************//
00204 
00206         MC_mesh_index_vector_draw& normal_vertex_update();
00207 
00208 
00209         //*********************************************//
00210         //*********************************************//
00211         // Loader
00212         //*********************************************//
00213         //*********************************************//
00214 
00219         static MC_mesh_index_vector_draw load_mesh_file(const std::string& filename);
00220 
00221 
00222         //*********************************************//
00223         //*********************************************//
00224         // Subdivision
00225         //*********************************************//
00226         //*********************************************//
00227 
00229         MC_mesh_index_vector_draw subdivide_mixed_mid_edge(const std::set<int>& subdivided_polygon) const;
00230 
00231     private:
00232 
00234         MC_v3d_vector normal_mesh;
00236         MC_v3d_vector color_mesh;
00238         MC_v3d_vector texture_mesh;
00240         MC_connectivity_index texture_connectivity_mesh;
00242         MC_double_vector alpha_mesh;
00243 
00244 
00245     };
00246 
00247 }
00248 
00249 #endif

Generated on Sun Apr 18 20:24:47 2010 by  doxygen 1.6.1