mesh_conv::MC_v3d_vector Class Reference

Container class for a vector of MC_v3d. More...

#include <MC_v3d_vector.hpp>

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

List of all members.

Public Member Functions

 MC_v3d_vector ()
 empty constructor, void vector
 MC_v3d_vector (const int &new_size)
 constructor of a zeros vector of a given size
 MC_v3d_vector (const MC_v3d &v0)
 direct constructor with a MC_v3d
 MC_v3d_vector (const MC_v3d &v0, const MC_v3d &v1)
 direct constructor with a MC_v3d
 MC_v3d_vector (const MC_v3d &v0, const MC_v3d &v1, const MC_v3d &v2)
 direct constructor with a MC_v3d
 MC_v3d_vector (const MC_v3d &v0, const MC_v3d &v1, const MC_v3d &v2, const MC_v3d &v3)
 direct constructor with a MC_v3d
 MC_v3d_vector (const MC_v3d &v0, const MC_v3d &v1, const MC_v3d &v2, const MC_v3d &v3, const MC_v3d &v4)
 direct constructor with a MC_v3d
 MC_v3d_vector (const MC_v3d_vector &vec)
 copy constructor
 MC_v3d_vector (const std::vector< MC_v3d > &vec)
 direct constructor from a vector of MC_v3d
 MC_v3d_vector (const std::set< MC_v3d, MC_v3d_less > set)
 direct constructor from a set of MC_v3d
 MC_v3d_vector (const std::map< MC_v3d, int, MC_v3d_less > map)
 direct constructor from a map of MC_v3d
 MC_v3d_vector (const MC_double_vector &x_vector, const MC_double_vector &y_vector, const MC_double_vector &z_vector)
 direct constructor from a vector of x,y and z coordinates
virtual ~MC_v3d_vector ()
 destructor
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_v3d_vectorresize (const int &new_size)
 resize the vector in deleting value of adding zeros
MC_v3d_vectoradd (const MC_v3d &x)
 push back a R3 vector
MC_v3d_vectoradd (const MC_v3d_vector &v_x)
 push back a vector of MC_v3d&
MC_v3d_vectorset (const int &k_index, const MC_v3d &x)
MC_v3d_vectorset (const mesh_conv::MC_int_vector &k_index, const MC_v3d_vector &x)
const MC_v3dfirst () const
 return the first element (error if the list is empty)
MC_v3dfirst ()
 return the first element (error if the list is empty)
const MC_v3dlast () const
 return the last element (error if the list is empty)
MC_v3dlast ()
 return the last element (error if the list is empty)
MC_double_vector component (const int &k_dim) const
 extract one of the dimension of the vector
MC_v3d_vector removed (const MC_int_vector &index_to_remove) const
 remove the k-th entry of the vector
MC_v3d_vector operator- () const
 change the opposite sign of the current vector (unary negation)
MC_v3d_vectoroperator+= (const MC_v3d &to_add)
 internal add a value
MC_v3d_vectoroperator-= (const MC_v3d &to_sub)
 internal substraction
MC_v3d_vectoroperator*= (const double &to_mult)
 internal multiplication
MC_v3d_vectoroperator/= (const double &to_subdiv)
 internal divide
MC_v3d_vectoroperator+= (const MC_v3d_vector &to_add)
 internal add values
MC_v3d_vectoroperator-= (const MC_v3d_vector &to_sub)
 internal substraction
MC_v3d_vectoroperator*= (const MC_matrix &M)
 internal application of a matrix to the vector of MC_v3d (does the product x'=M*x)
MC_v3d_vectoroperator*= (const MC_double_vector &w)
 internal pointwise multiplication by a MC_double_vector
MC_v3d_vector normalized () const
 normalize each vector independently
MC_v3d_vectorscale (const MC_v3d_vector &s)
 internal scale the set of point by multipling componentwise with a v3d
std::pair< MC_v3d_vector, double > scaled_to_unit () const
 homogeneous scale the point set to fit into [0,1] (do not center it)
MC_v3d barycenter () const
 get the barycenter of the positions
std::pair< MC_v3d_vector,
MC_matrix
scaled_to_unit_and_center () const
 homogeneous scale the point set to fit into [0,1] and center it
const MC_v3doperator() (const int &k_index) const
 get operator
MC_v3doperator() (const int &k_index)
 get operator
const MC_v3doperator[] (const int &k_index) const
 get operator
MC_v3doperator[] (const int &k_index)
 get operator
MC_v3d_vector operator() (const MC_int_vector &index) const
 get a subset of the vector
MC_v3d_vector operator[] (const MC_int_vector &index) const
 get a subset of the vector
const MC_v3dpointer () const
 get pointer
MC_v3dpointer_unprotected ()
 get pointer
std::map< MC_v3d, int,
MC_v3d_less
to_map () const
 convert to std::map (coords is key and store the position as value)
std::set< MC_v3d, MC_v3d_lessto_set () const
 convert to std::set
std::list< MC_v3dto_list () const
 convert to list in the same order
std::pair< MC_v3d, MC_v3dbounding_box_elements () const
 get the extreme position min and max
MC_v3d bounding_box_length () const
 return the length in x,y,z coordinates of the bounding box
std::vector< MC_segmentbounding_box_segment (const double &length_ratio=0.1) const
 return a set of segment that can be used to draw the bounding box
std::ostream & export_stream (std::ostream &output) const
 write to a stream in a transfering format (each coordinate separated by a space)
MC_v3d_vectorread_stream (std::istream &input)
 read from a stream in a transfering format (each coordinate separated by a space)
std::pair< MC_v3d, int > closest (const MC_v3d &x) const
 Points contained in a given box.
MC_v3d_vector inverted_position () const

Static Public Member Functions

static MC_v3d_vector build_from_concatenated_vector (const MC_double_vector &X)
 static constructor from concatenated vector (x0,y0,z0,x1,y1,z1,x2,...,zn)
static MC_v3d_vector zeros (const int &new_size)
 build a vector of size new_size filled with zero
static MC_v3d_vector build_duplicate (const unsigned int &N, const MC_v3d &value_to_duplicate)
 duplicate N times a given vector
static MC_v3d sum (const MC_v3d_vector &vec)
 do a summation over the MC_v3d_vector
static MC_double_vector norm (const MC_v3d_vector &vec)
 return the norm a the vector independently
static MC_v3d_vector laplacian_deformation (const MC_v3d_vector &vertex_input, const std::map< int, std::pair< MC_int_vector, MC_double_vector > > &laplacian_mean_value, const std::pair< MC_int_vector, MC_v3d_vector > &constraints)
 Laplacian deformation with constraints.

Protected Attributes

std::vector< MC_v3dv
 internal storage

Friends

MC_v3d_vector operator<< (const MC_v3d_vector &vec, const MC_v3d &value)
 add a value at the end of the vertex
MC_v3d_vector operator<< (const MC_v3d_vector &vec, const MC_v3d_vector &value)
 add a vector of values at the end of the vertex
MC_v3d_vector operator+ (const MC_v3d_vector &vec, const MC_v3d &to_add)
 add a MC_v3d value to the vector
MC_v3d_vector operator+ (const MC_v3d &to_add, const MC_v3d_vector &vec)
 add a MC_v3d value to the vector
MC_v3d_vector operator- (const MC_v3d_vector &vec, const MC_v3d &to_sub)
 substract a MC_v3d value to the vector
MC_v3d_vector operator* (const MC_v3d_vector &vec, const double &to_mult)
 multiply a double value to the vector
MC_v3d_vector operator* (const double &to_mult, const MC_v3d_vector &vec)
 multiply a double value to the vector
MC_v3d_vector operator/ (const MC_v3d_vector &vec, const double &to_subdiv)
 divide a double value to the vector
MC_v3d_vector operator+ (const MC_v3d_vector &vec, const MC_v3d_vector &to_add)
 add a set of value to the vector
MC_v3d_vector operator- (const MC_v3d_vector &vec, const MC_v3d_vector &to_sub)
 substract a v3d value to the vector
MC_v3d_vector operator* (const MC_matrix &M, const MC_v3d_vector &vec)
 apply a matrix to the vector of MC_v3d
MC_v3d_vector operator* (const MC_double_vector w, const MC_v3d_vector &vec)
 apply a pointwise multiplication by a MC_double_vector
MC_v3d_vector operator* (const MC_v3d_vector &vec, const MC_double_vector &w)
 apply a pointwise multiplication by a MC_double_vector
std::ostream & operator<< (std::ostream &output, const MC_v3d_vector &in)
 write to ostream the list (u0 u1 u2 ... )

Detailed Description

Container class for a vector of MC_v3d.

Internal structure is a std::vector<MV_v3d>

Definition at line 45 of file MC_v3d_vector.hpp.


Constructor & Destructor Documentation

mesh_conv::MC_v3d_vector::MC_v3d_vector (  ) 

empty constructor, void vector

Definition at line 16 of file MC_v3d_vector.cpp.

Referenced by mesh_conv::MC_curve::diff_forward(), mesh_conv::MC_curve::diff_forward_close(), and mesh_conv::MC_polygon::subdivide_barycenter_mid_edge().

00016 {}

Here is the caller graph for this function:

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const int &  new_size  ) 

