Container class for MC_int_vector. More...
#include <MC_int_vector_vector.hpp>


Public Member Functions | |
| MC_int_vector_vector () | |
| standard constructor | |
| MC_int_vector_vector (const MC_int_vector &v0) | |
| direct constructor from some MC_int_vector | |
| MC_int_vector_vector (const MC_int_vector &v0, const MC_int_vector &v1) | |
| direct constructor from some MC_int_vector | |
| MC_int_vector_vector (const MC_int_vector &v0, const MC_int_vector &v1, const MC_int_vector &v2) | |
| direct constructor from some MC_int_vector | |
| MC_int_vector_vector (const MC_int_vector &v0, const MC_int_vector &v1, const MC_int_vector &v2, const MC_int_vector &v3) | |
| direct constructor from some MC_int_vector | |
| MC_int_vector_vector (const MC_int_list_vector &v) | |
| constructor from a MC_int_list_vector | |
| MC_int_vector_vector (const std::list< MC_int_vector > &vec) | |
| direct constructor from a std::list <MC_int_vector> | |
| void | assert_bounds (const int &u) const |
| Assert the value stays within the bounds. | |
| int | size () const |
| get the size of the vector | |
| void | clear () |
| clear the vector to size 0 | |
| MC_int_vector_vector & | resize (const int &new_size) |
| resize the vector in deleting value of adding zeros | |
| MC_int_vector_vector & | add (const MC_int_vector &val) |
| add a value at the end of the vector | |
| MC_int_vector_vector & | add (const MC_int_vector_vector &val) |
| add some values at the end of the vector | |
| MC_int_vector_vector & | set (const int &k_index, const MC_int_vector &new_value) |
| set an indexed value to a certain component. Adjust the size automatically | |
| MC_int_vector_vector & | set (const MC_int_vector &k_index, const MC_int_vector_vector &new_value) |
| set an indexed value to a certain component. Adjust the size automatically | |
| std::pair < MC_int_vector_vector, MC_int_vector > | delete_index (const int &index_to_delete) const |
| delete the k_th value | |
| std::pair < MC_int_vector_vector, MC_int_vector_vector > | delete_index (const MC_int_vector &index_to_delete) const |
| delete the k_th value | |
| const MC_int_vector & | operator() (const int &index) const |
| get operator with bounds checks | |
| MC_int_vector & | operator() (const int &index) |
| get operator with bounds checks | |
| const MC_int_vector & | operator[] (const int &index) const |
| get operator with bounds asserts | |
| MC_int_vector & | operator[] (const int &index) |
| get operator with bounds asserts | |
| MC_int_vector_vector | operator() (const MC_int_vector &index) const |
| get operator from a vector of index | |
| const MC_int_vector & | first () const |
| return the first value | |
| MC_int_vector & | first () |
| return the first value | |
| const MC_int_vector & | last () const |
| return the last value | |
| MC_int_vector & | last () |
| return the last value | |
| const MC_int_vector * | pointer () const |
| get pointer on internal data | |
| MC_int_vector * | pointer_unprotected () |
| get pointer on internal data | |
Static Public Member Functions | |
| static MC_int_vector_vector | empty (const int &N) |
| create an empty container of a given size | |
| static MC_int_vector_vector | repeat (const MC_int_vector &input, const int &N_repeat) |
| repeat a MC_int_vector a certain amount of time | |
Private Attributes | |
| std::vector< MC_int_vector > | int_vec_list |
| internal storage as a std::vector <MC_int_vector> | |
Friends | |
| MC_int_vector_vector | operator<< (const MC_int_vector_vector &vec, const MC_int_vector &value) |
| add a value at the end of the vertex | |
| MC_int_vector_vector | operator<< (const MC_int_vector_vector &vec, const MC_int_vector_vector &to_add) |
| add some values at the end of the vertex | |
| MC_int_vector_vector | operator+ (const MC_int_vector_vector &vec, const int &to_add) |
| add an int to all the entries | |
| MC_int_vector_vector | operator- (const MC_int_vector_vector &vec, const int &to_add) |
| substract an int to all the entries | |
| std::ostream & | operator<< (std::ostream &stream, const MC_int_vector_vector &input) |
Container class for MC_int_vector.
correspond to a std::vector<std::vector> > and is internaly stored as a std::vector<MC_int_vector>
Definition at line 35 of file MC_int_vector_vector.hpp.
| mesh_conv::MC_int_vector_vector::MC_int_vector_vector | ( | ) |
| mesh_conv::MC_int_vector_vector::MC_int_vector_vector | ( | const MC_int_vector & | v0 | ) |
direct constructor from some MC_int_vector
Definition at line 10 of file MC_int_vector_vector.cpp.
References int_vec_list.
00010 {int_vec_list.push_back(v0);}
| mesh_conv::MC_int_vector_vector::MC_int_vector_vector | ( | const MC_int_vector & | v0, | |
| const MC_int_vector & | v1 | |||
| ) |
direct constructor from some MC_int_vector
Definition at line 11 of file MC_int_vector_vector.cpp.
References int_vec_list.
00012 {int_vec_list.push_back(v0);int_vec_list.push_back(v1);}
| mesh_conv::MC_int_vector_vector::MC_int_vector_vector | ( | const MC_int_vector & | v0, | |
| const MC_int_vector & | v1, | |||
| const MC_int_vector & | v2 | |||
| ) |
direct constructor from some MC_int_vector
Definition at line 13 of file MC_int_vector_vector.cpp.
References int_vec_list.
00014 {int_vec_list.push_back(v0);int_vec_list.push_back(v1);int_vec_list.push_back(v2);}
| mesh_conv::MC_int_vector_vector::MC_int_vector_vector | ( | const MC_int_vector & | v0, | |
| const MC_int_vector & | v1, | |||
| const MC_int_vector & | v2, | |||
| const MC_int_vector & | v3 | |||
| ) |
direct constructor from some MC_int_vector
Definition at line 15 of file MC_int_vector_vector.cpp.
References int_vec_list.
00016 {int_vec_list.push_back(v0);int_vec_list.push_back(v1);int_vec_list.push_back(v2);int_vec_list.push_back(v3);}
| mesh_conv::MC_int_vector_vector::MC_int_vector_vector | ( | const MC_int_list_vector & | v | ) |
constructor from a MC_int_list_vector
| mesh_conv::MC_int_vector_vector::MC_int_vector_vector | ( | const std::list< MC_int_vector > & | vec | ) |
direct constructor from a std::list <MC_int_vector>
Definition at line 185 of file MC_int_vector_vector.cpp.
References add().
00186 { 00187 for(std::list <MC_int_vector> :: const_iterator it=vec.begin();it!=vec.end();++it) 00188 add(*it); 00189 }

| MC_int_vector_vector & mesh_conv::MC_int_vector_vector::add | ( | const MC_int_vector_vector & | val | ) |
add some values at the end of the vector
Definition at line 53 of file MC_int_vector_vector.cpp.
References int_vec_list, and size().
00054 { 00055 int N=val.size(); 00056 for(int k=0;k<N;++k) 00057 int_vec_list.push_back(val[k]); 00058 return *this; 00059 }

| MC_int_vector_vector & mesh_conv::MC_int_vector_vector::add | ( | const MC_int_vector & | val | ) |
add a value at the end of the vector
Definition at line 50 of file MC_int_vector_vector.cpp.
References int_vec_list.
Referenced by mesh_conv::MC_mesh_index_vector::add_connectivity_index(), mesh_conv::MC_mesh_index_vector::add_unique_polygon(), mesh_conv::MC_mesh_index_vector::build_closed_cylinder(), mesh_conv::MC_mesh_index_vector::build_cone(), mesh_conv::MC_mesh_index_vector::build_parametric_sphere(), mesh_conv::MC_mesh_index_vector::build_square(), mesh_conv::MC_mesh_index_vector::build_torus(), mesh_conv::MC_mesh_index_vector_draw::concatenation(), mesh_conv::MC_mesh_index_vector::concatenation(), mesh_conv::MC_grid_3d_scalar_marching_cube::create_polygon(), delete_index(), mesh_conv::MC_mesh_index_vector::delete_polygon(), mesh_conv::MC_mesh_index_vector::delete_vertex(), mesh_conv::MC_mesh_index_vector::get_polygon_mesh(), mesh_conv::MC_grid_index_spatial_hashing::get_voxel_within_sphere(), MC_int_vector_vector(), mesh_conv::MC_io_obj::read_obj(), mesh_conv::MC_io_obj::read_obj_texture(), mesh_conv::MC_io_off::read_off(), repeat(), mesh_conv::MC_polygon::subdivide_barycenter_mid_edge(), mesh_conv::MC_mesh_index_vector::subdivide_barycenter_mid_edge(), mesh_conv::MC_mesh_index_vector::subdivide_barycenter_mid_edge_unchanged_boundary(), mesh_conv::MC_polygon::subdivide_mid_edge(), mesh_conv::MC_mesh_index_vector::subdivide_mid_edge(), mesh_conv::MC_mesh_index_vector::subdivide_mid_edge_unchanged_boundary(), mesh_conv::MC_mesh_index_vector::subdivide_mixed_mid_edge(), mesh_conv::MC_mesh_index_vector::subdivide_mixed_mid_edge_unchanged_boundary(), mesh_conv::MC_mesh_index_vector::sweep_surface(), and mesh_conv::MC_connectivity_index::triangulated().
00050 {int_vec_list.push_back(val);return *this;}
| void mesh_conv::MC_int_vector_vector::assert_bounds | ( | const int & | u | ) | const [inline] |
Assert the value stays within the bounds.
Definition at line 18 of file MC_int_vector_vector.cpp.
References int_vec_list.
Referenced by operator()(), and operator[]().
00019 { 00020 if(u<0 || u>=int(int_vec_list.size())) 00021 {std::cout<<"Assert mesh_conv::MC_int_vector_vector::assert_bounds("<<u<<") failed, because size="<<int_vec_list.size()<<std::endl;} 00022 }

| void mesh_conv::MC_int_vector_vector::clear | ( | ) |
clear the vector to size 0
Definition at line 37 of file MC_int_vector_vector.cpp.
References int_vec_list.
00037 {int_vec_list.clear();}
| std::pair< MC_int_vector_vector, MC_int_vector_vector > mesh_conv::MC_int_vector_vector::delete_index | ( | const MC_int_vector & | index_to_delete | ) | const |
delete the k_th value
return <the new vector,the deleted value>
Definition at line 96 of file MC_int_vector_vector.cpp.
References add(), int_vec_list, size(), and mesh_conv::MC_int_vector::to_set().
00097 { 00098 std::set <int> set_index=index_to_delete.to_set(); 00099 MC_int_vector_vector new_vec; 00100 MC_int_vector_vector deleted_vec; 00101 int N=size(); 00102 for(int k=0;k<N;k++) 00103 { 00104 if(set_index.find(k)==set_index.end()) 00105 new_vec.add(int_vec_list[k]); 00106 else 00107 deleted_vec.add(int_vec_list[k]); 00108 } 00109 return std::pair <MC_int_vector_vector,MC_int_vector_vector> (new_vec,deleted_vec); 00110 }

| std::pair< MC_int_vector_vector, MC_int_vector > mesh_conv::MC_int_vector_vector::delete_index | ( | const int & | index_to_delete | ) | const |
delete the k_th value
return <the new vector, the deleted value>
Definition at line 85 of file MC_int_vector_vector.cpp.
References add(), int_vec_list, and size().
Referenced by mesh_conv::MC_mesh_index_vector::subdivide_mixed_mid_edge().
00086 { 00087 if(index_to_delete<0 || index_to_delete>=size()) 00088 {std::cout<<"Error in MC_int_vector_vector::delete("<<index_to_delete<<", when size="<<size()<<std::endl;exit(-1);} 00089 MC_int_vector_vector new_vec; 00090 int N=size(); 00091 for(int k=0;k<N;++k) 00092 if(k!=index_to_delete) 00093 new_vec.add(int_vec_list[k]); 00094 return std::pair <MC_int_vector_vector,MC_int_vector>(new_vec,int_vec_list[index_to_delete]); 00095 }


| MC_int_vector_vector mesh_conv::MC_int_vector_vector::empty | ( | const int & | N | ) | [static] |
create an empty container of a given size
Definition at line 194 of file MC_int_vector_vector.cpp.
References resize().
Referenced by operator()().
00195 {MC_int_vector_vector vec;vec.resize(N);return vec;}


| MC_int_vector & mesh_conv::MC_int_vector_vector::first | ( | ) |
return the first value
Definition at line 133 of file MC_int_vector_vector.cpp.
References int_vec_list, and size().
00134 { 00135 if(size()>0) 00136 return int_vec_list[0]; 00137 else 00138 { 00139 std::cout<<"Error, call MC_int_vector_vector::first() with size=0"<<std::endl;exit(-1); 00140 exit(-1); 00141 } 00142 }

| const MC_int_vector & mesh_conv::MC_int_vector_vector::first | ( | ) | const |
return the first value
Definition at line 123 of file MC_int_vector_vector.cpp.
References int_vec_list, and size().
Referenced by set().
00124 { 00125 if(size()>0) 00126 return int_vec_list[0]; 00127 else 00128 { 00129 std::cout<<"Error, call MC_int_vector_vector::first() with size=0"<<std::endl;exit(-1); 00130 exit(-1); 00131 } 00132 }


| MC_int_vector & mesh_conv::MC_int_vector_vector::last | ( | ) |
return the last value
Definition at line 150 of file MC_int_vector_vector.cpp.
References int_vec_list, and size().
00151 { 00152 if(size()>0) 00153 return int_vec_list[size()-1]; 00154 else 00155 {std::cout<<"Error, call MC_int_vector::last() with size=0"<<std::endl;exit(-1);} 00156 }

| const MC_int_vector & mesh_conv::MC_int_vector_vector::last | ( | ) | const |
return the last value
Definition at line 143 of file MC_int_vector_vector.cpp.
References int_vec_list, and size().
00144 { 00145 if(size()>0) 00146 return int_vec_list[size()-1]; 00147 else 00148 {std::cout<<"Error, call MC_int_vector::last() with size=0"<<std::endl;exit(-1);} 00149 }

| MC_int_vector_vector mesh_conv::MC_int_vector_vector::operator() | ( | const MC_int_vector & | index | ) | const |
get operator from a vector of index
Definition at line 196 of file MC_int_vector_vector.cpp.
References empty(), int_vec_list, size(), and mesh_conv::MC_int_vector::size().
00197 { 00198 int N=index.size(); 00199 MC_int_vector_vector vec=MC_int_vector_vector::empty(N); 00200 00201 int N_current=size(); 00202 for(int k=0;k<N;++k) 00203 { 00204 int u=index[k]; 00205 if(u<0 || u>=N_current) 00206 {std::cout<<"Error in MC_int_vector_vector::operator()(MC_int_vector ), at position k="<<k<<"/"<<N<<", index "<<u<<"is not correct for size "<<N_current<<std::endl;exit(-1);} 00207 vec[k]=int_vec_list[u]; 00208 } 00209 return vec; 00210 }

| MC_int_vector & mesh_conv::MC_int_vector_vector::operator() | ( | const int & | index | ) |
get operator with bounds checks
Definition at line 26 of file MC_int_vector_vector.cpp.
References assert_bounds(), and int_vec_list.
00027 {assert_bounds(index);return int_vec_list[index];}

| const MC_int_vector & mesh_conv::MC_int_vector_vector::operator() | ( | const int & | index | ) | const |
get operator with bounds checks
Definition at line 24 of file MC_int_vector_vector.cpp.
References assert_bounds(), and int_vec_list.
00025 {assert_bounds(index);return int_vec_list[index];}

