mirror of https://github.com/CGAL/cgal
fix warnings and compilation issues
This commit is contained in:
parent
036c0c0231
commit
ad1954afc4
|
|
@ -84,8 +84,8 @@ main(int,char*[])
|
||||||
|
|
||||||
for(std::list<edge_descriptor>::iterator it = mst.begin(); it != mst.end(); ++it){
|
for(std::list<edge_descriptor>::iterator it = mst.begin(); it != mst.end(); ++it){
|
||||||
edge_descriptor ed = *it;
|
edge_descriptor ed = *it;
|
||||||
vertex_descriptor svd = boost::source(ed,t);
|
vertex_descriptor svd = source(ed,t);
|
||||||
vertex_descriptor tvd = boost::target(ed,t);
|
vertex_descriptor tvd = target(ed,t);
|
||||||
Triangulation::Vertex_handle sv = svd;
|
Triangulation::Vertex_handle sv = svd;
|
||||||
Triangulation::Vertex_handle tv = tvd;
|
Triangulation::Vertex_handle tv = tvd;
|
||||||
std::cout << "[ " << sv->point() << " | " << tv->point() << " ] " << std::endl;
|
std::cout << "[ " << sv->point() << " | " << tv->point() << " ] " << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@
|
||||||
#include <CGAL/Surface_mesh_simplification/edge_collapse.h>
|
#include <CGAL/Surface_mesh_simplification/edge_collapse.h>
|
||||||
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h>
|
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h>
|
||||||
|
|
||||||
|
#include <CGAL/use.h>
|
||||||
|
|
||||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Epic;
|
typedef CGAL::Exact_predicates_inexact_constructions_kernel Epic;
|
||||||
typedef CGAL::Projection_traits_xy_3<Epic> K;
|
typedef CGAL::Projection_traits_xy_3<Epic> K;
|
||||||
typedef K::Point_2 Point;
|
typedef K::Point_2 Point;
|
||||||
|
|
@ -111,6 +113,7 @@ main(int,char*[])
|
||||||
for(boost::tie(eit,ee) = edges(t); eit!= ee; ++eit){
|
for(boost::tie(eit,ee) = edges(t); eit!= ee; ++eit){
|
||||||
edge_descriptor ed = *eit;
|
edge_descriptor ed = *eit;
|
||||||
vertex_descriptor vd = source(ed,t);
|
vertex_descriptor vd = source(ed,t);
|
||||||
|
CGAL_USE(vd);
|
||||||
++index;
|
++index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -121,6 +124,7 @@ main(int,char*[])
|
||||||
for(boost::tie(hit,he) = halfedges(t); hit!= he; ++hit){
|
for(boost::tie(hit,he) = halfedges(t); hit!= he; ++hit){
|
||||||
halfedge_descriptor hd = *hit;
|
halfedge_descriptor hd = *hit;
|
||||||
vertex_descriptor vd = source(hd,t);
|
vertex_descriptor vd = source(hd,t);
|
||||||
|
CGAL_USE(vd);
|
||||||
++index;
|
++index;
|
||||||
}
|
}
|
||||||
std::cerr << index << " halfedges" << std::endl;
|
std::cerr << index << " halfedges" << std::endl;
|
||||||
|
|
@ -142,7 +146,7 @@ main(int,char*[])
|
||||||
// The surface and stop conditions are mandatory arguments.
|
// The surface and stop conditions are mandatory arguments.
|
||||||
// The index maps are needed because the vertices and edges
|
// The index maps are needed because the vertices and edges
|
||||||
// of this surface lack an "id()" field.
|
// of this surface lack an "id()" field.
|
||||||
int r = SMS::edge_collapse
|
SMS::edge_collapse
|
||||||
(t
|
(t
|
||||||
,stop
|
,stop
|
||||||
,CGAL::vertex_index_map(vertex_index_pmap)
|
,CGAL::vertex_index_map(vertex_index_pmap)
|
||||||
|
|
|
||||||
|
|
@ -366,7 +366,7 @@ namespace CGAL {
|
||||||
put(PropertyTag p, CGAL::Delaunay_triangulation_2<Gt,Tds>& g,
|
put(PropertyTag p, CGAL::Delaunay_triangulation_2<Gt,Tds>& g,
|
||||||
const Key& key, const Value& value)
|
const Key& key, const Value& value)
|
||||||
{
|
{
|
||||||
typedef typename property_map<CGAL::Delaunay_triangulation_2<Gt,Tds>, PropertyTag>::type Map;
|
typedef typename boost::property_map<CGAL::Delaunay_triangulation_2<Gt,Tds>, PropertyTag>::type Map;
|
||||||
Map pmap = get(p, g);
|
Map pmap = get(p, g);
|
||||||
put(pmap, key, value);
|
put(pmap, key, value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -372,7 +372,7 @@ halfedge(typename boost::graph_traits<OpenMesh::PolyMesh_ArrayKernelT<K> >::vert
|
||||||
// HalfedgeListGraph
|
// HalfedgeListGraph
|
||||||
//
|
//
|
||||||
template <typename K>
|
template <typename K>
|
||||||
CGA::Iterator_range<typename boost::graph_traits<OpenMesh::PolyMesh_ArrayKernelT<K> >::halfedge_iterator>
|
CGAL::Iterator_range<typename boost::graph_traits<OpenMesh::PolyMesh_ArrayKernelT<K> >::halfedge_iterator>
|
||||||
halfedges(const OpenMesh::PolyMesh_ArrayKernelT<K>& sm)
|
halfedges(const OpenMesh::PolyMesh_ArrayKernelT<K>& sm)
|
||||||
{
|
{
|
||||||
return CGAL::make_range(sm.halfedges_sbegin(), sm.halfedges_end());
|
return CGAL::make_range(sm.halfedges_sbegin(), sm.halfedges_end());
|
||||||
|
|
|
||||||
|
|
@ -527,7 +527,7 @@ add_face(InputIterator begin, InputIterator end, CGAL::Surface_mesh<P>& sm)
|
||||||
template<typename P>
|
template<typename P>
|
||||||
bool is_valid(CGAL::Surface_mesh<P>& sm, bool verbose = false)
|
bool is_valid(CGAL::Surface_mesh<P>& sm, bool verbose = false)
|
||||||
{
|
{
|
||||||
return true;
|
return sm.is_valid(verbose);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
|
||||||
|
|
@ -402,7 +402,7 @@ namespace CGAL {
|
||||||
template <class Gt, class Tds>
|
template <class Gt, class Tds>
|
||||||
typename boost::graph_traits< Triangulation_2<Gt,Tds> >::face_descriptor
|
typename boost::graph_traits< Triangulation_2<Gt,Tds> >::face_descriptor
|
||||||
face(typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor e,
|
face(typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor e,
|
||||||
const Triangulation_2<Gt,Tds>& g)
|
const Triangulation_2<Gt,Tds>&)
|
||||||
{
|
{
|
||||||
return e.first;
|
return e.first;
|
||||||
}
|
}
|
||||||
|
|
@ -410,7 +410,7 @@ namespace CGAL {
|
||||||
template <class Gt, class Tds>
|
template <class Gt, class Tds>
|
||||||
typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor
|
typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor
|
||||||
halfedge(typename boost::graph_traits< Triangulation_2<Gt,Tds> >::face_descriptor f,
|
halfedge(typename boost::graph_traits< Triangulation_2<Gt,Tds> >::face_descriptor f,
|
||||||
const Triangulation_2<Gt,Tds>& g)
|
const Triangulation_2<Gt,Tds>&)
|
||||||
{
|
{
|
||||||
typedef typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor halfedge_descriptor;
|
typedef typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor halfedge_descriptor;
|
||||||
return halfedge_descriptor(f,0);
|
return halfedge_descriptor(f,0);
|
||||||
|
|
@ -431,7 +431,7 @@ namespace CGAL {
|
||||||
template <class Gt, class Tds>
|
template <class Gt, class Tds>
|
||||||
typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor
|
typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor
|
||||||
halfedge(typename boost::graph_traits< Triangulation_2<Gt,Tds> >::edge_descriptor e,
|
halfedge(typename boost::graph_traits< Triangulation_2<Gt,Tds> >::edge_descriptor e,
|
||||||
const Triangulation_2<Gt,Tds>& g)
|
const Triangulation_2<Gt,Tds>&)
|
||||||
{
|
{
|
||||||
typedef typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor halfedge_descriptor;
|
typedef typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor halfedge_descriptor;
|
||||||
return halfedge_descriptor(e.first,e.second);
|
return halfedge_descriptor(e.first,e.second);
|
||||||
|
|
@ -440,7 +440,7 @@ namespace CGAL {
|
||||||
template <class Gt, class Tds>
|
template <class Gt, class Tds>
|
||||||
typename boost::graph_traits< Triangulation_2<Gt,Tds> >::edge_descriptor
|
typename boost::graph_traits< Triangulation_2<Gt,Tds> >::edge_descriptor
|
||||||
edge(typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor e,
|
edge(typename boost::graph_traits< Triangulation_2<Gt,Tds> >::halfedge_descriptor e,
|
||||||
const Triangulation_2<Gt,Tds>& g)
|
const Triangulation_2<Gt,Tds>&)
|
||||||
{
|
{
|
||||||
typedef typename boost::graph_traits< Triangulation_2<Gt,Tds> >::edge_descriptor edge_descriptor;
|
typedef typename boost::graph_traits< Triangulation_2<Gt,Tds> >::edge_descriptor edge_descriptor;
|
||||||
return edge_descriptor(e.first,e.second);
|
return edge_descriptor(e.first,e.second);
|
||||||
|
|
@ -619,22 +619,22 @@ namespace CGAL {
|
||||||
|
|
||||||
template <class Gt, class Tds>
|
template <class Gt, class Tds>
|
||||||
class T2_vertex_point_map
|
class T2_vertex_point_map
|
||||||
: public boost::put_get_helper<typename Tds::Vertex::Point, T2_vertex_point_map<Gt,Tds> >
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef boost::readable_property_map_tag category;
|
typedef boost::lvalue_property_map_tag category;
|
||||||
typedef typename Tds::Vertex::Point value_type;
|
typedef typename Tds::Vertex::Point value_type;
|
||||||
typedef value_type& reference;
|
typedef value_type& reference;
|
||||||
typedef typename CGAL::Triangulation_2<Gt,Tds>::Vertex_handle key_type;
|
typedef typename CGAL::Triangulation_2<Gt,Tds>::Vertex_handle key_type;
|
||||||
|
|
||||||
T2_vertex_point_map()
|
friend reference get(T2_vertex_point_map<Gt,Tds>, key_type vh)
|
||||||
{}
|
{
|
||||||
|
|
||||||
value_type operator[](key_type vh) const {
|
|
||||||
return vh->point();
|
return vh->point();
|
||||||
}
|
}
|
||||||
|
friend void put(T2_vertex_point_map<Gt,Tds>, key_type vh, const reference v)
|
||||||
reference operator[](key_type vh) {
|
{
|
||||||
|
vh->point()=v;
|
||||||
|
}
|
||||||
|
reference operator[](key_type vh) const {
|
||||||
return vh->point();
|
return vh->point();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -790,7 +790,7 @@ namespace CGAL {
|
||||||
put(PropertyTag p, Triangulation_2<Gt,Tds>& g,
|
put(PropertyTag p, Triangulation_2<Gt,Tds>& g,
|
||||||
const Key& key, const Value& value)
|
const Key& key, const Value& value)
|
||||||
{
|
{
|
||||||
typedef typename property_map<Triangulation_2<Gt,Tds>, PropertyTag>::type Map;
|
typedef typename boost::property_map<Triangulation_2<Gt,Tds>, PropertyTag>::type Map;
|
||||||
Map pmap = get(p, g);
|
Map pmap = get(p, g);
|
||||||
put(pmap, key, value);
|
put(pmap, key, value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ template <typename Point, typename T>
|
||||||
typename property_map<CGAL::Surface_mesh<Point>, boost::vertex_property_t<T> >::const_type
|
typename property_map<CGAL::Surface_mesh<Point>, boost::vertex_property_t<T> >::const_type
|
||||||
get(boost::vertex_property_t<T> vprop, const CGAL::Surface_mesh<Point>& sm)
|
get(boost::vertex_property_t<T> vprop, const CGAL::Surface_mesh<Point>& sm)
|
||||||
{
|
{
|
||||||
return sm.template property_map<typename CGAL::Surface_mesh<Point>::Vertex_index, T>(vprop.s);
|
return sm.template get_property_map<typename CGAL::Surface_mesh<Point>::Vertex_index, T>(vprop.s);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Point, typename T>
|
template <typename Point, typename T>
|
||||||
|
|
@ -261,7 +261,7 @@ put(CGAL::vertex_point_t p, const CGAL::Surface_mesh<K>& g,
|
||||||
const K& point) {
|
const K& point) {
|
||||||
typedef CGAL::Surface_mesh<K> SM;
|
typedef CGAL::Surface_mesh<K> SM;
|
||||||
CGAL_assertion(g.is_valid(x));
|
CGAL_assertion(g.is_valid(x));
|
||||||
typename SM::Property_map< typename boost::graph_traits<SM>::vertex_descriptor,
|
typename SM::template Property_map< typename boost::graph_traits<SM>::vertex_descriptor,
|
||||||
K> prop = get(p, g);
|
K> prop = get(p, g);
|
||||||
prop[x] = point;
|
prop[x] = point;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,12 +50,12 @@ void test_edge_iterators(const G& g)
|
||||||
typedef typename Traits::edge_descriptor edge_descriptor;
|
typedef typename Traits::edge_descriptor edge_descriptor;
|
||||||
typedef typename Traits::edge_iterator edge_iterator;
|
typedef typename Traits::edge_iterator edge_iterator;
|
||||||
|
|
||||||
assert(g.size_of_halfedges() / 2 == num_edges(g));
|
// assert(g.size_of_halfedges() / 2 == num_edges(g));
|
||||||
|
|
||||||
// do we iterate as many as that?
|
// do we iterate as many as that?
|
||||||
edge_iterator eb, ee;
|
edge_iterator eb, ee;
|
||||||
boost::tie(eb, ee) = edges(g);
|
boost::tie(eb, ee) = edges(g);
|
||||||
assert(std::distance(eb, ee) == static_cast<std::ptrdiff_t>(g.size_of_halfedges() / 2));
|
assert(std::distance(eb, ee) == num_edges(g));
|
||||||
|
|
||||||
id_map ids;
|
id_map ids;
|
||||||
unsigned int count = 0;
|
unsigned int count = 0;
|
||||||
|
|
|
||||||
|
|
@ -22,16 +22,15 @@ if ( CGAL_FOUND )
|
||||||
include( CGAL_CreateSingleSourceCGALProgram )
|
include( CGAL_CreateSingleSourceCGALProgram )
|
||||||
|
|
||||||
include_directories (BEFORE "../../include")
|
include_directories (BEFORE "../../include")
|
||||||
include_directories (BEFORE "../include")
|
|
||||||
|
|
||||||
create_single_source_cgal_program( "sm_aabbtree.cpp" )
|
create_single_source_cgal_program( "sm_aabbtree.cpp" )
|
||||||
|
create_single_source_cgal_program( "sm_bgl.cpp" )
|
||||||
|
create_single_source_cgal_program( "sm_circulators.cpp" )
|
||||||
create_single_source_cgal_program( "sm_do_intersect.cpp" )
|
create_single_source_cgal_program( "sm_do_intersect.cpp" )
|
||||||
create_single_source_cgal_program( "sm_iterators.cpp" )
|
create_single_source_cgal_program( "sm_iterators.cpp" )
|
||||||
create_single_source_cgal_program( "sm_circulators.cpp" )
|
|
||||||
create_single_source_cgal_program( "sm_properties.cpp" )
|
|
||||||
create_single_source_cgal_program( "sm_memory.cpp" )
|
|
||||||
create_single_source_cgal_program( "sm_kruskal.cpp" )
|
create_single_source_cgal_program( "sm_kruskal.cpp" )
|
||||||
create_single_source_cgal_program( "sm_bgl.cpp" )
|
create_single_source_cgal_program( "sm_memory.cpp" )
|
||||||
|
create_single_source_cgal_program( "sm_properties.cpp" )
|
||||||
|
|
||||||
else()
|
else()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ int main()
|
||||||
vertex_descriptor w = m.add_vertex(K::Point_3(1,0,0));
|
vertex_descriptor w = m.add_vertex(K::Point_3(1,0,0));
|
||||||
vertex_descriptor x = m.add_vertex(K::Point_3(1,1,0));
|
vertex_descriptor x = m.add_vertex(K::Point_3(1,1,0));
|
||||||
|
|
||||||
face_descriptor f = m.add_face(u,v,w,x);
|
/* face_descriptor f = */ m.add_face(u,v,w,x);
|
||||||
|
|
||||||
{
|
{
|
||||||
std::cout << "all vertices " << std::endl;
|
std::cout << "all vertices " << std::endl;
|
||||||
|
|
@ -57,9 +57,11 @@ int main()
|
||||||
}
|
}
|
||||||
|
|
||||||
// or the C+11 for loop. Note that there is a ':' and not a ',' as in BOOST_FOREACH
|
// or the C+11 for loop. Note that there is a ':' and not a ',' as in BOOST_FOREACH
|
||||||
|
#ifndef CGAL_NO_CPP0X_RANGE_BASED_FOR
|
||||||
for(vertex_descriptor vd : m.vertices()){
|
for(vertex_descriptor vd : m.vertices()){
|
||||||
std::cout << vd << std::endl;
|
std::cout << vd << std::endl;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
#include <CGAL/Surface_mesh.h>
|
#include <CGAL/Surface_mesh.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#include <boost/graph/kruskal_min_spanning_tree.hpp>
|
#include <boost/graph/kruskal_min_spanning_tree.hpp>
|
||||||
|
|
@ -57,10 +58,11 @@ kruskal(const Mesh& P)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main() {
|
int main(int,char** argv) {
|
||||||
|
|
||||||
Mesh P;
|
Mesh P;
|
||||||
std::cin >> P;
|
std::ifstream input(argv[1]);
|
||||||
|
input >> P;
|
||||||
|
|
||||||
kruskal(P);
|
kruskal(P);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,10 +48,6 @@ int main()
|
||||||
boost::tie(gnus, found) = m.property_map<face_descriptor,std::string>("v:gnus");
|
boost::tie(gnus, found) = m.property_map<face_descriptor,std::string>("v:gnus");
|
||||||
assert(! found);
|
assert(! found);
|
||||||
|
|
||||||
|
|
||||||
typedef boost::property_map<Mesh, boost::vertex_point_t>::type Ppmap;
|
|
||||||
Ppmap ppmap = m.points();
|
|
||||||
|
|
||||||
// retrieve the point property for which exists a convenience function
|
// retrieve the point property for which exists a convenience function
|
||||||
Mesh::Property_map<vertex_descriptor, K::Point_3> location = m.points();
|
Mesh::Property_map<vertex_descriptor, K::Point_3> location = m.points();
|
||||||
BOOST_FOREACH( vertex_descriptor vd, m.vertices()) {
|
BOOST_FOREACH( vertex_descriptor vd, m.vertices()) {
|
||||||
|
|
|
||||||
|
|
@ -69,8 +69,8 @@ bool read_off_binary(Surface_mesh<Point_3>& mesh,
|
||||||
typename Mesh::Vertex_index v;
|
typename Mesh::Vertex_index v;
|
||||||
|
|
||||||
// properties
|
// properties
|
||||||
Mesh::Property_map<typename Mesh::Vertex_index, Normal> normals;
|
typename Mesh:: template Property_map<typename Mesh::Vertex_index, Normal> normals;
|
||||||
Mesh::Property_map<typename Mesh::Vertex_index, Texture_coordinate> texcoords;
|
typename Mesh:: template Property_map<typename Mesh::Vertex_index, Texture_coordinate> texcoords;
|
||||||
if (has_normals) normals = mesh.template add_property_map<typename Mesh::Vertex_index, Normal>("v:normal").first;
|
if (has_normals) normals = mesh.template add_property_map<typename Mesh::Vertex_index, Normal>("v:normal").first;
|
||||||
if (has_texcoords) texcoords = mesh.template add_property_map<typename Mesh::Vertex_index, Texture_coordinate>("v:texcoord").first;
|
if (has_texcoords) texcoords = mesh.template add_property_map<typename Mesh::Vertex_index, Texture_coordinate>("v:texcoord").first;
|
||||||
|
|
||||||
|
|
@ -145,8 +145,8 @@ bool read_off_ascii(Surface_mesh<Point_3>& mesh,
|
||||||
typename Mesh::Vertex_index v;
|
typename Mesh::Vertex_index v;
|
||||||
|
|
||||||
// properties
|
// properties
|
||||||
Mesh::Property_map<typename Mesh::Vertex_index, Normal> normals;
|
typename Mesh::template Property_map<typename Mesh::Vertex_index, Normal> normals;
|
||||||
Mesh::Property_map<typename Mesh::Vertex_index, Texture_coordinate> texcoords;
|
typename Mesh::template Property_map<typename Mesh::Vertex_index, Texture_coordinate> texcoords;
|
||||||
|
|
||||||
if (has_normals) normals = mesh.template add_property_map<typename Mesh::Vertex_index, Normal>("v:normal").first;
|
if (has_normals) normals = mesh.template add_property_map<typename Mesh::Vertex_index, Normal>("v:normal").first;
|
||||||
if (has_texcoords) texcoords = mesh.template add_property_map<typename Mesh::Vertex_index, Texture_coordinate>("v:texcoord").first;
|
if (has_texcoords) texcoords = mesh.template add_property_map<typename Mesh::Vertex_index, Texture_coordinate>("v:texcoord").first;
|
||||||
|
|
@ -343,7 +343,7 @@ bool write_off(const Surface_mesh<K>& mesh, const std::string& filename)
|
||||||
|
|
||||||
|
|
||||||
// vertices
|
// vertices
|
||||||
Mesh::Property_map<typename Mesh::Vertex_index, Point_3> points
|
typename Mesh::template Property_map<typename Mesh::Vertex_index, Point_3> points
|
||||||
= mesh.template property_map<typename Mesh::Vertex_index, Point_3>("v:point").first;
|
= mesh.template property_map<typename Mesh::Vertex_index, Point_3>("v:point").first;
|
||||||
for (typename Mesh::Vertex_iterator vit=mesh.vertices_begin(); vit!=mesh.vertices_end(); ++vit)
|
for (typename Mesh::Vertex_iterator vit=mesh.vertices_begin(); vit!=mesh.vertices_end(); ++vit)
|
||||||
{
|
{
|
||||||
|
|
@ -360,7 +360,7 @@ bool write_off(const Surface_mesh<K>& mesh, const std::string& filename)
|
||||||
typename Surface_mesh<K>::Vertex_around_face_circulator fvit(mesh.halfedge(*fit),mesh), fvend=fvit;
|
typename Surface_mesh<K>::Vertex_around_face_circulator fvit(mesh.halfedge(*fit),mesh), fvend=fvit;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
Surface_mesh<K>::size_type idx = *fvit;
|
typename Surface_mesh<K>::size_type idx = *fvit;
|
||||||
fprintf(out, " %d", idx);
|
fprintf(out, " %d", idx);
|
||||||
}
|
}
|
||||||
while (++fvit != fvend);
|
while (++fvit != fvend);
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ public: // virtual interface of Base_property_array
|
||||||
|
|
||||||
virtual Base_property_array* clone() const
|
virtual Base_property_array* clone() const
|
||||||
{
|
{
|
||||||
Property_array<T>* p = new Property_array<T>(name_, value_);
|
Property_array<T>* p = new Property_array<T>(this->name_, this->value_);
|
||||||
p->data_ = data_;
|
p->data_ = data_;
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
@ -338,7 +338,7 @@ public:
|
||||||
// delete a property
|
// delete a property
|
||||||
template <class T> void remove(Property_map<Key, T>& h)
|
template <class T> void remove(Property_map<Key, T>& h)
|
||||||
{
|
{
|
||||||
std::vector<Base_property_array*>::iterator it=parrays_.begin(), end=parrays_.end();
|
typename std::vector<Base_property_array*>::iterator it=parrays_.begin(), end=parrays_.end();
|
||||||
for (; it!=end; ++it)
|
for (; it!=end; ++it)
|
||||||
{
|
{
|
||||||
if (*it == h.parray_)
|
if (*it == h.parray_)
|
||||||
|
|
@ -1505,6 +1505,7 @@ public:
|
||||||
valid = valid && next(*it).is_valid();
|
valid = valid && next(*it).is_valid();
|
||||||
valid = valid && opposite(*it).is_valid();
|
valid = valid && opposite(*it).is_valid();
|
||||||
if(!valid) {
|
if(!valid) {
|
||||||
|
if (verbose)
|
||||||
std::cerr << "Integrity of halfedge " << *it << " corrupted." << std::endl;
|
std::cerr << "Integrity of halfedge " << *it << " corrupted." << std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1512,30 +1513,35 @@ public:
|
||||||
valid = valid && (opposite(*it) != *it);
|
valid = valid && (opposite(*it) != *it);
|
||||||
valid = valid && (opposite(opposite(*it)) == *it);
|
valid = valid && (opposite(opposite(*it)) == *it);
|
||||||
if(!valid) {
|
if(!valid) {
|
||||||
|
if (verbose)
|
||||||
std::cerr << "Integrity of opposite halfedge of " << *it << " corrupted." << std::endl;
|
std::cerr << "Integrity of opposite halfedge of " << *it << " corrupted." << std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
valid = valid && (next(prev(*it)) == *it);
|
valid = valid && (next(prev(*it)) == *it);
|
||||||
if(!valid) {
|
if(!valid) {
|
||||||
|
if (verbose)
|
||||||
std::cerr << "Integrity of previous halfedge of " << *it << " corrupted." << std::endl;
|
std::cerr << "Integrity of previous halfedge of " << *it << " corrupted." << std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
valid = valid && (prev(next(*it)) == *it);
|
valid = valid && (prev(next(*it)) == *it);
|
||||||
if(!valid) {
|
if(!valid) {
|
||||||
|
if (verbose)
|
||||||
std::cerr << "Integrity of next halfedge of " << *it << " corrupted." << std::endl;
|
std::cerr << "Integrity of next halfedge of " << *it << " corrupted." << std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
valid = valid && target(*it).is_valid();
|
valid = valid && target(*it).is_valid();
|
||||||
if(!valid) {
|
if(!valid) {
|
||||||
|
if (verbose)
|
||||||
std::cerr << "Integrity of vertex of halfedge " << *it << " corrupted." << std::endl;
|
std::cerr << "Integrity of vertex of halfedge " << *it << " corrupted." << std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
valid = valid && (target(*it) == target(opposite(next(*it))));
|
valid = valid && (target(*it) == target(opposite(next(*it))));
|
||||||
if(!valid) {
|
if(!valid) {
|
||||||
|
if (verbose)
|
||||||
std::cerr << "Halfedge vertex of next opposite is not the same for " << *it << "." << std::endl;
|
std::cerr << "Halfedge vertex of next opposite is not the same for " << *it << "." << std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1546,6 +1552,7 @@ public:
|
||||||
// not an isolated vertex
|
// not an isolated vertex
|
||||||
valid = valid && (target(halfedge(*it)) == *it);
|
valid = valid && (target(halfedge(*it)) == *it);
|
||||||
if(!valid) {
|
if(!valid) {
|
||||||
|
if (verbose)
|
||||||
std::cerr << "Halfedge of " << *it << " is not an incoming halfedge." << std::endl;
|
std::cerr << "Halfedge of " << *it << " is not an incoming halfedge." << std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -2138,8 +2145,6 @@ private: //------------------------------------------------------- private data
|
||||||
std::istream& operator>>(std::istream& is, Surface_mesh<P>& sm)
|
std::istream& operator>>(std::istream& is, Surface_mesh<P>& sm)
|
||||||
{
|
{
|
||||||
typedef Surface_mesh<P> Mesh;
|
typedef Surface_mesh<P> Mesh;
|
||||||
typedef typename Mesh::Vertex_index Vertex_index;
|
|
||||||
typedef typename Mesh::Face_index Face_index;
|
|
||||||
typedef typename Mesh::size_type size_type;
|
typedef typename Mesh::size_type size_type;
|
||||||
sm.clear();
|
sm.clear();
|
||||||
int n, f, e;
|
int n, f, e;
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,12 @@ int main()
|
||||||
{
|
{
|
||||||
Sm m;
|
Sm m;
|
||||||
Sm::vertex_index u;
|
Sm::vertex_index u;
|
||||||
std::cout << m.num_vertices() << " " << m.num_removed_vertices() << std::endl;
|
std::cout << m.num_vertices() << " " << m.number_of_removed_vertices() << std::endl;
|
||||||
for(int i=0; i < 10; i++){
|
for(int i=0; i < 10; i++){
|
||||||
u = m.add_vertex(Point_3(0,0,0));
|
u = m.add_vertex(Point_3(0,0,0));
|
||||||
m.remove_vertex(u);
|
m.remove_vertex(u);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << m.num_vertices() << " " << m.num_removed_vertices() << std::endl;
|
std::cout << m.num_vertices() << " " << m.number_of_removed_vertices() << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
#include <boost/range/algorithm.hpp>
|
#include <boost/range/algorithm.hpp>
|
||||||
|
|
||||||
|
#include <CGAL/use.h>
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE( constructors_test )
|
BOOST_AUTO_TEST_CASE( constructors_test )
|
||||||
{
|
{
|
||||||
Sm mesh;
|
Sm mesh;
|
||||||
|
|
@ -141,7 +143,6 @@ BOOST_AUTO_TEST_CASE( memory_reuse_test )
|
||||||
BOOST_CHECK_EQUAL(f.m.number_of_faces() , 0);
|
BOOST_CHECK_EQUAL(f.m.number_of_faces() , 0);
|
||||||
BOOST_CHECK_EQUAL(f.m.number_of_removed_edges(), old_edge_size + old_removed_edge_size);
|
BOOST_CHECK_EQUAL(f.m.number_of_removed_edges(), old_edge_size + old_removed_edge_size);
|
||||||
|
|
||||||
int fc = 0;
|
|
||||||
// add all again
|
// add all again
|
||||||
for(Faces::iterator it = faces.begin(); it != faces.end(); ++it) {
|
for(Faces::iterator it = faces.begin(); it != faces.end(); ++it) {
|
||||||
Sm::Face_index fd = f.m.add_face(*it);
|
Sm::Face_index fd = f.m.add_face(*it);
|
||||||
|
|
@ -151,7 +152,7 @@ BOOST_AUTO_TEST_CASE( memory_reuse_test )
|
||||||
|
|
||||||
Sm::Halfedge_index h = f.m.halfedge(*it2);
|
Sm::Halfedge_index h = f.m.halfedge(*it2);
|
||||||
Sm::Face_index fa = f.m.face(h);
|
Sm::Face_index fa = f.m.face(h);
|
||||||
|
CGAL_USE(fa);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
0
Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cmd
Executable file → Normal file
0
Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cmd
Executable file → Normal file
|
|
@ -73,7 +73,7 @@ int main( int argc, char** argv )
|
||||||
|
|
||||||
Surface_mesh::Property_map<halfedge_descriptor,std::pair<Point_3, Point_3> > constrained_halfedges;
|
Surface_mesh::Property_map<halfedge_descriptor,std::pair<Point_3, Point_3> > constrained_halfedges;
|
||||||
|
|
||||||
constrained_halfedges = surface_mesh.add_property_map<halfedge_descriptor,std::pair<Point_3, Point_3>>("h:vertices").first;
|
constrained_halfedges = surface_mesh.add_property_map<halfedge_descriptor,std::pair<Point_3, Point_3> >("h:vertices").first;
|
||||||
|
|
||||||
std::size_t nb_border_edges=0;
|
std::size_t nb_border_edges=0;
|
||||||
BOOST_FOREACH(halfedge_descriptor hd, halfedges(surface_mesh)){
|
BOOST_FOREACH(halfedge_descriptor hd, halfedges(surface_mesh)){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue