mesh_conv::MC_mesh_index_vector_draw Class Reference

A class of indexed mesh with color, normal and texture ready to be (slowly) drawable but with easily access. More...

#include <MC_mesh_index_vector_draw.hpp>

Inheritance diagram for mesh_conv::MC_mesh_index_vector_draw:
Inheritance graph
[legend]
Collaboration diagram for mesh_conv::MC_mesh_index_vector_draw:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MC_mesh_index_vector_draw ()
 empty constructor
 MC_mesh_index_vector_draw (const MC_v3d_vector &input_point_set, const MC_connectivity_index &input_connectivity)
 direct point_set+connectivity constructor
 MC_mesh_index_vector_draw (const MC_mesh_index_vector &mesh)
 direct constructor from a MC_mesh_index_vector (vertex+connectivity)
 MC_mesh_index_vector_draw (const MC_mesh_index_vector_draw &mesh)
 copy constructor
MC_v3d_vectornormal ()
 get the normal
const MC_v3d_vectornormal () const
 get the normal
MC_v3d_vectorcolor ()
 get the color
const MC_v3d_vectorcolor () const
 get the color
MC_v3d_vectortexture ()
 get the texture
const MC_v3d_vectortexture () const
 get the texture
const MC_connectivity_indextexture_connectivity () const
 get the texture connectivity
MC_connectivity_indextexture_connectivity ()
 get the texture connectivity
MC_double_vectoralpha ()
 get the alpha
const MC_double_vectoralpha () const
 get the alpha
MC_mesh_index_vector_drawfill_color (const MC_v3d &color)
 fill the whole mesh with the same color
MC_mesh_index_vector_drawfill_color (const MC_v3d_vector &color)
 fill the whole mesh with a per vertex color
MC_mesh_index_vector_drawset_texture (const std::pair< MC_v3d_vector, MC_connectivity_index > &_texture)
 set the texture
MC_mesh_index_vector_drawset_texture (const MC_mesh_index_vector &texture_mesh)
 set the texture with a texture_mesh input
MC_mesh_index_vector_drawconcatenation (const MC_mesh_index_vector_draw &vec1)
 internal concatenation of the pointset/normal/color/texture and connectivity
MC_mesh_index_vector_drawoperator+= (const MC_v3d &to_add)
 internal translation
MC_mesh_index_vector_drawoperator-= (const MC_v3d &to_sub)
 internal translation
MC_mesh_index_vector_drawoperator+= (const MC_v3d_vector &to_add)
 internal translation
MC_mesh_index_vector_drawoperator-= (const MC_v3d_vector &to_sub)
 internal translation
MC_mesh_index_vector_drawoperator*= (const double &to_mult)
 internal scale
MC_mesh_index_vector_drawoperator/= (const double &to_subdiv)
 internal scale
MC_mesh_index_vector_drawnormal_vertex_update ()
 update per vertex normal to the current mesh
MC_mesh_index_vector_draw subdivide_mixed_mid_edge (const std::set< int > &subdivided_polygon) const
 subdivide mixed mid edge

Static Public Member Functions

static std::vector
< MC_mesh_index_vector_draw
build_local_basis ()
 create local axis visualization
static MC_mesh_index_vector_draw load_mesh_file (const std::string &filename)
 load a mesh file if its extension is recognized

Private Attributes

MC_v3d_vector normal_mesh
 the vector of normal
MC_v3d_vector color_mesh
 the vector of color
MC_v3d_vector texture_mesh
 the vector of texture (uv-map, only x-y coordinates are read)
MC_connectivity_index texture_connectivity_mesh
 the connectivity of the texture
MC_double_vector alpha_mesh
 alpha vector

Friends

MC_mesh_index_vector_draw operator<< (const MC_mesh_index_vector_draw &vec0, const MC_mesh_index_vector_draw &vec1)
 concatenation of the point set/normal/color/texture and the connectivity
MC_mesh_index_vector_draw operator* (const MC_matrix &M, const MC_mesh_index_vector_draw &mesh)
 point_set multiplication by a matrix