constructor of a zeros vector of a given size

Definition at line 22 of file MC_v3d_vector.cpp.

References v.

00022 {v.resize(new_size);}

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const MC_v3d v0  ) 

direct constructor with a MC_v3d

Definition at line 17 of file MC_v3d_vector.cpp.

References v.

00017 {v.push_back(v0);}

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const MC_v3d v0,
const MC_v3d v1 
)

direct constructor with a MC_v3d

Definition at line 18 of file MC_v3d_vector.cpp.

References v.

00018 {v.push_back(v0);v.push_back(v1);}

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const MC_v3d v0,
const MC_v3d v1,
const MC_v3d v2 
)

direct constructor with a MC_v3d

Definition at line 19 of file MC_v3d_vector.cpp.

References v.

00019 {v.push_back(v0);v.push_back(v1);v.push_back(v2);}

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const MC_v3d v0,
const MC_v3d v1,
const MC_v3d v2,
const MC_v3d v3 
)

direct constructor with a MC_v3d

Definition at line 20 of file MC_v3d_vector.cpp.

References v.

00020 {v.push_back(v0);v.push_back(v1);v.push_back(v2);v.push_back(v3);}

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const MC_v3d v0,
const MC_v3d v1,
const MC_v3d v2,
const MC_v3d v3,
const MC_v3d v4 
)

direct constructor with a MC_v3d

Definition at line 21 of file MC_v3d_vector.cpp.

References v.

00021 {v.push_back(v0);v.push_back(v1);v.push_back(v2);v.push_back(v3);v.push_back(v4);}

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const MC_v3d_vector vec  ) 

copy constructor

Definition at line 37 of file MC_v3d_vector.cpp.

References v.

00038     {
00039         int N=vec.v.size();
00040         for(int k=0;k<N;k++)
00041             v.push_back(vec.v[k]);
00042     }

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const std::vector< MC_v3d > &  vec  ) 

direct constructor from a vector of MC_v3d

Definition at line 43 of file MC_v3d_vector.cpp.

References v.

00044     {
00045         int N=vec.size();
00046         for(int k=0;k<N;k++)
00047             v.push_back(vec[k]);
00048     }

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const std::set< MC_v3d, MC_v3d_less set  ) 

direct constructor from a set of MC_v3d

Definition at line 49 of file MC_v3d_vector.cpp.

References v.

00050     {
00051         std::set <MC_v3d,mesh_conv::MC_v3d_less> :: const_iterator it;
00052         std::set <MC_v3d,mesh_conv::MC_v3d_less> :: const_iterator it_end=set.end();
00053 
00054         for(it=set.begin();it!=it_end;++it)
00055             v.push_back(*it);
00056     }

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const std::map< MC_v3d, int, MC_v3d_less map  ) 

direct constructor from a map of MC_v3d

Definition at line 57 of file MC_v3d_vector.cpp.

00058     {
00059         std::map <MC_v3d,int,mesh_conv::MC_v3d_less> :: const_iterator it;
00060         std::map <MC_v3d,int,mesh_conv::MC_v3d_less> :: const_iterator it_end=map.end();
00061 
00062         for(it=map.begin();it!=map.end();++it)
00063             set(it->second,it->first);
00064     }

mesh_conv::MC_v3d_vector::MC_v3d_vector ( const MC_double_vector x_vector,
const MC_double_vector y_vector,
const MC_double_vector z_vector 
)

direct constructor from a vector of x,y and z coordinates

Definition at line 353 of file MC_v3d_vector.cpp.

References mesh_conv::MC_double_vector::size(), and v.

00354     {
00355         // check size
00356         if(x_vector.size()!=y_vector.size() || x_vector.size()!=z_vector.size())
00357         {std::cout<<"Error in MC_v3d_vector::MC_v3d_vector(MC_double_vector("<<x_vector.size()<<"),MC_double_vector("<<y_vector.size()<<"),MC_double_vector("<<z_vector.size()<<")), size are not consistent"<<std::endl;exit(-1);}
00358 
00359         int N=x_vector.size();
00360         v.resize(N);
00361         for(int k=0;k<N;k++)
00362         {
00363             v[k][0]=x_vector[k];
00364             v[k][1]=y_vector[k];
00365             v[k][2]=z_vector[k];
00366         }
00367     }

Here is the call graph for this function:

virtual mesh_conv::MC_v3d_vector::~MC_v3d_vector (  )  [inline, virtual]

destructor

Definition at line 92 of file MC_v3d_vector.hpp.

00092 {}


Member Function Documentation

MC_v3d_vector & mesh_conv::MC_v3d_vector::add ( const MC_v3d_vector v_x  ) 

push back a vector of MC_v3d&

Returns:
the new vector

Definition at line 67 of file MC_v3d_vector.cpp.

References size(), and v.

00068     {
00069         int N=v_x.size();
00070         for(int k=0;k<N;k++)
00071             v.push_back(v_x[k]);
00072         return *this;
00073     }

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::add ( const MC_v3d x  ) 

push back a R3 vector

Returns:
the new vector

Definition at line 65 of file MC_v3d_vector.cpp.

References v.

Referenced by mesh_conv::MC_mesh_index_vector::add_unique_polygon(), mesh_conv::MC_mesh_index_vector::add_vertex(), mesh_conv::MC_curve::build_B_spline(), mesh_conv::MC_mesh_index_vector::build_closed_cylinder(), mesh_conv::MC_curve::build_heart(), mesh_conv::MC_mesh_index_vector::build_parametric_sphere(), mesh_conv::MC_mesh_index_vector::build_square(), mesh_conv::MC_curve::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(), 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_polygon::half_space_intersection(), mesh_conv::MC_mesh_index_vector::normal_vertex(), mesh_conv::MC_polygon::plane_intersection(), mesh_conv::MC_curve::read_lin(), mesh_conv::MC_io_obj::read_obj(), mesh_conv::MC_io_obj::read_obj_texture(), mesh_conv::MC_io_off::read_off(), read_stream(), removed(), mesh_conv::MC_mesh_index_vector::segment_intersection(), 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_polygon::subdivide_mid_edge_no_constraint(), 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(), and mesh_conv::MC_mesh_index_vector::sweep_surface().

