mirror of https://github.com/CGAL/cgal
Merge remote-tracking branch 'cgal/5.4.x-branch' into HEAD
This commit is contained in:
commit
f1f201b542
|
|
@ -111,7 +111,7 @@ class Face_graph_index_adder {
|
||||||
|
|
||||||
typedef typename boost::graph_traits<Polyhedron>::halfedge_descriptor halfedge_descriptor;
|
typedef typename boost::graph_traits<Polyhedron>::halfedge_descriptor halfedge_descriptor;
|
||||||
public:
|
public:
|
||||||
Face_graph_index_adder(Polyhedron&, HalfedgeIndexMap ) {}
|
Face_graph_index_adder(const Polyhedron&, HalfedgeIndexMap ) {}
|
||||||
void set_edge(halfedge_descriptor,
|
void set_edge(halfedge_descriptor,
|
||||||
SHalfedge_handle) {}
|
SHalfedge_handle) {}
|
||||||
void resolve_indexes() {}
|
void resolve_indexes() {}
|
||||||
|
|
@ -128,12 +128,12 @@ class Face_graph_index_adder<CGAL::SNC_indexed_items, PolygonMesh, SNC_structure
|
||||||
Halfedge_around_facet_const_circulator;
|
Halfedge_around_facet_const_circulator;
|
||||||
typedef std::vector<SHalfedge_handle> SHalfedges;
|
typedef std::vector<SHalfedge_handle> SHalfedges;
|
||||||
|
|
||||||
PolygonMesh& P;
|
const PolygonMesh& P;
|
||||||
HalfedgeIndexMap him;
|
HalfedgeIndexMap him;
|
||||||
SHalfedges shalfedges;
|
SHalfedges shalfedges;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Face_graph_index_adder(PolygonMesh& P_, HalfedgeIndexMap him) : P(P_), him(him)
|
Face_graph_index_adder(const PolygonMesh& P_, HalfedgeIndexMap him) : P(P_), him(him)
|
||||||
{
|
{
|
||||||
shalfedges.resize(num_halfedges(P));
|
shalfedges.resize(num_halfedges(P));
|
||||||
}
|
}
|
||||||
|
|
@ -168,9 +168,9 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class PolygonMesh, class SNC_structure, class FaceIndexMap, class HalfedgeIndexMap>
|
template <class PolygonMesh, class SNC_structure, class FaceIndexMap, class HalfedgeIndexMap>
|
||||||
void polygon_mesh_to_nef_3(PolygonMesh& P, SNC_structure& S, FaceIndexMap fimap, HalfedgeIndexMap himap)
|
void polygon_mesh_to_nef_3(const PolygonMesh& P, SNC_structure& S, FaceIndexMap fimap, HalfedgeIndexMap himap)
|
||||||
{
|
{
|
||||||
typedef typename boost::property_map<PolygonMesh, vertex_point_t>::type PMap;
|
typedef typename boost::property_map<PolygonMesh, vertex_point_t>::const_type PMap;
|
||||||
typedef typename SNC_structure::Vector_3 Vector_3;
|
typedef typename SNC_structure::Vector_3 Vector_3;
|
||||||
typedef typename boost::graph_traits<PolygonMesh>::vertex_descriptor vertex_descriptor;
|
typedef typename boost::graph_traits<PolygonMesh>::vertex_descriptor vertex_descriptor;
|
||||||
typedef typename boost::graph_traits<PolygonMesh>::halfedge_descriptor halfedge_descriptor;
|
typedef typename boost::graph_traits<PolygonMesh>::halfedge_descriptor halfedge_descriptor;
|
||||||
|
|
@ -312,25 +312,15 @@ void polygon_mesh_to_nef_3(PolygonMesh& P, SNC_structure& S, FaceIndexMap fimap,
|
||||||
index_adder.resolve_indexes();
|
index_adder.resolve_indexes();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Polyhedron, class SNC_structure>
|
template <class PolygonMesh, class SNC_structure>
|
||||||
void polyhedron_3_to_nef_3(Polyhedron& P, SNC_structure& S)
|
void polygon_mesh_to_nef_3(const PolygonMesh& pm, SNC_structure& snc)
|
||||||
{
|
{
|
||||||
typedef typename boost::property_map<Polyhedron, face_external_index_t>::type FIMap;
|
typedef typename GetInitializedFaceIndexMap<PolygonMesh>::const_type FaceIndexMap;
|
||||||
FIMap fimap = get(CGAL::face_external_index,P);
|
FaceIndexMap fimap = get_initialized_face_index_map(pm);
|
||||||
typedef typename boost::property_map<Polyhedron, halfedge_external_index_t>::type HIMap;
|
typedef typename GetInitializedHalfedgeIndexMap<PolygonMesh>::const_type HalfedgeIndexMap;
|
||||||
HIMap himap = get(CGAL::halfedge_external_index,P);
|
HalfedgeIndexMap himap = get_initialized_halfedge_index_map(pm);
|
||||||
polygon_mesh_to_nef_3(P, S, fimap, himap);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class SM, class SNC_structure>
|
polygon_mesh_to_nef_3(pm, snc, fimap, himap);
|
||||||
void polygon_mesh_to_nef_3(SM& sm, SNC_structure& snc)
|
|
||||||
{
|
|
||||||
typedef typename boost::property_map<SM, face_index_t>::type FIMap;
|
|
||||||
FIMap fimap = get(CGAL::face_index,sm);
|
|
||||||
typedef typename boost::property_map<SM, boost::halfedge_index_t>::type HIMap;
|
|
||||||
HIMap himap = get(boost::halfedge_index,sm);
|
|
||||||
|
|
||||||
polygon_mesh_to_nef_3(sm, snc, fimap, himap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -612,22 +612,6 @@ protected:
|
||||||
simplify();
|
simplify();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T1, class T2,
|
|
||||||
template <class T31, class T32, class T33>
|
|
||||||
class T3, class T4 >
|
|
||||||
Nef_polyhedron_3( CGAL::Polyhedron_3<T1,T2,T3,T4>& P)
|
|
||||||
: Nef_polyhedron_3(Private_tag{})
|
|
||||||
{
|
|
||||||
CGAL_NEF_TRACEN("construction from Polyhedron_3");
|
|
||||||
reserve_for_vertices(P.size_of_vertices());
|
|
||||||
initialize_infibox_vertices(EMPTY);
|
|
||||||
polyhedron_3_to_nef_3
|
|
||||||
<CGAL::Polyhedron_3<T1,T2,T3,T4>, SNC_structure>( P, snc());
|
|
||||||
build_external_structure();
|
|
||||||
mark_bounded_volumes();
|
|
||||||
simplify();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class PolygonMesh>
|
template <class PolygonMesh>
|
||||||
explicit Nef_polyhedron_3(const PolygonMesh& pm)
|
explicit Nef_polyhedron_3(const PolygonMesh& pm)
|
||||||
: Nef_polyhedron_3(Private_tag{})
|
: Nef_polyhedron_3(Private_tag{})
|
||||||
|
|
@ -635,7 +619,7 @@ protected:
|
||||||
CGAL_NEF_TRACEN("construction from PolygonMesh with internal index maps");
|
CGAL_NEF_TRACEN("construction from PolygonMesh with internal index maps");
|
||||||
reserve_for_vertices(num_vertices(pm));
|
reserve_for_vertices(num_vertices(pm));
|
||||||
initialize_infibox_vertices(EMPTY);
|
initialize_infibox_vertices(EMPTY);
|
||||||
polygon_mesh_to_nef_3<PolygonMesh, SNC_structure>(const_cast<PolygonMesh&>(pm), snc());
|
polygon_mesh_to_nef_3<PolygonMesh, SNC_structure>(pm, snc());
|
||||||
build_external_structure();
|
build_external_structure();
|
||||||
mark_bounded_volumes();
|
mark_bounded_volumes();
|
||||||
simplify();
|
simplify();
|
||||||
|
|
@ -653,7 +637,7 @@ protected:
|
||||||
CGAL_NEF_TRACEN("construction from PolygonMesh");
|
CGAL_NEF_TRACEN("construction from PolygonMesh");
|
||||||
reserve_for_vertices(num_vertices(pm));
|
reserve_for_vertices(num_vertices(pm));
|
||||||
initialize_infibox_vertices(EMPTY);
|
initialize_infibox_vertices(EMPTY);
|
||||||
polygon_mesh_to_nef_3<PolygonMesh, SNC_structure>(const_cast<PolygonMesh&>(pm), snc(), fim, him);
|
polygon_mesh_to_nef_3<PolygonMesh, SNC_structure>(pm, snc(), fim, him);
|
||||||
build_external_structure();
|
build_external_structure();
|
||||||
mark_bounded_volumes();
|
mark_bounded_volumes();
|
||||||
simplify();
|
simplify();
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,9 @@ void test_write_read()
|
||||||
Polyhedron P;
|
Polyhedron P;
|
||||||
P.make_tetrahedron( p, q, r, s);
|
P.make_tetrahedron( p, q, r, s);
|
||||||
Nef_polyhedron nef_1( P );
|
Nef_polyhedron nef_1( P );
|
||||||
|
const Polyhedron P_bis = P;
|
||||||
|
Nef_polyhedron nef_1_bis( P_bis );
|
||||||
|
assert( nef_1 == nef_1_bis);
|
||||||
|
|
||||||
std::cout << " write...\n";
|
std::cout << " write...\n";
|
||||||
std::ofstream out ("temp.nef");
|
std::ofstream out ("temp.nef");
|
||||||
|
|
|
||||||
|
|
@ -25,5 +25,11 @@ int main(int /* argc */, char** /* argv[] */)
|
||||||
assert(a1 < a2);
|
assert(a1 < a2);
|
||||||
assert(a2 > a1);
|
assert(a2 > a1);
|
||||||
|
|
||||||
|
const Polygon_mesh const_A1 = A1;
|
||||||
|
const Polygon_mesh& const_A2 = A2;
|
||||||
|
Nef_polyhedron a1_bis(const_A1), a2_bis(const_A2);
|
||||||
|
assert(a1_bis==a1);
|
||||||
|
assert(a2_bis==a2);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue