#include <int_vector.h>

Public Member Functions | |
| int_vector () | |
| int_vector (const int_vector &) | |
| int_vector (const std::vector< int > &) | |
| ~int_vector () | |
| int | size () const |
| int | resize (int _size) |
| int & | operator[] (int k_vertex) |
| int | operator[] (int k_vertex) const |
| int_vector & | operator= (const int_vector &) |
| int | add_unique (int k_index) |
| int | add (int k_vertex) |
| int | add (const std::vector< int > &_int_list) |
| int | exists (int index_to_find) const |
| check if the index exist. | |
Private Attributes | |
| std::vector< int > | int_list |
Friends | |
| bool | operator== (const int_vector &cont_1, const int_vector &cont_2) |
| bool | operator!= (const int_vector &cont_1, const int_vector &cont_2) |
Definition at line 43 of file int_vector.h.
| int_vector::int_vector | ( | ) |
| int_vector::int_vector | ( | const int_vector & | _V | ) |
Definition at line 29 of file int_vector.cpp.
References int_list.
00029 : 00030 int_list() 00031 { 00032 int_list.resize(_V.int_list.size()); 00033 for(int k=0;k<int(int_list.size());int_list[k]=_V.int_list[k],k++); 00034 } int_vector::int_vector(const std::vector<int>& _V):
| int_vector::int_vector | ( | const std::vector< int > & | _V | ) |
| int_vector::~int_vector | ( | ) |
Definition at line 42 of file int_vector.cpp.
References int_list.
00043 { 00044 int_list.resize(0); 00045 }
| int int_vector::size | ( | ) | const |
Definition at line 47 of file int_vector.cpp.
References int_list.
Referenced by Mesh_object::build_normal_intermediate(), Mesh_object::build_normal_per_vertex(), exists(), Mesh_object::Laplacien_smooth(), and operator==().
00048 { 00049 return int_list.size(); 00050 }

| int int_vector::resize | ( | int | _size | ) |
Definition at line 52 of file int_vector.cpp.
References int_list.
Referenced by Mesh_object::fast_subdivide_barycenter_mid_edge(), and Mesh_object::fast_subdivide_mixed_mid_edge().
00053 { 00054 if(_size>=0) 00055 { 00056 int_list.resize(_size); 00057 return(0); 00058 } 00059 else 00060 {printf("error in resize in int_vector, size[%d] is not correct\n",_size);exit(-1);} 00061 00062 return(-1); 00063 }

| int & int_vector::operator[] | ( | int | k_vertex | ) |
Definition at line 65 of file int_vector.cpp.
References int_list.
00066 { 00067 if(k_vertex<0 || k_vertex>=int(int_list.size())) 00068 {printf("Error in operator [] in int_vector, k_vertex [%d] is not correct because int_list.size()=[%d] \n",k_vertex,int_list.size());exit(-1);} 00069 return int_list[k_vertex]; 00070 }
| int int_vector::operator[] | ( | int | k_vertex | ) | const |
Definition at line 71 of file int_vector.cpp.
References int_list.
00072 { 00073 if(k_vertex<0 || k_vertex>=int(int_list.size())) 00074 {printf("Error in operator [] in int_vector, k_vertex [%d] is not correct because int_list.size()=[%d] \n",k_vertex,int_list.size());exit(-1);} 00075 return int_list[k_vertex]; 00076 }
| int_vector & int_vector::operator= | ( | const int_vector & | _V | ) |
| int int_vector::add_unique | ( | int | k_index | ) |
Definition at line 88 of file int_vector.cpp.
References int_list.
00089 { 00090 int k=0; 00091 for(k=0;k<int(int_list.size());k++)//go through the entire list 00092 if(int_list[k]==k_index)//if already exists 00093 return(-1); 00094 00095 int_list.push_back(k_index);//in the other case, add the vertex number 00096 return 0; 00097 }
| int int_vector::add | ( | int | k_vertex | ) |
Definition at line 99 of file int_vector.cpp.
References int_list.
00100 { 00101 int_list.push_back(k_vertex); 00102 return(0); 00103 }
| int int_vector::add | ( | const std::vector< int > & | _int_list | ) |
Definition at line 105 of file int_vector.cpp.
00106 { 00107 int k=0; 00108 for(k=0;k<int(_int_list.size());k++) 00109 add(_int_list[k]); 00110 return 0; 00111 }
| int int_vector::exists | ( | int | index_to_find | ) | const |
check if the index exist.
If the index already exists, returns its index Else return -1
Definition at line 113 of file int_vector.cpp.
References int_list, and size().
00114 { 00115 int k=0; 00116 int N=size(); 00117 for(k=0;k<N;k++) 00118 if(index_to_find==int_list[k]) 00119 return k; 00120 return -1; 00121 }

| bool operator== | ( | const int_vector & | cont_1, | |
| const int_vector & | cont_2 | |||
| ) | [friend] |
Definition at line 123 of file int_vector.cpp.
00124 { 00125 if(cont_1.size()!=cont_2.size()) 00126 return 0; 00127 for(int k=0;k<cont_1.size();k++) 00128 if(cont_1[k]!=cont_2[k]) 00129 return 0; 00130 return 1; 00131 }
| bool operator!= | ( | const int_vector & | cont_1, | |
| const int_vector & | cont_2 | |||
| ) | [friend] |
std::vector<int> int_vector::int_list [private] |
Definition at line 72 of file int_vector.h.
Referenced by add(), add_unique(), exists(), int_vector(), operator=(), operator[](), resize(), size(), and ~int_vector().
1.5.6