00066     {v.push_back(x);return *this;}

void mesh_conv::MC_v3d_vector::assert_bounds ( const int &  u  )  const

Assert the value stays within the bounds.

Returns:
nothing, but stop the programm if it goes outside bounds

Definition at line 26 of file MC_v3d_vector.cpp.

References v.

Referenced by operator()(), and operator[]().

00027     {
00028         if(u<0 || u>=int(v.size()))
00029         {std::cout<<"Assert mesh_conv::MC_v3d_vector::assert_bounds("<<u<<") failed, because size="<<v.size()<<std::endl;exit(-1);}
00030     }

Here is the caller graph for this function:

MC_v3d mesh_conv::MC_v3d_vector::barycenter (  )  const

get the barycenter of the positions

Reimplemented in mesh_conv::MC_curve, mesh_conv::MC_polygon, and mesh_conv::MC_triangle.

Definition at line 469 of file MC_v3d_vector.cpp.

References size(), and sum().

00470     {
00471         return MC_v3d_vector::sum(*this)/size();
00472     }

Here is the call graph for this function:

std::pair< MC_v3d, MC_v3d > mesh_conv::MC_v3d_vector::bounding_box_elements (  )  const

get the extreme position min and max

Returns:
min
max

Definition at line 491 of file MC_v3d_vector.cpp.

References first(), size(), and v.

Referenced by bounding_box_length(), bounding_box_segment(), and scaled_to_unit().

00492     {
00493         MC_v3d x_max=first(),x_min=first();
00494         int N=size();
00495         for(int k=0;k<N;++k)
00496         {
00497             MC_v3d x=v[k];
00498 
00499             for(int k_dim=0;k_dim<3;++k_dim)
00500             {
00501                 if(x_max[k_dim]<x[k_dim])
00502                     x_max[k_dim]=x[k_dim];
00503                 if(x_min[k_dim]>x[k_dim])
00504                     x_min[k_dim]=x[k_dim];
00505             }
00506         }
00507         return std::pair <MC_v3d,MC_v3d> (x_min,x_max);
00508     }

Here is the call graph for this function:

Here is the caller graph for this function:

MC_v3d mesh_conv::MC_v3d_vector::bounding_box_length (  )  const

return the length in x,y,z coordinates of the bounding box

Definition at line 510 of file MC_v3d_vector.cpp.

References bounding_box_elements().

Referenced by scaled_to_unit().

00511     {
00512         std::pair <MC_v3d,MC_v3d> bb=bounding_box_elements();
00513         return bb.second-bb.first;
00514     }

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< MC_segment > mesh_conv::MC_v3d_vector::bounding_box_segment ( const double &  length_ratio = 0.1  )  const

return a set of segment that can be used to draw the bounding box

Parameters:
double length_ratio is the relative length of the box (0 beeing nothing and 1 beeing the full box). Default: 0.1

Definition at line 548 of file MC_v3d_vector.cpp.

References bounding_box_elements().

00549     {
00550         std::pair <MC_v3d,MC_v3d> bb=bounding_box_elements();
00551 
00552         double min_length=std::min(std::min(
00553                 std::fabs(bb.second[0]-bb.first[0]),
00554                 std::fabs(bb.second[1]-bb.first[1])),
00555                                    std::fabs(bb.second[2]-bb.first[2]));
00556 
00557         double actual_length=0.5*min_length*length_ratio;
00558 
00559         std::vector <MC_segment> v_seg;
00560 
00561         double epsilon=0.00001;
00562         if( std::fabs(length_ratio-1.0)>epsilon )
00563         {
00564             v_seg.push_back(bb.first+MC_segment(MC_v3d(0,0,0),MC_v3d(actual_length,0,0)));
00565             v_seg.push_back(bb.first+MC_segment(MC_v3d(0,0,0),MC_v3d(0,actual_length,0)));
00566             v_seg.push_back(bb.first+MC_segment(MC_v3d(0,0,0),MC_v3d(0,0,actual_length)));
00567 
00568             v_seg.push_back(bb.first.mask(0,1,1)+bb.second.mask(1,0,0)+MC_segment(MC_v3d(0,0,0),MC_v3d(-actual_length,0,0)));
00569             v_seg.push_back(bb.first.mask(0,1,1)+bb.second.mask(1,0,0)+MC_segment(MC_v3d(0,0,0),MC_v3d(0,actual_length,0)));
00570             v_seg.push_back(bb.first.mask(0,1,1)+bb.second.mask(1,0,0)+MC_segment(MC_v3d(0,0,0),MC_v3d(0,0,actual_length)));
00571 
00572             v_seg.push_back(bb.first.mask(1,0,1)+bb.second.mask(0,1,0)+MC_segment(MC_v3d(0,0,0),MC_v3d(actual_length,0,0)));
00573             v_seg.push_back(bb.first.mask(1,0,1)+bb.second.mask(0,1,0)+MC_segment(MC_v3d(0,0,0),MC_v3d(0,-actual_length,0)));
00574             v_seg.push_back(bb.first.mask(1,0,1)+bb.second.mask(0,1,0)+MC_segment(MC_v3d(0,0,0),MC_v3d(0,0,actual_length)));
00575 
00576             v_seg.push_back(bb.first.mask(1,1,0)+bb.second.mask(0,0,1)+MC_segment(MC_v3d(0,0,0),MC_v3d(actual_length,0,0)));
00577             v_seg.push_back(bb.first.mask(1,1,0)+bb.second.mask(0,0,1)+MC_segment(MC_v3d(0,0,0),MC_v3d(0,actual_length,0)));
00578             v_seg.push_back(bb.first.mask(1,1,0)+bb.second.mask(0,0,1)+MC_segment(MC_v3d(0,0,0),MC_v3d(0,0,-actual_length)));
00579 
00580 
00581             v_seg.push_back(bb.first.mask(0,0,1)+bb.second.mask(1,1,0)+MC_segment(MC_v3d(0,0,0),MC_v3d(-actual_length,0,0)));
00582             v_seg.push_back(bb.first.mask(0,0,1)+bb.second.mask(1,1,0)+MC_segment(MC_v3d(0,0,0),MC_v3d(0,-actual_length,0)));
00583             v_seg.push_back(bb.first.mask(0,0,1)+bb.second.mask(1,1,0)+MC_segment(MC_v3d(0,0,0),MC_v3d(0,0,actual_length)));
00584 
00585             v_seg.push_back(bb.first.mask(0,1,0)+bb.second.mask(1,0,1)+MC_segment(MC_v3d(0,0,0),MC_v3d(-actual_length,0,0)));
00586             v_seg.push_back(bb.first.mask(0,1,0)+bb.second.mask(1,0,1)+MC_segment(MC_v3d(0,0,0),MC_v3d(0,actual_length,0)));
00587             v_seg.push_back(bb.first.mask(0,1,0)+bb.second.mask(1,0,1)+MC_segment(MC_v3d(0,0,0),MC_v3d(0,0,-actual_length)));
00588 
00589             v_seg.push_back(bb.first.mask(1,0,0)+bb.second.mask(0,1,1)+MC_segment(MC_v3d(0,0,0),MC_v3d(actual_length,0,0)));
00590             v_seg.push_back(bb.first.mask(1,0,0)+bb.second.mask(0,1,1)+MC_segment(MC_v3d(0,0,0),MC_v3d(0,-actual_length,0)));
00591             v_seg.push_back(bb.first.mask(1,0,0)+bb.second.mask(0,1,1)+MC_segment(MC_v3d(0,0,0),MC_v3d(0,0,-actual_length)));
00592 
00593             v_seg.push_back(bb.second+MC_segment(MC_v3d(0,0,0),MC_v3d(-actual_length,0,0)));
00594             v_seg.push_back(bb.second+MC_segment(MC_v3d(0,0,0),MC_v3d(0,-actual_length,0)));
00595             v_seg.push_back(bb.second+MC_segment(MC_v3d(0,0,0),MC_v3d(0,0,-actual_length)));
00596         }
00597         else
00598         {
00599             v_seg.push_back(MC_segment(bb.first,bb.first.mask(0,1,1)+bb.second.mask(1,0,0)));
00600             v_seg.push_back(MC_segment(bb.first,bb.first.mask(1,0,1)+bb.second.mask(0,1,0)));
00601             v_seg.push_back(MC_segment(bb.first,bb.first.mask(1,1,0)+bb.second.mask(0,0,1)));
00602 
00603             v_seg.push_back(MC_segment(bb.second,bb.first.mask(0,0,1)+bb.second.mask(1,1,0)));
00604             v_seg.push_back(MC_segment(bb.second,bb.first.mask(0,1,0)+bb.second.mask(1,0,1)));
00605             v_seg.push_back(MC_segment(bb.second,bb.first.mask(1,0,0)+bb.second.mask(0,1,1)));
00606 
00607             v_seg.push_back(MC_segment(bb.first.mask(0,1,1)+bb.second.mask(1,0,0),bb.first.mask(0,0,1)+bb.second.mask(1,1,0)));
00608             v_seg.push_back(MC_segment(bb.first.mask(0,1,1)+bb.second.mask(1,0,0),bb.first.mask(0,1,0)+bb.second.mask(1,0,1)));
00609 
00610             v_seg.push_back(MC_segment(bb.first.mask(1,0,1)+bb.second.mask(0,1,0),bb.first.mask(0,0,1)+bb.second.mask(1,1,0)));
00611             v_seg.push_back(MC_segment(bb.first.mask(1,0,1)+bb.second.mask(0,1,0),bb.first.mask(1,0,0)+bb.second.mask(0,1,1)));
00612 
00613             v_seg.push_back(MC_segment(bb.first.mask(1,1,0)+bb.second.mask(0,0,1),bb.first.mask(1,0,0)+bb.second.mask(0,1,1)));
00614             v_seg.push_back(MC_segment(bb.first.mask(1,1,0)+bb.second.mask(0,0,1),bb.first.mask(0,1,0)+bb.second.mask(1,0,1)));
00615 
00616         }
00617 
00618         return v_seg;
00619     }