MC_mesh_index_vector_draw operator* (const MC_mesh_index_vector_draw &mesh, const MC_matrix &M)
 point_set multiplication by a matrix
MC_mesh_index_vector_draw operator* (const double &s, const MC_mesh_index_vector_draw &mesh)
 homogeneous scale
MC_mesh_index_vector_draw operator* (const MC_mesh_index_vector_draw &mesh, const double &s)
 homogeneous scale
MC_mesh_index_vector_draw operator+ (const MC_mesh_index_vector_draw &vec, const MC_v3d &to_add)
 translate the mesh
MC_mesh_index_vector_draw operator- (const MC_mesh_index_vector_draw &vec, const MC_v3d &to_sub)
 translate the mesh
MC_mesh_index_vector_draw operator+ (const MC_mesh_index_vector_draw &vec, const MC_v3d_vector &to_add)
 translate the mesh
MC_mesh_index_vector_draw operator- (const MC_mesh_index_vector_draw &vec, const MC_v3d_vector &to_sub)
 translate the mesh
MC_mesh_index_vector_draw operator+ (const MC_v3d &to_add, const MC_mesh_index_vector_draw &vec)
 translate the mesh
MC_mesh_index_vector_draw operator- (const MC_v3d &to_sub, const MC_mesh_index_vector_draw &vec)
 translate the mesh
MC_mesh_index_vector_draw operator+ (const MC_v3d_vector &to_add, const MC_mesh_index_vector_draw &vec)
 translate the mesh
MC_mesh_index_vector_draw operator- (const MC_v3d_vector &to_sub, const MC_mesh_index_vector_draw &vec)
 translate the mesh
MC_mesh_index_vector_draw operator/ (const MC_mesh_index_vector_draw &vec, const double &to_subdiv)
 divide a double value to the vector

Detailed Description

A class of indexed mesh with color, normal and texture ready to be (slowly) drawable but with easily access.

Definition at line 33 of file MC_mesh_index_vector_draw.hpp.


Constructor & Destructor Documentation

mesh_conv::MC_mesh_index_vector_draw::MC_mesh_index_vector_draw (  ) 

empty constructor

Definition at line 13 of file MC_mesh_index_vector_draw.cpp.

Referenced by load_mesh_file().

00014             :MC_mesh_index_vector()
00015     {}

Here is the caller graph for this function:

mesh_conv::MC_mesh_index_vector_draw::MC_mesh_index_vector_draw ( const MC_v3d_vector input_point_set,
const MC_connectivity_index input_connectivity 
)

direct point_set+connectivity constructor

Definition at line 16 of file MC_mesh_index_vector_draw.cpp.

References mesh_conv::MC_connectivity_index::build_star(), mesh_conv::MC_mesh_index_vector::connectivity_mesh, normal_mesh, mesh_conv::MC_mesh_index_vector::normal_vertex(), and mesh_conv::MC_mesh_index_vector::point_set_mesh.

00017             :MC_mesh_index_vector(input_point_set,MC_connectivity_index())
00018     {
00019         MC_connectivity_index temp_co=input_connectivity;
00020         temp_co.build_star();
00021         connectivity_mesh=temp_co;
00022 
00023         // automatically build normal per vertex
00024         normal_mesh=MC_mesh_index_vector::normal_vertex(point_set_mesh,temp_co);
00025     }

Here is the call graph for this function:

mesh_conv::MC_mesh_index_vector_draw::MC_mesh_index_vector_draw ( const MC_mesh_index_vector mesh  ) 

direct constructor from a MC_mesh_index_vector (vertex+connectivity)

Definition at line 26 of file MC_mesh_index_vector_draw.cpp.

References mesh_conv::MC_connectivity_index::build_star(), mesh_conv::MC_mesh_index_vector::connectivity(), mesh_conv::MC_mesh_index_vector::connectivity_mesh, normal_mesh, mesh_conv::MC_mesh_index_vector::normal_vertex(), and mesh_conv::MC_mesh_index_vector::point_set_mesh.