| MC_int_vector & mesh_conv::MC_int_vector_vector::operator[] | ( | const int & | index | ) |
get operator with bounds asserts
Definition at line 30 of file MC_int_vector_vector.cpp.
References assert_bounds(), and int_vec_list.
00031 {assert_bounds(index);return int_vec_list[index];}

| const MC_int_vector & mesh_conv::MC_int_vector_vector::operator[] | ( | const int & | index | ) | const |
get operator with bounds asserts
Definition at line 28 of file MC_int_vector_vector.cpp.
References assert_bounds(), and int_vec_list.
00029 {assert_bounds(index);return int_vec_list[index];}

| const MC_int_vector * mesh_conv::MC_int_vector_vector::pointer | ( | ) | const |
get pointer on internal data
Definition at line 191 of file MC_int_vector_vector.cpp.
References int_vec_list.
Referenced by mesh_conv::MC_mesh_index_vector_draw::normal_vertex_update().
00191 {return &int_vec_list[0];}

| MC_int_vector * mesh_conv::MC_int_vector_vector::pointer_unprotected | ( | ) |
get pointer on internal data
Definition at line 192 of file MC_int_vector_vector.cpp.
References int_vec_list.
00192 {return &int_vec_list[0];}
| MC_int_vector_vector mesh_conv::MC_int_vector_vector::repeat | ( | const MC_int_vector & | input, | |
| const int & | N_repeat | |||
| ) | [static] |
repeat a MC_int_vector a certain amount of time
ex. MC_int_vector_vector d=MC_int_vector_vectorrepeat(MC_int_vector(4,5,6),3) = [[4,5,6];[4,5,6];[4,5,6]];
Definition at line 112 of file MC_int_vector_vector.cpp.
References add().
Referenced by set().
00113 { 00114 if(N_repeat<0) 00115 {std::cout<<"Error in MC_int_vector_vector::repeat(MC_int_vector,"<<N_repeat<<"), repeat number must be >0"<<std::endl;exit(-1);} 00116 00117 MC_int_vector_vector vec(input); 00118 for(int k=1;k<N_repeat;++k) 00119 vec.add(input); 00120 return vec; 00121 }