Here is the call graph for this function:

MC_v3d_vector mesh_conv::MC_v3d_vector::build_duplicate ( const unsigned int &  N,
const MC_v3d value_to_duplicate 
) [static]

duplicate N times a given vector

Definition at line 681 of file MC_v3d_vector.cpp.

References resize().

00682     {
00683         MC_v3d_vector vec;
00684         vec.resize(N);
00685         for(int k=0;k<N;++k)
00686             vec[k]=value_to_duplicate;
00687         return vec;
00688     }

Here is the call graph for this function:

MC_v3d_vector mesh_conv::MC_v3d_vector::build_from_concatenated_vector ( const MC_double_vector X  )  [static]

static constructor from concatenated vector (x0,y0,z0,x1,y1,z1,x2,...,zn)

Definition at line 659 of file MC_v3d_vector.cpp.

References mesh_conv::MC_double_vector::size(), and zeros().

00660     {
00661         if(X.size()%3!=0)
00662         {std::cout<<"Error in MC_v3d_vector::build_from_concatenated_vector(), size is not correct"<<std::endl;exit(-1);}
00663         MC_v3d_vector y=MC_v3d_vector::zeros(X.size()/3);
00664         for(int k=0,N=X.size()/3;k<N;++k)
00665             for(int k_dim=0;k_dim<3;++k_dim)
00666                 y[k][k_dim]=X[3*k+k_dim];
00667         return y;
00668     }

Here is the call graph for this function:

void mesh_conv::MC_v3d_vector::clear (  ) 

clear the vector to size 0

Definition at line 101 of file MC_v3d_vector.cpp.

References v.

00102     {v.clear();}

std::pair< MC_v3d, int > mesh_conv::MC_v3d_vector::closest ( const MC_v3d x  )  const

Points contained in a given box.

return the closest point and its index of a given one

Definition at line 621 of file MC_v3d_vector.cpp.

References norm(), size(), and v.

Referenced by mesh_conv::MC_polygon::closest_point(), and mesh_conv::MC_curve::skinning().

00622     {
00623         double min_dist=0;
00624         int k_min=-1;
00625         MC_v3d record_min;
00626         for(int k=0,N=size();k<N;++k)
00627         {
00628             const MC_v3d& y=v[k];
00629             double current_dist=(y-x).norm();
00630             if(current_dist<min_dist || k==0)
00631             {
00632                 min_dist=current_dist;
00633                 k_min=k;
00634                 record_min=y;
00635             }
00636         }
00637         return std::make_pair(record_min,k_min);
00638     }

Here is the call graph for this function:

Here is the caller graph for this function:

MC_double_vector mesh_conv::MC_v3d_vector::component ( const int &  k_dim  )  const

extract one of the dimension of the vector

Definition at line 342 of file MC_v3d_vector.cpp.

References size(), v, and zeros().

Referenced by mesh_conv::MC_matrix::rotation_axis_to_axis_with_gradient().

00343     {
00344         if(k_dim<0 || k_dim>3)
00345         {std::cout<<"Error in MC_v3d_vector::component("<<k_dim<<"), k_dim must be in [0,2]"<<std::endl;exit(-1);}
00346         int N=size();
00347         MC_double_vector vec=MC_double_vector::zeros(N);
00348         for(int k=0;k<N;k++)
00349             vec[k]=v[k][k_dim];
00350         return vec;
00351     }

Here is the call graph for this function:

Here is the caller graph for this function:

std::ostream & mesh_conv::MC_v3d_vector::export_stream ( std::ostream &  output  )  const

write to a stream in a transfering format (each coordinate separated by a space)

Definition at line 528 of file MC_v3d_vector.cpp.

References size(), and v.

00529     {
00530         int N=size();
00531         for(int k=0;k<N;++k)
00532             output<<v[k][0]<<" "<<v[k][1]<<" "<<v[k][2]<<" ";
00533         return output;
00534     }

Here is the call graph for this function:

MC_v3d & mesh_conv::MC_v3d_vector::first (  ) 

return the first element (error if the list is empty)

Definition at line 276 of file MC_v3d_vector.cpp.

References size(), and v.

00277     {
00278         if(size()>0)
00279             return v[0];
00280         else
00281         {
00282             std::cout<<"Error, call MC_v3d_vector::first() with size=0"<<std::endl;exit(-1);
00283             exit(-1);
00284         }
00285     }

Here is the call graph for this function:

const MC_v3d & mesh_conv::MC_v3d_vector::first (  )  const
MC_v3d_vector mesh_conv::MC_v3d_vector::inverted_position (  )  const

Invert the vector last<->first

Definition at line 653 of file MC_v3d_vector.cpp.

References mesh_conv::MC_int_vector::linspace(), and size().