00027             :MC_mesh_index_vector(mesh.point_set(),MC_connectivity_index())
00028     {
00029         MC_connectivity_index temp_co=mesh.connectivity();
00030         temp_co.build_star();
00031         connectivity_mesh=temp_co;
00032 
00033 
00034         // automatically build normal per vertex
00035         normal_mesh=MC_mesh_index_vector::normal_vertex(point_set_mesh,temp_co);
00036     }

Here is the call graph for this function:

mesh_conv::MC_mesh_index_vector_draw::MC_mesh_index_vector_draw ( const MC_mesh_index_vector_draw mesh  ) 

copy constructor

Definition at line 263 of file MC_mesh_index_vector_draw.cpp.

00264         :MC_mesh_index_vector(mesh),normal_mesh(mesh.normal_mesh),color_mesh(mesh.color_mesh),texture_mesh(mesh.texture_mesh),texture_connectivity_mesh(mesh.texture_connectivity_mesh),alpha_mesh(mesh.alpha_mesh)
00265     {}


Member Function Documentation

const MC_double_vector & mesh_conv::MC_mesh_index_vector_draw::alpha (  )  const

get the alpha

Definition at line 45 of file MC_mesh_index_vector_draw.cpp.

References alpha_mesh.

00045 {return alpha_mesh;}

MC_double_vector & mesh_conv::MC_mesh_index_vector_draw::alpha (  ) 

get the alpha

Definition at line 44 of file MC_mesh_index_vector_draw.cpp.

References alpha_mesh.

Referenced by concatenation(), and mesh_conv::operator<<().

00044 {return alpha_mesh;}

Here is the caller graph for this function:

std::vector< MC_mesh_index_vector_draw > mesh_conv::MC_mesh_index_vector_draw::build_local_basis (  )  [static]

create local axis visualization

Returns:
the set of meshes (ux,uy,uz,xyz_ball)

exemple of final visualization:

std::vector <MC_mesh_index_vector> v_axis=MC_mesh_index_vectorbuild_local_basis(); for(unsigned int k=0;k<v_axis.size();k++) openGL_drawer_basis.add_draw_list(v_axis[k]);

glPushMatrix(); glLoadIdentity(); glTranslated(0.4,0.4,-1.25); glMultMatrixd(navigator.get_quaternion_matrix_1().get_pointer()); openGL_drawer_basis.draw_stored_list(); glPopMatrix();

Reimplemented from mesh_conv::MC_mesh_index_vector.

Definition at line 74 of file MC_mesh_index_vector_draw.cpp.

References mesh_conv::MC_mesh_index_vector::build_arrow(), mesh_conv::MC_mesh_index_vector::build_sphere(), color(), fill_color(), mesh_conv::MC_mesh_index_vector::point_set(), mesh_conv::MC_v3d_vector::resize(), and mesh_conv::MC_mesh_index_vector::vertex_number().

00075     {
00076         MC_mesh_index_vector_draw a_x=MC_mesh_index_vector::build_arrow(MC_segment(MC_v3d(0,0,0),MC_v3d(1,0,0)),0.05,15,15,0.15,0.25,15,15);
00077         a_x.fill_color(MC_v3d(1,0,0));
00078 
00079         MC_mesh_index_vector_draw a_y=MC_mesh_index_vector::build_arrow(MC_segment(MC_v3d(0,0,0),MC_v3d(0,1,0)),0.05,15,15,0.15,0.25,15,15);
00080         a_y.fill_color(MC_v3d(0,1,0));
00081 
00082         MC_mesh_index_vector_draw a_z=MC_mesh_index_vector::build_arrow(MC_segment(MC_v3d(0,0,0),MC_v3d(0,0,1)),0.05,15,15,0.15,0.25,15,15);
00083         a_z.fill_color(MC_v3d(0,0,1));
00084 
00085 
00086 
00087         MC_mesh_index_vector_draw sphere=MC_mesh_index_vector::build_sphere(3);
00088 
00089 
00090         int N=sphere.vertex_number();
00091         sphere.color().resize(N);
00092         for(int k=0;k<N;k++)
00093         {
00094             MC_v3d X=sphere.point_set()[k];
00095             double r=fabs(X[0]);
00096             double g=fabs(X[1]);
00097             double b=fabs(X[2]);
00098             sphere.color()(k)=MC_v3d(r,g,b);
00099         }
00100 
00101         a_x*=0.2;a_y*=0.2;a_z*=0.2;
00102         sphere*=0.04;
00103 
00104 
00105         std::vector <MC_mesh_index_vector_draw> v_mesh;
00106         v_mesh.push_back(a_x);
00107         v_mesh.push_back(a_y);
00108         v_mesh.push_back(a_z);
00109         v_mesh.push_back(sphere);
00110         return v_mesh;
00111     }