| MC_int_vector_vector & mesh_conv::MC_int_vector_vector::resize | ( | const int & | new_size | ) |
resize the vector in deleting value of adding zeros
Definition at line 38 of file MC_int_vector_vector.cpp.
References int_vec_list.
Referenced by empty(), mesh_conv::MC_connectivity_index::fliped_polygon(), mesh_conv::operator+(), and mesh_conv::operator-().
00039 { 00040 int N=int_vec_list.size(); 00041 if(N==new_size) //same size 00042 return *this; 00043 00044 if(new_size<0) 00045 {std::cout<<"Error in MC_int_vector_vector::resize("<<new_size<<") new size must be >0"<<std::endl;exit(-1);} 00046 00047 int_vec_list.resize(new_size); 00048 return *this; 00049 }

| MC_int_vector_vector & mesh_conv::MC_int_vector_vector::set | ( | const MC_int_vector & | k_index, | |
| const MC_int_vector_vector & | new_value | |||
| ) |
set an indexed value to a certain component. Adjust the size automatically
Definition at line 71 of file MC_int_vector_vector.cpp.
References first(), repeat(), mesh_conv::MC_int_vector::size(), and size().
00072 { 00073 MC_int_vector_vector v_new_value=new_value; 00074 if(new_value.size()!=1 && new_value.size()!=k_index.size()) 00075 {std::cout<<"Error in MC_int_vector_vector::set(MC_int_vector,MC_int_vector_vector), size are not correct: "<<k_index.size()<<","<<new_value.size()<<std::endl;exit(-1);} 00076 if(new_value.size()==1) 00077 v_new_value=MC_int_vector_vector::repeat(new_value.first(),k_index.size()); 00078 00079 00080 int N=v_new_value.size(); 00081 for(int k=0;k<N;k++) 00082 set(k_index[k],v_new_value[k]); 00083 return *this; 00084 }

| MC_int_vector_vector & mesh_conv::MC_int_vector_vector::set | ( | const int & | k_index, | |
| const MC_int_vector & | new_value | |||
| ) |
set an indexed value to a certain component. Adjust the size automatically
Definition at line 62 of file MC_int_vector_vector.cpp.
References int_vec_list, and size().
00063 { 00064 if(k_index<0) 00065 {std::cout<<"Error in MC_int_vector_vector::set("<<k_index<<","<<new_value<<"), index must be >0"<<std::endl;exit(-1);} 00066 if(k_index>=size()) 00067 int_vec_list.resize(k_index+1); 00068 int_vec_list[k_index]=new_value; 00069 return *this; 00070 }

| int mesh_conv::MC_int_vector_vector::size | ( | ) | const |
get the size of the vector
Definition at line 33 of file MC_int_vector_vector.cpp.
References int_vec_list.
Referenced by add(), mesh_conv::MC_grid_index_spatial_hashing::add_sphere(), mesh_conv::MC_connectivity_index::boundary(), mesh_conv::MC_mesh_index_vector::boundary_curve(), mesh_conv::MC_connectivity_index::build_ring(), mesh_conv::MC_connectivity_index::build_star(), delete_index(), mesh_conv::MC_opengl_drawer::draw(), mesh_conv::MC_connectivity_index::edges(), first(), mesh_conv::MC_connectivity_index::fliped_polygon(), mesh_conv::MC_grid_3d< VALUE >::get(), mesh_conv::MC_mesh_index_vector::get_polygon(), mesh_conv::MC_connectivity_index::is_triangle_only(), last(), mesh_conv::MC_mesh_fast_draw::MC_mesh_fast_draw(), mesh_conv::MC_grid_index_spatial_hashing::neighboors_index_in_radius(), operator()(), mesh_conv::operator+(), mesh_conv::operator-(), mesh_conv::operator<<(), mesh_conv::MC_connectivity_index::polygon_neighbors(), mesh_conv::MC_mesh_index_vector::polygon_number(), mesh_conv::MC_mesh_index_vector::polygon_size(), set(), mesh_conv::MC_mesh_fast_draw::set_connectivity(), mesh_conv::MC_mesh_index_vector::texture_convert_planar_xy_same_connectivity(), mesh_conv::MC_connectivity_index::triangulated(), mesh_conv::MC_connectivity_index::update_neighbors(), mesh_conv::MC_connectivity_index::used_vertex(), and mesh_conv::MC_io_obj::write_obj().
00034 {return int_vec_list.size();}
| MC_int_vector_vector operator+ | ( | const MC_int_vector_vector & | vec, | |
| const int & | to_add | |||
| ) | [friend] |
add an int to all the entries
| MC_int_vector_vector operator- | ( | const MC_int_vector_vector & | vec, | |
| const int & | to_add | |||
| ) | [friend] |
substract an int to all the entries
| std::ostream& operator<< | ( | std::ostream & | stream, | |
| const MC_int_vector_vector & | input | |||
| ) | [friend] |
| MC_int_vector_vector operator<< | ( | const MC_int_vector_vector & | vec, | |
| const MC_int_vector_vector & | to_add | |||
| ) | [friend] |
add some values at the end of the vertex
| MC_int_vector_vector operator<< | ( | const MC_int_vector_vector & | vec, | |
| const MC_int_vector & | value | |||
| ) | [friend] |
add a value at the end of the vertex
std::vector<MC_int_vector> mesh_conv::MC_int_vector_vector::int_vec_list [private] |
internal storage as a std::vector <MC_int_vector>
Definition at line 216 of file MC_int_vector_vector.hpp.
Referenced by add(), assert_bounds(), clear(), delete_index(), first(), last(), MC_int_vector_vector(), operator()(), operator[](), pointer(), pointer_unprotected(), resize(), set(), and size().
1.6.1