00654     {
00655         MC_int_vector index=MC_int_vector::linspace(size()-1,0,-1);
00656         return (*this)(index);
00657     }

Here is the call graph for this function:

static MC_v3d_vector mesh_conv::MC_v3d_vector::laplacian_deformation ( const MC_v3d_vector vertex_input,
const std::map< int, std::pair< MC_int_vector, MC_double_vector > > &  laplacian_mean_value,
const std::pair< MC_int_vector, MC_v3d_vector > &  constraints 
) [static]

Laplacian deformation with constraints.

Parameters:
MC_v3d_vector& the input vertices
std::map<int,std::pair<MC_int_vector,MC_double_vector> >& the map of the mean value coordinates
std::pair<MC_v3d_vector,MC_double_value> the per-vertex constraints (index and value)
Returns:
the new vertex positions
See also:
std::map <int,std::pair<MC_int_vector,std::pair<MC_double_vector,std::pair<MC_int_vector,MC_int_vector> > > > MC_mesh_cgal::laplacian_mean_value()

works for manifold using mean value coordinates

MC_v3d & mesh_conv::MC_v3d_vector::last (  ) 

return the last element (error if the list is empty)

Definition at line 296 of file MC_v3d_vector.cpp.

References size(), and v.

00297     {
00298         if(size()>0)
00299             return v[size()-1];
00300         else
00301         {
00302             std::cout<<"Error, call MC_v3d_vector::last() with size=0"<<std::endl;exit(-1);
00303         }
00304     }

Here is the call graph for this function:

const MC_v3d & mesh_conv::MC_v3d_vector::last (  )  const

return the last element (error if the list is empty)

Definition at line 287 of file MC_v3d_vector.cpp.

References size(), and v.

Referenced by mesh_conv::MC_curve::closed(), mesh_conv::MC_polygon::plane_intersection(), mesh_conv::MC_curve::unclosed(), and mesh_conv::MC_curve::value().

00288     {
00289         if(size()>0)
00290             return v[size()-1];
00291         else
00292         {
00293             std::cout<<"Error, call MC_v3d_vector::last() with size=0"<<std::endl;exit(-1);
00294         }
00295     }

Here is the call graph for this function:

Here is the caller graph for this function:

MC_double_vector mesh_conv::MC_v3d_vector::norm ( const MC_v3d_vector vec  )  [static]

return the norm a the vector independently

Definition at line 519 of file MC_v3d_vector.cpp.

References size(), and zeros().

Referenced by closest(), mesh_conv::MC_triangle::closest_point(), mesh_conv::MC_curve::closest_point(), mesh_conv::MC_triangle::inertia(), mesh_conv::MC_curve::isometric_deformation(), mesh_conv::MC_polygon::position(), mesh_conv::MC_polygon::projected_direction(), mesh_conv::MC_curve::read_lin(), and mesh_conv::MC_curve::skinning().

00520     {
00521         int N=vec.size();
00522         MC_double_vector n=MC_double_vector::zeros(N);
00523         for(int k=0;k<N;++k)
00524             n[k]=vec[k].norm();
00525         return n;
00526     }

Here is the call graph for this function:

Here is the caller graph for this function:

MC_v3d_vector mesh_conv::MC_v3d_vector::normalized (  )  const

normalize each vector independently

Definition at line 427 of file MC_v3d_vector.cpp.

References size(), and v.

Referenced by mesh_conv::MC_curve::build_circle(), mesh_conv::MC_mesh_index_vector::build_quad_sphere(), mesh_conv::MC_mesh_index_vector::build_sphere(), mesh_conv::MC_curve::isometric_deformation(), mesh_conv::MC_polygon::normal(), and mesh_conv::MC_mesh_index_vector::normal_vertex().

00428     {
00429         int N=size();MC_v3d_vector res(N);
00430         for(int k=0;k<N;++k)
00431             res[k]=v[k].normalized();
00432         return res;
00433     }

Here is the call graph for this function:

Here is the caller graph for this function:

MC_v3d_vector mesh_conv::MC_v3d_vector::operator() ( const MC_int_vector index  )  const

get a subset of the vector

Definition at line 314 of file MC_v3d_vector.cpp.

References mesh_conv::MC_int_vector::size(), size(), v, and zeros().

00315     {
00316 
00317         int N=size();
00318         int N_index=index.size();
00319 
00320         MC_v3d_vector vec=MC_v3d_vector::zeros(N_index);
00321         for(int k_index=0;k_index<N_index;k_index++)
00322         {
00323             int u_index=index[k_index];
00324             if(u_index<0 || u_index>=N)
00325             {std::cout<<"Error in MC_v3d_vector(MC_int_vector index), index["<<k_index<<"]="<<u_index<<", while size of vector is "<<N<<std::endl;exit(-1);}
00326 
00327             vec[k_index]=v[u_index];
00328         }
00329         return vec;
00330     }

Here is the call graph for this function:

MC_v3d & mesh_conv::MC_v3d_vector::operator() ( const int &  k_index  ) 

get operator

Definition at line 33 of file MC_v3d_vector.cpp.

References assert_bounds(), and v.

00033 {assert_bounds(k_index); return v[k_index];}

Here is the call graph for this function:

const MC_v3d & mesh_conv::MC_v3d_vector::operator() ( const int &  k_index  )  const

get operator

Definition at line 32 of file MC_v3d_vector.cpp.

References assert_bounds(), and v.

00032 {assert_bounds(k_index); return v[k_index];}

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::operator*= ( const MC_double_vector w  ) 

internal pointwise multiplication by a MC_double_vector

Warning:
the MC_double_vector must be the same size as the vector or of size 1

Definition at line 409 of file MC_v3d_vector.cpp.

References mesh_conv::MC_double_vector::first(), mesh_conv::MC_double_vector::size(), size(), and v.

00410     {
00411         int N=size();
00412         if(w.size()==1 && N!=1)
00413         {
00414             (*this)*=w.first();
00415             return *this;
00416         }
00417         else if(w.size()==N)
00418         {
00419             for(int k=0;k<N;++k)
00420                 v[k]*=w[k];
00421             return *this;
00422         }
00423         else
00424         {std::cout<<"Error in MC_v3d_vector*=(MC_double_vector), size are not compatible: "<<size()<<"!="<<w.size()<<std::endl;exit(-1);}
00425     }

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::operator*= ( const MC_matrix M  ) 

internal application of a matrix to the vector of MC_v3d (does the product x'=M*x)

Definition at line 378 of file MC_v3d_vector.cpp.

References size(), and v.

00379     {
00380         int N=size();
00381         for(int k=0;k<N;k++)
00382             v[k]*=M;
00383         return *this;
00384     }

Here is the call graph for this function:

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

internal multiplication

Definition at line 210 of file MC_v3d_vector.cpp.

References size(), and v.

00211     {
00212         int N=size();
00213         for(int k=0;k<N;++k)
00214             v[k]*=to_mult;
00215         return *this;
00216     }

Here is the call graph for this function:

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

internal add values

to_add must be of size 1 or this->size()

Definition at line 228 of file MC_v3d_vector.cpp.

References first(), size(), and v.

00229     {
00230         if(to_add.size()==1)
00231             return *this+=to_add.first();
00232         else
00233         {
00234             if(size()!=to_add.size())
00235             {std::cout<<"Error in MC_v3d_vector::operator+=(MC_v3d_vector), size are not compatible "<<size()<<";"<<to_add.size()<<std::endl;exit(-1);}
00236 
00237             int N=size();
00238             for(int k=0;k<N;++k)
00239                 v[k]+=to_add[k];
00240             return *this;
00241         }
00242     }

Here is the call graph for this function:

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

internal add a value

Definition at line 196 of file MC_v3d_vector.cpp.

References size(), and v.

00197     {
00198         int N=size();
00199         for(int k=0;k<N;++k)
00200             v[k]+=to_add;
00201         return *this;
00202     }

Here is the call graph for this function:

MC_v3d_vector mesh_conv::MC_v3d_vector::operator- (  )  const

change the opposite sign of the current vector (unary negation)

Returns:
a new vector with opposite sign

Definition at line 116 of file MC_v3d_vector.cpp.

References resize(), size(), and v.

00117     {
00118         int N=size();
00119         MC_v3d_vector new_vec;new_vec.resize(size());
00120         for(int k=0;k<N;++k)
00121             new_vec[k]=-v[k];
00122         return new_vec;
00123     }

Here is the call graph for this function:

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

internal substraction

to_add must be of size 1 or this->size()

Definition at line 243 of file MC_v3d_vector.cpp.

References first(), size(), and v.

00244     {
00245         if(to_sub.size()==1)
00246             return *this-=to_sub.first();
00247         else
00248         {
00249             if(size()!=to_sub.size())
00250             {std::cout<<"Error in MC_v3d_vector::operator-=(MC_v3d_vector), size are not compatible "<<size()<<";"<<to_sub.size()<<std::endl;exit(-1);}
00251 
00252             int N=size();
00253             for(int k=0;k<N;++k)
00254                 v[k]-=to_sub[k];
00255             return *this;
00256         }
00257     }

Here is the call graph for this function:

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

internal substraction

Definition at line 203 of file MC_v3d_vector.cpp.

References size(), and v.

00204     {
00205         int N=size();
00206         for(int k=0;k<N;++k)
00207             v[k]-=to_sub;
00208         return *this;
00209     }

Here is the call graph for this function:

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

internal divide

Definition at line 217 of file MC_v3d_vector.cpp.

References size(), and v.

00218     {
00219         double epsilon=0.000001;
00220         if(fabs(to_subdiv)<epsilon)
00221         {std::cout<<"Error in MC_v3d_vector/="<<to_subdiv<<", divide by zero"<<std::endl;exit(-1);}
00222 
00223         int N=size();
00224         for(int k=0;k<N;++k)
00225             v[k]/=to_subdiv;
00226         return *this;
00227     }

Here is the call graph for this function:

MC_v3d_vector mesh_conv::MC_v3d_vector::operator[] ( const MC_int_vector index  )  const

get a subset of the vector

Definition at line 332 of file MC_v3d_vector.cpp.

00333     {return (*this)(index);}

MC_v3d & mesh_conv::MC_v3d_vector::operator[] ( const int &  k_index  ) 

get operator

Definition at line 35 of file MC_v3d_vector.cpp.

References assert_bounds(), and v.

00035 {assert_bounds(k_index); return v[k_index];}

Here is the call graph for this function:

const MC_v3d & mesh_conv::MC_v3d_vector::operator[] ( const int &  k_index  )  const

get operator

Definition at line 34 of file MC_v3d_vector.cpp.

References assert_bounds(), and v.

00034 {assert_bounds(k_index); return v[k_index];}

Here is the call graph for this function:

const MC_v3d * mesh_conv::MC_v3d_vector::pointer (  )  const

get pointer

Definition at line 476 of file MC_v3d_vector.cpp.

References v.

Referenced by draw_scene(), and mesh_conv::MC_mesh_index_vector_draw::normal_vertex_update().

00476 {return &v[0];}

Here is the caller graph for this function:

MC_v3d * mesh_conv::MC_v3d_vector::pointer_unprotected (  ) 

get pointer

Warning:
not protected

Definition at line 477 of file MC_v3d_vector.cpp.

References v.

Referenced by mesh_conv::MC_mesh_index_vector_draw::normal_vertex_update().

00477 {return &v[0];}

Here is the caller graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::read_stream ( std::istream &  input  ) 

read from a stream in a transfering format (each coordinate separated by a space)

Definition at line 535 of file MC_v3d_vector.cpp.

References add().

00536     {
00537         while(input.good())
00538         {
00539             MC_v3d temp(0,0,0);
00540             for(int k_dim=0;k_dim<3;++k_dim)
00541                 input>>temp[k_dim];
00542             if(input.good())
00543                 add(temp);
00544         }
00545         return *this;
00546     }

Here is the call graph for this function:

MC_v3d_vector mesh_conv::MC_v3d_vector::removed ( const MC_int_vector index_to_remove  )  const

remove the k-th entry of the vector

Returns:
the vector with the removed entry

Definition at line 670 of file MC_v3d_vector.cpp.

References add(), size(), mesh_conv::MC_int_vector::to_set(), and v.

00671     {
00672         MC_v3d_vector new_vec;
00673         std::set<int> index_set=index_to_remove.to_set();
00674         for(int k=0,N=size();k<N;++k)
00675         {
00676             if(index_set.find(k)==index_set.end())
00677                 new_vec.add(v[k]);
00678         }
00679         return new_vec;
00680     }

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::resize ( const int &  new_size  ) 

resize the vector in deleting value of adding zeros

Returns:
the new value

Definition at line 103 of file MC_v3d_vector.cpp.

References v.

Referenced by build_duplicate(), mesh_conv::MC_mesh_index_vector_draw::build_local_basis(), mesh_conv::MC_mesh_index_vector_draw::fill_color(), mesh_conv::MC_curve::MC_curve(), mesh_conv::MC_triangle::MC_triangle(), mesh_conv::MC_mesh_index_vector_draw::normal_vertex_update(), mesh_conv::operator*(), mesh_conv::operator+(), mesh_conv::operator-(), operator-(), mesh_conv::operator/(), mesh_conv::MC_curve::read_vect(), mesh_conv::MC_polygon::subdivide_barycenter_mid_edge_no_constraint(), mesh_conv::MC_polygon::subdivide_mid_edge_no_constraint(), update_plane_density(), and zeros().

00104     {
00105         int N=v.size();
00106         if(N==new_size) //same size
00107             return *this;
00108 
00109         if(new_size<0)
00110         {std::cout<<"Error in MC_v3d_vector::resize("<<new_size<<") new size must be >0"<<std::endl;exit(-1);}
00111 
00112         v.resize(new_size);
00113         return *this;
00114     }

MC_v3d_vector & mesh_conv::MC_v3d_vector::scale ( const MC_v3d_vector s  ) 

internal scale the set of point by multipling componentwise with a v3d

Definition at line 435 of file MC_v3d_vector.cpp.

References size(), and v.

Referenced by mesh_conv::MC_mesh_index_vector::build_arrow(), and mesh_conv::MC_mesh_index_vector::build_square().

00436     {
00437         int N=size();
00438         for(int k=0;k<N;++k)
00439             v[k].scale(s);
00440         return *this;
00441     }

Here is the call graph for this function:

Here is the caller graph for this function:

std::pair< MC_v3d_vector, double > mesh_conv::MC_v3d_vector::scaled_to_unit (  )  const

homogeneous scale the point set to fit into [0,1] (do not center it)

Returns:
the new vector
the applied scaling factor

Definition at line 479 of file MC_v3d_vector.cpp.

References bounding_box_elements(), bounding_box_length(), and size().

Referenced by scaled_to_unit_and_center().

00480     {
00481         if(size()==0)
00482         {std::cout<<"Warning in MC_v3d_vector::scaled_to_unit(), size=0"<<std::endl;return std::pair<MC_v3d_vector,double>(*this,1.0);}
00483         std::pair<MC_v3d,MC_v3d> bb=bounding_box_elements();
00484         MC_v3d L=bounding_box_length();
00485         double Lmax=std::max(std::max(L[0],L[1]),L[2]);
00486         if(Lmax<0.000001)
00487         {std::cout<<"Error in MC_v3d_vector::scaled_to_unit(), vector has zero length"<<std::endl;exit(-1);}
00488         double factor=1/Lmax;
00489         return std::pair <MC_v3d_vector,double> ((*this)*factor,factor);
00490     }

Here is the call graph for this function:

Here is the caller graph for this function:

std::pair< MC_v3d_vector, MC_matrix > mesh_conv::MC_v3d_vector::scaled_to_unit_and_center (  )  const

homogeneous scale the point set to fit into [0,1] and center it

Definition at line 641 of file MC_v3d_vector.cpp.

References scaled_to_unit(), and mesh_conv::MC_matrix::set_translation().

Referenced by mesh_conv::MC_mesh_index_vector::texture_convert_planar_xy().

00642     {
00643         std::pair<MC_v3d_vector,double> scaling=scaled_to_unit();
00644         std::pair<MC_v3d,MC_v3d> bb=scaling.first.bounding_box_elements();
00645         scaling.first=scaling.first-bb.first;
00646         MC_matrix M(4);
00647         for(int k=0;k<3;++k)
00648             M(k,k)=scaling.second;
00649         M.set_translation(-bb.first);
00650         return std::make_pair(scaling.first,M);
00651     }

Here is the call graph for this function:

Here is the caller graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::set ( const mesh_conv::MC_int_vector k_index,
const MC_v3d_vector x 
)

set an indexed value to a certain component. Adjust the size automatically

Returns:
the new vector with the setted component

k_index and x must have the same size (or x must be of size 1)

Definition at line 83 of file MC_v3d_vector.cpp.

References mesh_conv::MC_int_vector::size(), size(), and zeros().

00084     {
00085         MC_v3d_vector v_x=x;
00086         if(x.size()!=1 && x.size()!=k_index.size())
00087         {std::cout<<"Error in MC_v3d_vector::set(MC_int_vector,MC_v3d_vector), size are not correct: "<<k_index.size()<<","<<x.size()<<std::endl;exit(-1);}
00088         if(x.size()==1)
00089             v_x=MC_v3d_vector::zeros(k_index.size())+x;
00090 
00091         int N=v_x.size();
00092         for(int k=0;k<N;k++)
00093             set(k_index[k],v_x[k]);
00094         return *this;
00095     }

Here is the call graph for this function:

MC_v3d_vector & mesh_conv::MC_v3d_vector::set ( const int &  k_index,
const MC_v3d x 
)

set an indexed value to a certain component. Adjust the size automatically

Returns:
the new vector with the setted component

Definition at line 74 of file MC_v3d_vector.cpp.

References size(), and v.

Referenced by mesh_conv::MC_mesh_index_vector::texture_convert_planar_xy_same_connectivity().

00075     {
00076         if(k_index<0)
00077         {std::cout<<"Error in MC_v3d_vector::set("<<k_index<<","<<x<<"), index must be >0"<<std::endl;exit(-1);}
00078         if(k_index>=size())
00079             v.resize(k_index+1);
00080         v[k_index]=x;
00081         return *this;
00082     }

Here is the call graph for this function:

Here is the caller graph for this function:

int mesh_conv::MC_v3d_vector::size (  )  const

get the size of the vector

Definition at line 25 of file MC_v3d_vector.cpp.

References v.

Referenced by add(), mesh_conv::MC_mesh_index_vector::add_unique_polygon(), barycenter(), mesh_conv::MC_polygon::barycenter(), mesh_conv::MC_curve::barycenter(), mesh_conv::MC_polygon::barycentric_coordinates(), mesh_conv::MC_mesh_index_vector::barycentric_coordinates(), bounding_box_elements(), mesh_conv::MC_curve::build_B_spline(), mesh_conv::MC_mesh_index_vector::build_ball_point_set(), mesh_conv::MC_segment::build_segment_vector(), mesh_conv::MC_mesh_index_vector::build_sphere_point_set(), mesh_conv::MC_curve::closed(), closest(), mesh_conv::MC_polygon::closest_point(), component(), mesh_conv::MC_mesh_index_vector_draw::concatenation(), mesh_conv::MC_mesh_index_vector::concatenation(), mesh_conv::MC_curve::diff_forward(), mesh_conv::MC_curve::diff_forward_close(), mesh_conv::MC_opengl_drawer::draw(), mesh_conv::MC_opengl_drawer::draw_normal_per_polygon(), mesh_conv::MC_opengl_drawer::draw_per_polygon_color(), mesh_conv::MC_opengl_drawer::draw_points(), draw_scene(), mesh_conv::MC_opengl_drawer::draw_sphere(), export_stream(), mesh_conv::MC_mesh_index_vector_draw::fill_color(), first(), mesh_conv::MC_mesh_index_vector::get_polygon_mesh(), mesh_conv::MC_polygon::half_space_intersection(), inverted_position(), mesh_conv::MC_polygon::is_degenerated(), mesh_conv::MC_polygon::is_planar(), mesh_conv::MC_curve::isometric_deformation(), last(), mesh_conv::MC_curve::length(), mesh_conv::MC_matrix::MC_matrix(), mesh_conv::MC_mesh_fast_draw::MC_mesh_fast_draw(), mesh_conv::MC_triangle::MC_triangle(), mesh_conv::MC_v3d::MC_v3d(), norm(), mesh_conv::MC_polygon::normal(), mesh_conv::MC_mesh_index_vector::normal_vertex(), mesh_conv::MC_mesh_index_vector_draw::normal_vertex_update(), normalized(), operator()(), mesh_conv::MC_v3d_vector_less::operator()(), mesh_conv::MC_polygon_less::operator()(), mesh_conv::operator*(), operator*=(), mesh_conv::operator+(), operator+=(), mesh_conv::operator-(), operator-(), operator-=(), mesh_conv::operator/(), operator/=(), mesh_conv::operator<<(), mesh_conv::MC_polygon::plane_intersection(), mesh_conv::MC_polygon::position(), mesh_conv::MC_polygon::projected_direction(), mesh_conv::MC_quaternion::quat_interp(), mesh_conv::MC_curve::read_lin(), mesh_conv::MC_curve::relativ_position(), removed(), scale(), scaled_to_unit(), mesh_conv::MC_polygon::segment(), mesh_conv::MC_curve::segment(), set(), mesh_conv::MC_mesh_fast_draw::set_color(), mesh_conv::MC_mesh_fast_draw::set_normal(), mesh_conv::MC_mesh_fast_draw::set_point_set(), mesh_conv::MC_mesh_fast_draw::set_texture(), mesh_conv::MC_curve::skinning(), mesh_conv::MC_polygon::subdivide_barycenter_mid_edge(), mesh_conv::MC_polygon::subdivide_barycenter_mid_edge_no_constraint(), mesh_conv::MC_mesh_index_vector::subdivide_barycenter_mid_edge_unchanged_boundary(), mesh_conv::MC_polygon::subdivide_mid_edge(), mesh_conv::MC_polygon::subdivide_mid_edge_no_constraint(), mesh_conv::MC_mesh_index_vector::subdivide_mid_edge_unchanged_boundary(), mesh_conv::MC_polygon::subdivide_mixed_mid_edge(), mesh_conv::MC_mesh_index_vector::subdivide_mixed_mid_edge(), mesh_conv::MC_mesh_index_vector::subdivide_mixed_mid_edge_unchanged_boundary(), sum(), mesh_conv::MC_mesh_index_vector::sweep_surface(), to_list(), to_map(), to_set(), mesh_conv::MC_triangle::triangulate(), mesh_conv::MC_curve::unclosed(), mesh_conv::MC_polygon::undegenerated(), update_plane_density(), mesh_conv::MC_curve::value(), mesh_conv::MC_mesh_index_vector::vertex_number(), mesh_conv::MC_io_obj::write_obj(), and mesh_conv::MC_curve::write_vect().

00025 {return v.size();}

MC_v3d mesh_conv::MC_v3d_vector::sum ( const MC_v3d_vector vec  )  [static]

do a summation over the MC_v3d_vector

Definition at line 305 of file MC_v3d_vector.cpp.

References size().

Referenced by barycenter(), mesh_conv::MC_polygon::barycenter(), mesh_conv::MC_polygon::barycentric_coordinates(), mesh_conv::MC_quaternion::quat_interp(), mesh_conv::MC_curve::skinning(), and mesh_conv::MC_mesh_index_vector::subdivide_barycenter_mid_edge().

00306     {
00307         MC_v3d x;
00308         int N=vec.size();
00309         for(int k=0;k<N;++k)
00310             x+=vec[k];
00311         return x;
00312     }

Here is the call graph for this function:

Here is the caller graph for this function:

std::list< MC_v3d > mesh_conv::MC_v3d_vector::to_list (  )  const

convert to list in the same order

Definition at line 459 of file MC_v3d_vector.cpp.

References size(), and v.

00460     {
00461         std::list <MC_v3d> list_point;
00462         int N=size();
00463         for(int k=0;k<N;k++)
00464             list_point.push_back(v[k]);
00465 
00466         return list_point;
00467     }

Here is the call graph for this function:

std::map< MC_v3d, int, MC_v3d_less > mesh_conv::MC_v3d_vector::to_map (  )  const

convert to std::map (coords is key and store the position as value)

Definition at line 443 of file MC_v3d_vector.cpp.

References size(), and v.

Referenced by mesh_conv::MC_mesh_index_vector::added_polygon_soup().

00444     {
00445         std::map <MC_v3d,int,MC_v3d_less> map_point;
00446         int N=size();
00447         for(int k=0;k<N;k++)
00448             map_point.insert(std::pair<MC_v3d,int>(v[k],k));
00449         return map_point;
00450     }

Here is the call graph for this function:

Here is the caller graph for this function:

std::set< MC_v3d, MC_v3d_less > mesh_conv::MC_v3d_vector::to_set (  )  const

convert to std::set

Definition at line 451 of file MC_v3d_vector.cpp.

References size(), and v.

00452     {
00453         std::set <MC_v3d,MC_v3d_less> set_point;
00454         int N=size();
00455         for(int k=0;k<N;k++)
00456             set_point.insert(v[k]);
00457         return set_point;
00458     }

Here is the call graph for this function:

MC_v3d_vector mesh_conv::MC_v3d_vector::zeros ( const int &  new_size  )  [static]

Friends And Related Function Documentation

MC_v3d_vector operator* ( const MC_v3d_vector vec,
const MC_double_vector w 
) [friend]

apply a pointwise multiplication by a MC_double_vector

Warning:
the MC_double_vector must be the same size as the vector or of size 1
MC_v3d_vector operator* ( const MC_double_vector  w,
const MC_v3d_vector vec 
) [friend]

apply a pointwise multiplication by a MC_double_vector

Warning:
the MC_double_vector must be the same size as the vector or of size 1
MC_v3d_vector operator* ( const MC_matrix M,
const MC_v3d_vector vec 
) [friend]

apply a matrix to the vector of MC_v3d

MC_v3d_vector operator* ( const double &  to_mult,
const MC_v3d_vector vec 
) [friend]

multiply a double value to the vector

Returns:
the new vector
MC_v3d_vector operator* ( const MC_v3d_vector vec,
const double &  to_mult 
) [friend]

multiply a double value to the vector

Returns:
the new vector
MC_v3d_vector operator+ ( const MC_v3d_vector vec,
const MC_v3d_vector to_add 
) [friend]

add a set of value to the vector

Returns:
the new vector

to_add must be of size 1 or vec.size()

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

add a MC_v3d value to the vector

Returns:
the new vector
MC_v3d_vector operator+ ( const MC_v3d_vector vec,
const MC_v3d to_add 
) [friend]

add a MC_v3d value to the vector

Returns:
the new vector
MC_v3d_vector operator- ( const MC_v3d_vector vec,
const MC_v3d_vector to_sub 
) [friend]

substract a v3d value to the vector

Returns:
the new vector

to_sub must be of size 1 or vec.size()

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

substract a MC_v3d value to the vector

Returns:
the new vector
MC_v3d_vector operator/ ( const MC_v3d_vector vec,
const double &  to_subdiv 
) [friend]

divide a double value to the vector

Returns:
the new vector
std::ostream& operator<< ( std::ostream &  output,
const MC_v3d_vector in 
) [friend]

write to ostream the list (u0 u1 u2 ... )

MC_v3d_vector operator<< ( const MC_v3d_vector vec,
const MC_v3d_vector value 
) [friend]

add a vector of values at the end of the vertex

Returns:
the current vector (copy)
MC_v3d_vector operator<< ( const MC_v3d_vector vec,
const MC_v3d value 
) [friend]

add a value at the end of the vertex

Returns:
the current vector (copy)

Member Data Documentation

std::vector<MC_v3d> mesh_conv::MC_v3d_vector::v [protected]

internal storage

Definition at line 52 of file MC_v3d_vector.hpp.

Referenced by add(), mesh_conv::MC_triangle::area(), assert_bounds(), mesh_conv::MC_triangle::barycenter(), mesh_conv::MC_polygon::barycenter(), mesh_conv::MC_triangle::barycentric_coordinates(), mesh_conv::MC_polygon::barycentric_coordinates(), bounding_box_elements(), clear(), closest(), mesh_conv::MC_triangle::closest_point(), mesh_conv::MC_polygon::closest_point(), component(), mesh_conv::MC_curve::diff_forward(), mesh_conv::MC_curve::diff_forward_close(), export_stream(), first(), mesh_conv::MC_polygon::is_degenerated(), mesh_conv::MC_polygon::is_planar(), last(), mesh_conv::MC_curve::length(), mesh_conv::MC_curve::MC_curve(), mesh_conv::MC_polygon::MC_polygon(), mesh_conv::MC_triangle::MC_triangle(), MC_v3d_vector(), mesh_conv::MC_triangle::normal(), mesh_conv::MC_polygon::normal(), normalized(), operator()(), operator*=(), operator+=(), operator-(), operator-=(), operator/=(), operator[](), mesh_conv::MC_polygon::plane_intersection(), pointer(), pointer_unprotected(), mesh_conv::MC_polygon::position(), removed(), resize(), scale(), mesh_conv::MC_triangle::segment(), mesh_conv::MC_polygon::segment(), mesh_conv::MC_triangle::segment_intersection(), set(), size(), mesh_conv::MC_curve::skinning(), mesh_conv::MC_polygon::subdivide_barycenter_mid_edge(), mesh_conv::MC_polygon::subdivide_barycenter_mid_edge_no_constraint(), mesh_conv::MC_polygon::subdivide_mid_edge(), mesh_conv::MC_polygon::subdivide_mid_edge_no_constraint(), to_list(), to_map(), to_set(), and mesh_conv::MC_polygon::undegenerated().


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