Here is the call graph for this function:

const MC_v3d_vector & mesh_conv::MC_mesh_index_vector_draw::color (  )  const

get the color

Definition at line 41 of file MC_mesh_index_vector_draw.cpp.

References color_mesh.

00041 {return color_mesh;}

MC_v3d_vector & mesh_conv::MC_mesh_index_vector_draw::color (  ) 

get the color

Definition at line 40 of file MC_mesh_index_vector_draw.cpp.

References color_mesh.

Referenced by build_local_basis(), concatenation(), mesh_conv::MC_opengl_drawer::draw(), mesh_conv::MC_mesh_fast_draw::MC_mesh_fast_draw(), mesh_conv::operator<<(), and update_plane_density().

00040 {return color_mesh;}

Here is the caller graph for this function:

MC_mesh_index_vector_draw & mesh_conv::MC_mesh_index_vector_draw::concatenation ( const MC_mesh_index_vector_draw vec1  ) 

internal concatenation of the pointset/normal/color/texture and connectivity

Returns:
a new mesh in directly adding the vertices

the connectivity is automatically incremented to avoid conflict

Reimplemented from mesh_conv::MC_mesh_index_vector.

Definition at line 129 of file MC_mesh_index_vector_draw.cpp.

References mesh_conv::MC_int_vector_vector::add(), mesh_conv::MC_double_vector::add(), mesh_conv::MC_v3d_vector::add(), alpha(), alpha_mesh, color(), color_mesh, mesh_conv::MC_mesh_index_vector::connectivity(), normal(), normal_mesh, mesh_conv::MC_mesh_index_vector::point_set(), mesh_conv::MC_v3d_vector::size(), texture(), texture_connectivity(), texture_connectivity_mesh, and texture_mesh.

00130     {
00131         int N_vertex=point_set().size();
00132         int N_texture=texture().size();
00133 
00134         point_set().add(vec1.point_set());
00135         color_mesh.add(vec1.color());
00136         texture_mesh.add(vec1.texture());
00137         alpha_mesh.add(vec1.alpha());
00138         normal_mesh.add(vec1.normal());
00139         connectivity().add(vec1.connectivity()+N_vertex);
00140         texture_connectivity_mesh.add(vec1.texture_connectivity()+N_texture);
00141 
00142         return *this;
00143     }

MC_mesh_index_vector_draw & mesh_conv::MC_mesh_index_vector_draw::fill_color ( const MC_v3d_vector color  ) 

fill the whole mesh with a per vertex color

Definition at line 55 of file MC_mesh_index_vector_draw.cpp.

References color_mesh, fill_color(), mesh_conv::MC_v3d_vector::first(), mesh_conv::MC_v3d_vector::resize(), mesh_conv::MC_v3d_vector::size(), and mesh_conv::MC_mesh_index_vector::vertex_number().

00056     {
00057         if(input_color.size()==1)
00058             return fill_color(input_color.first());
00059         else if(input_color.size()==vertex_number())
00060         {
00061             int N_vertex=vertex_number();
00062             color_mesh.resize(N_vertex);
00063             for(int k_vertex=0;k_vertex<N_vertex;++k_vertex)
00064                 color_mesh[k_vertex]=input_color[k_vertex];
00065             return *this;
00066         }
00067         else
00068         {std::cout<<"Error in MC_mesh_index_vector_draw::fill_color(MC_v3d_vector), input_color has size "<<input_color.size()<<" , and vertex_number="<<vertex_number()<<std::endl;exit(-1);}
00069 
00070     }

Here is the call graph for this function:

MC_mesh_index_vector_draw & mesh_conv::MC_mesh_index_vector_draw::fill_color ( const MC_v3d color  ) 

fill the whole mesh with the same color

Definition at line 47 of file MC_mesh_index_vector_draw.cpp.

References color_mesh, mesh_conv::MC_v3d_vector::resize(), and mesh_conv::MC_mesh_index_vector::vertex_number().

Referenced by build_local_basis(), and fill_color().

00048     {
00049         int N_vertex=vertex_number();
00050         color_mesh.resize(N_vertex);
00051         for(int k_vertex=0;k_vertex<N_vertex;++k_vertex)
00052             color_mesh[k_vertex]=input_color;
00053         return *this;
00054     }

Here is the call graph for this function:

Here is the caller graph for this function:

MC_mesh_index_vector_draw mesh_conv::MC_mesh_index_vector_draw::load_mesh_file ( const std::string &  filename  )  [static]

load a mesh file if its extension is recognized

Compared to MC_mesh_index_vector::load_mesh_file(), the MC_mesh_index_vector_draw try to load texture coordinates for some extensions

Reimplemented from mesh_conv::MC_mesh_index_vector.

Definition at line 276 of file MC_mesh_index_vector_draw.cpp.

References MC_mesh_index_vector_draw(), mesh_conv::MC_io_obj::read_obj_file(), mesh_conv::MC_io_obj::read_obj_texture_file(), mesh_conv::MC_io_off::read_off_file(), set_texture(), and mesh_conv::MC_string_tokenizer::tokenize().

00277     {
00278         MC_mesh_index_vector_draw mesh;
00279 
00280         //get extension
00281         std::vector<std::string> token=MC_string_tokenizer::tokenize(filename,".");
00282         std::string extension=token[token.size()-1];
00283 
00284         if(extension.find("off")!=std::string::npos)
00285             mesh=MC_mesh_index_vector_draw(MC_io_off::read_off_file(filename));
00286         else if(extension.find("obj")!=std::string::npos)
00287         {
00288             mesh=MC_mesh_index_vector_draw(MC_io_obj::read_obj_file(filename));
00289             mesh.set_texture(MC_io_obj::read_obj_texture_file(filename));
00290         }
00291         else
00292             std::cout<<"Warning in MC_mesh_index_vector_draw::load_mesh_file("<<filename<<"), extension "<<extension<<" not recognized"<<std::endl;
00293 
00294         return mesh;
00295     }

Here is the call graph for this function:

const MC_v3d_vector & mesh_conv::MC_mesh_index_vector_draw::normal (  )  const

get the normal

Definition at line 39 of file MC_mesh_index_vector_draw.cpp.

References normal_mesh.

00039 {return normal_mesh;}

MC_v3d_vector & mesh_conv::MC_mesh_index_vector_draw::normal (  ) 

get the normal

Definition at line 38 of file MC_mesh_index_vector_draw.cpp.

References normal_mesh.

Referenced by concatenation(), mesh_conv::MC_opengl_drawer::draw(), mesh_conv::MC_mesh_fast_draw::MC_mesh_fast_draw(), mesh_conv::operator<<(), and mesh_conv::MC_io_obj::write_obj().

00038 {return normal_mesh;}

Here is the caller graph for this function:

MC_mesh_index_vector_draw & mesh_conv::MC_mesh_index_vector_draw::normal_vertex_update (  ) 

update per vertex normal to the current mesh

Definition at line 222 of file MC_mesh_index_vector_draw.cpp.

References mesh_conv::MC_mesh_index_vector::connectivity(), mesh_conv::MC_v3d::cross(), normal_mesh, mesh_conv::MC_v3d::normalized(), mesh_conv::MC_mesh_index_vector::point_set(), mesh_conv::MC_int_vector_vector::pointer(), mesh_conv::MC_v3d_vector::pointer(), mesh_conv::MC_v3d_vector::pointer_unprotected(), mesh_conv::MC_mesh_index_vector::polygon_number(), mesh_conv::MC_v3d_vector::resize(), mesh_conv::MC_v3d_vector::size(), and mesh_conv::MC_mesh_index_vector::vertex_number().

Referenced by update_marching_cube().

00223     {
00224         int N=vertex_number();
00225         if(normal_mesh.size()!=N)
00226             normal_mesh.resize(N);
00227 
00228         MC_v3d* p_normal=normal_mesh.pointer_unprotected();
00229         const MC_v3d* p_vertex=point_set().pointer();
00230         const MC_int_vector* p_connectivity=connectivity().pointer();
00231 
00232         MC_v3d z(0,0,0);
00233         for(int k=0;k<N;++k)
00234             p_normal[k]=z;
00235 
00236         int N_poly=polygon_number();
00237         for(int k=0;k<N_poly;++k)
00238         {
00239             MC_int_vector current_index=p_connectivity[k];
00240 
00241             const MC_v3d* p_current_0=p_vertex+current_index[0];
00242             const MC_v3d* p_current_1=p_vertex+current_index[1];
00243             const MC_v3d* p_current_2=p_vertex+current_index[2];
00244 
00245 
00246 
00247             MC_v3d u0=(*p_current_1-*p_current_0).normalized();
00248             MC_v3d u1=(*p_current_2-*p_current_0).normalized();
00249             MC_v3d n=u0.cross(u1).normalized();
00250 
00251             for(int k_v=0,N_v=current_index.size();k_v<N_v;++k_v)
00252             {
00253                 p_normal[current_index[k_v]] += n;
00254             }
00255 
00256         }
00257         for(int k=0;k<N;++k)
00258             p_normal[k]=p_normal[k].normalized();
00259 
00260         return *this;
00261     }

Here is the caller graph for this function:

MC_mesh_index_vector_draw & mesh_conv::MC_mesh_index_vector_draw::operator*= ( const double &  to_mult  ) 

internal scale

Reimplemented from mesh_conv::MC_mesh_index_vector.

Definition at line 211 of file MC_mesh_index_vector_draw.cpp.

References mesh_conv::MC_mesh_index_vector::point_set().

00212     {
00213         point_set()*=to_mult;
00214         return *this;
00215     }

Here is the call graph for this function:

MC_mesh_index_vector_draw & mesh_conv::MC_mesh_index_vector_draw::operator+= ( const MC_v3d_vector to_add  ) 

internal translation

Reimplemented from mesh_conv::MC_mesh_index_vector.

Definition at line 201 of file MC_mesh_index_vector_draw.cpp.

References mesh_conv::MC_mesh_index_vector::point_set().

00202     {
00203         point_set()+=to_add;
00204         return *this;
00205     }

Here is the call graph for this function:

MC_mesh_index_vector_draw & mesh_conv::MC_mesh_index_vector_draw::operator+= ( const MC_v3d to_add  ) 

internal translation

Reimplemented from mesh_conv::MC_mesh_index_vector.

Definition at line 190 of file MC_mesh_index_vector_draw.cpp.

References mesh_conv::MC_mesh_index_vector::point_set().

00191     {
00192         point_set()+=to_add;
00193         return *this;
00194     }

Here is the call graph for this function:

MC_mesh_index_vector_draw & mesh_conv::MC_mesh_index_vector_draw::operator-= ( const MC_v3d_vector to_sub  ) 

internal translation

Reimplemented from mesh_conv::MC_mesh_index_vector.

Definition at line 206 of file MC_mesh_index_vector_draw.cpp.

References mesh_conv::MC_mesh_index_vector::point_set().

00207     {
00208         point_set()-=to_sub;
00209         return *this;
00210     }

Here is the call graph for this function:

MC_mesh_index_vector_draw & mesh_conv::MC_mesh_index_vector_draw::operator-= ( const MC_v3d to_sub  ) 

internal translation

Reimplemented from mesh_conv::MC_mesh_index_vector.

Definition at line 196 of file MC_mesh_index_vector_draw.cpp.

References mesh_conv::MC_mesh_index_vector::point_set().

00197     {
00198         point_set()-=to_sub;
00199         return *this;
00200     }

Here is the call graph for this function:

MC_mesh_index_vector_draw & mesh_conv::MC_mesh_index_vector_draw::operator/= ( const double &  to_subdiv  ) 

internal scale

Reimplemented from mesh_conv::MC_mesh_index_vector.

Definition at line 216 of file MC_mesh_index_vector_draw.cpp.

References mesh_conv::MC_mesh_index_vector::point_set().

00217     {
00218         point_set()/=to_subdiv;
00219         return *this;
00220     }

Here is the call graph for this function:

MC_mesh_index_vector_draw & mesh_conv::MC_mesh_index_vector_draw::set_texture ( const MC_mesh_index_vector texture_mesh  ) 

set the texture with a texture_mesh input

Definition at line 309 of file MC_mesh_index_vector_draw.cpp.

References mesh_conv::MC_mesh_index_vector::connectivity(), mesh_conv::MC_mesh_index_vector::point_set(), and set_texture().

00310     {
00311         return set_texture(std::make_pair(texture_mesh.point_set(),texture_mesh.connectivity()));
00312     }

Here is the call graph for this function:

MC_mesh_index_vector_draw & mesh_conv::MC_mesh_index_vector_draw::set_texture ( const std::pair< MC_v3d_vector, MC_connectivity_index > &  _texture  ) 

set the texture

Definition at line 269 of file MC_mesh_index_vector_draw.cpp.

References mesh_conv::MC_v3d_vector::first(), texture(), and texture_connectivity().

Referenced by load_mesh_file(), set_texture(), and subdivide_mixed_mid_edge().

00270     {
00271         texture()=_texture.first;
00272         texture_connectivity()=_texture.second;
00273         return *this;
00274     }

Here is the call graph for this function:

Here is the caller graph for this function:

MC_mesh_index_vector_draw mesh_conv::MC_mesh_index_vector_draw::subdivide_mixed_mid_edge ( const std::set< int > &  subdivided_polygon  )  const

subdivide mixed mid edge

Reimplemented from mesh_conv::MC_mesh_index_vector.

Definition at line 298 of file MC_mesh_index_vector_draw.cpp.

References mesh_conv::MC_mesh_index_vector::connectivity(), mesh_conv::MC_mesh_index_vector::point_set(), set_texture(), mesh_conv::MC_mesh_index_vector::subdivide_mixed_mid_edge(), texture(), and texture_connectivity().

00299     {
00300         MC_mesh_index_vector_draw mesh2;
00301         mesh2=MC_mesh_index_vector::subdivide_mixed_mid_edge(subdivided_polygon);
00302 
00303         MC_mesh_index_vector mesh_tex(texture(),texture_connectivity());
00304         mesh_tex = mesh_tex.subdivide_mixed_mid_edge(subdivided_polygon);
00305 
00306         mesh2.set_texture(std::make_pair(mesh_tex.point_set(),mesh_tex.connectivity()));
00307         return mesh2;
00308     }

Here is the call graph for this function:

const MC_v3d_vector & mesh_conv::MC_mesh_index_vector_draw::texture (  )  const

get the texture

Definition at line 43 of file MC_mesh_index_vector_draw.cpp.

References texture_mesh.

00043 {return texture_mesh;}

MC_v3d_vector & mesh_conv::MC_mesh_index_vector_draw::texture (  ) 
MC_connectivity_index & mesh_conv::MC_mesh_index_vector_draw::texture_connectivity (  ) 

get the texture connectivity

Definition at line 148 of file MC_mesh_index_vector_draw.cpp.

References texture_connectivity_mesh.

00149     {return texture_connectivity_mesh;}

const MC_connectivity_index & mesh_conv::MC_mesh_index_vector_draw::texture_connectivity (  )  const

get the texture connectivity

Definition at line 145 of file MC_mesh_index_vector_draw.cpp.

References texture_connectivity_mesh.

Referenced by concatenation(), mesh_conv::MC_opengl_drawer::draw(), mesh_conv::operator<<(), set_texture(), subdivide_mixed_mid_edge(), and mesh_conv::MC_io_obj::write_obj().

00146     {return texture_connectivity_mesh;}

Here is the caller graph for this function:


Friends And Related Function Documentation

MC_mesh_index_vector_draw operator* ( const MC_mesh_index_vector_draw mesh,
const double &  s 
) [friend]

homogeneous scale

Reimplemented from mesh_conv::MC_mesh_index_vector.

MC_mesh_index_vector_draw operator* ( const double &  s,
const MC_mesh_index_vector_draw mesh 
) [friend]

homogeneous scale

Reimplemented from mesh_conv::MC_mesh_index_vector.

MC_mesh_index_vector_draw operator* ( const MC_mesh_index_vector_draw mesh,
const MC_matrix M 
) [friend]

point_set multiplication by a matrix

MC_mesh_index_vector_draw operator* ( const MC_matrix M,
const MC_mesh_index_vector_draw mesh 
) [friend]

point_set multiplication by a matrix

Reimplemented from mesh_conv::MC_mesh_index_vector.

MC_mesh_index_vector_draw operator+ ( const MC_v3d_vector to_add,
const MC_mesh_index_vector_draw vec 
) [friend]

translate the mesh

MC_mesh_index_vector_draw operator+ ( const MC_v3d to_add,
const MC_mesh_index_vector_draw vec 
) [friend]

translate the mesh

MC_mesh_index_vector_draw operator+ ( const MC_mesh_index_vector_draw vec,
const MC_v3d_vector to_add 
) [friend]

translate the mesh

Reimplemented from mesh_conv::MC_mesh_index_vector.

MC_mesh_index_vector_draw operator+ ( const MC_mesh_index_vector_draw vec,
const MC_v3d to_add 
) [friend]

translate the mesh

Reimplemented from mesh_conv::MC_mesh_index_vector.

MC_mesh_index_vector_draw operator- ( const MC_v3d_vector to_sub,
const MC_mesh_index_vector_draw vec 
) [friend]

translate the mesh

MC_mesh_index_vector_draw operator- ( const MC_v3d to_sub,
const MC_mesh_index_vector_draw vec 
) [friend]

translate the mesh

MC_mesh_index_vector_draw operator- ( const MC_mesh_index_vector_draw vec,
const MC_v3d_vector to_sub 
) [friend]

translate the mesh

Reimplemented from mesh_conv::MC_mesh_index_vector.

MC_mesh_index_vector_draw operator- ( const MC_mesh_index_vector_draw vec,
const MC_v3d to_sub 
) [friend]

translate the mesh

Reimplemented from mesh_conv::MC_mesh_index_vector.

MC_mesh_index_vector_draw operator/ ( const MC_mesh_index_vector_draw vec,
const double &  to_subdiv 
) [friend]

divide a double value to the vector

Reimplemented from mesh_conv::MC_mesh_index_vector.

MC_mesh_index_vector_draw operator<< ( const MC_mesh_index_vector_draw vec0,
const MC_mesh_index_vector_draw vec1 
) [friend]

concatenation of the point set/normal/color/texture and the connectivity

Returns:
a new mesh in directly adding the vertices

the connectivity is automatically incremented to avoid conflict

Reimplemented from mesh_conv::MC_mesh_index_vector.


Member Data Documentation

alpha vector

Definition at line 242 of file MC_mesh_index_vector_draw.hpp.

Referenced by alpha(), and concatenation().

the vector of color

Definition at line 236 of file MC_mesh_index_vector_draw.hpp.

Referenced by color(), concatenation(), and fill_color().

the vector of normal

Definition at line 234 of file MC_mesh_index_vector_draw.hpp.

Referenced by concatenation(), MC_mesh_index_vector_draw(), normal(), and normal_vertex_update().

the connectivity of the texture

Definition at line 240 of file MC_mesh_index_vector_draw.hpp.

Referenced by concatenation(), and texture_connectivity().

the vector of texture (uv-map, only x-y coordinates are read)

Definition at line 238 of file MC_mesh_index_vector_draw.hpp.

Referenced by concatenation(), and texture().


The documentation for this class was generated from the following files:

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