mirror of https://github.com/CGAL/cgal
Merge dd70f9c11b into 26a5fc70e4
This commit is contained in:
commit
b7e30b78a8
|
|
@ -62,9 +62,10 @@ class Shell_to_nef_3
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SNC_structure& S;
|
SNC_structure& S;
|
||||||
|
bool preserve_marks;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Shell_to_nef_3(SNC_structure& S_) : S(S_) {}
|
Shell_to_nef_3(SNC_structure& S_, bool m_) : S(S_), preserve_marks(m_) {}
|
||||||
|
|
||||||
void visit(Vertex_const_handle ) {}
|
void visit(Vertex_const_handle ) {}
|
||||||
void visit(Halfedge_const_handle ) {}
|
void visit(Halfedge_const_handle ) {}
|
||||||
|
|
@ -83,7 +84,7 @@ class Shell_to_nef_3
|
||||||
Vertex_const_handle pv = sf->center_vertex();
|
Vertex_const_handle pv = sf->center_vertex();
|
||||||
Vertex_handle nv = S.new_vertex();
|
Vertex_handle nv = S.new_vertex();
|
||||||
nv->point() = pv->point();
|
nv->point() = pv->point();
|
||||||
nv->mark() = true;
|
nv->mark() = preserve_marks ? pv->mark() : true;
|
||||||
|
|
||||||
SM_decorator SM(&*nv);
|
SM_decorator SM(&*nv);
|
||||||
SHalfedge_around_sface_const_circulator
|
SHalfedge_around_sface_const_circulator
|
||||||
|
|
@ -91,7 +92,7 @@ class Shell_to_nef_3
|
||||||
|
|
||||||
SVertex_handle sv_0 =
|
SVertex_handle sv_0 =
|
||||||
SM.new_svertex(pe->source()->point());
|
SM.new_svertex(pe->source()->point());
|
||||||
sv_0->mark() = true;
|
sv_0->mark() = preserve_marks ? pe->source()->mark() : true;
|
||||||
#ifndef CGAL_NEF_NO_INDEXED_ITEMS
|
#ifndef CGAL_NEF_NO_INDEXED_ITEMS
|
||||||
sv_0->set_index(pe->source()->get_index());
|
sv_0->set_index(pe->source()->get_index());
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -100,7 +101,7 @@ class Shell_to_nef_3
|
||||||
|
|
||||||
do {
|
do {
|
||||||
SVertex_handle sv = SM.new_svertex(pe->source()->point());
|
SVertex_handle sv = SM.new_svertex(pe->source()->point());
|
||||||
sv->mark() = true;
|
sv->mark() = preserve_marks ? pe->source()->mark() : true;
|
||||||
#ifndef CGAL_NEF_NO_INDEXED_ITEMS
|
#ifndef CGAL_NEF_NO_INDEXED_ITEMS
|
||||||
sv->set_index(pe->source()->get_index());
|
sv->set_index(pe->source()->get_index());
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -108,7 +109,8 @@ class Shell_to_nef_3
|
||||||
SHalfedge_handle e = SM.new_shalfedge_pair(sv_prev, sv);
|
SHalfedge_handle e = SM.new_shalfedge_pair(sv_prev, sv);
|
||||||
e->circle() = pe_prev->circle();
|
e->circle() = pe_prev->circle();
|
||||||
e->twin()->circle() = pe_prev->twin()->circle();
|
e->twin()->circle() = pe_prev->twin()->circle();
|
||||||
e->mark() = e->twin()->mark() = true;
|
e->mark() = preserve_marks ? pe_prev->mark() : true;
|
||||||
|
e->twin()->mark() = preserve_marks ? pe_prev->twin()->mark() : true;
|
||||||
#ifndef CGAL_NEF_NO_INDEXED_ITEMS
|
#ifndef CGAL_NEF_NO_INDEXED_ITEMS
|
||||||
e->set_index(pe_prev->get_index());
|
e->set_index(pe_prev->get_index());
|
||||||
e->twin()->set_index(pe_prev->twin()->get_index());
|
e->twin()->set_index(pe_prev->twin()->get_index());
|
||||||
|
|
@ -123,7 +125,8 @@ class Shell_to_nef_3
|
||||||
e = SM.new_shalfedge_pair(sv_prev, sv_0);
|
e = SM.new_shalfedge_pair(sv_prev, sv_0);
|
||||||
e->circle() = pe_prev->circle();
|
e->circle() = pe_prev->circle();
|
||||||
e->twin()->circle() = pe_prev->twin()->circle();
|
e->twin()->circle() = pe_prev->twin()->circle();
|
||||||
e->mark() = e->twin()->mark() = true;
|
e->mark() = preserve_marks ? pe_prev->mark() : true;
|
||||||
|
e->twin()->mark() = preserve_marks ? pe_prev->twin()->mark() : true;
|
||||||
#ifndef CGAL_NEF_NO_INDEXED_ITEMS
|
#ifndef CGAL_NEF_NO_INDEXED_ITEMS
|
||||||
e->set_index(pe_prev->get_index());
|
e->set_index(pe_prev->get_index());
|
||||||
e->twin()->set_index(pe_prev->twin()->get_index());
|
e->twin()->set_index(pe_prev->twin()->get_index());
|
||||||
|
|
@ -144,9 +147,10 @@ class Shell_to_nef_3
|
||||||
template <class Nef_polyhedron>
|
template <class Nef_polyhedron>
|
||||||
void shell_to_nef_3(const Nef_polyhedron& N,
|
void shell_to_nef_3(const Nef_polyhedron& N,
|
||||||
typename Nef_polyhedron::SFace_const_handle sf,
|
typename Nef_polyhedron::SFace_const_handle sf,
|
||||||
typename Nef_polyhedron::SNC_structure& S)
|
typename Nef_polyhedron::SNC_structure& S,
|
||||||
|
bool preserve_marks = false)
|
||||||
{
|
{
|
||||||
Shell_to_nef_3<typename Nef_polyhedron::SNC_structure> s2n(S);
|
Shell_to_nef_3<typename Nef_polyhedron::SNC_structure> s2n(S,preserve_marks);
|
||||||
N.visit_shell_objects(sf, s2n);
|
N.visit_shell_objects(sf, s2n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1523,6 +1523,39 @@ protected:
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Nef_polyhedron_3<Kernel,Items, Mark>
|
||||||
|
append(const Nef_polyhedron_3<Kernel,Items, Mark>& N1)
|
||||||
|
/*{\Mop returns |\Mvar| with N1 appended }*/ {
|
||||||
|
CGAL_NEF_TRACEN(" append between nef3 "<<&*this<<" and "<<&N1);
|
||||||
|
Shell_entry_const_iterator si;
|
||||||
|
CGAL_forall_shells_of(si,N1.volumes_begin())
|
||||||
|
CGAL::shell_to_nef_3(N1,si,snc(),true);
|
||||||
|
SNC_external_structure es(snc());
|
||||||
|
es.clear_external_structure();
|
||||||
|
build_external_structure();
|
||||||
|
mark_bounded_volumes();
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Range>
|
||||||
|
Nef_polyhedron_3<Kernel,Items, Mark>
|
||||||
|
append(const Range& N)
|
||||||
|
/*{\Mop returns |\Mvar| with the range N appended }*/ {
|
||||||
|
for(typename Range::const_iterator N1=N.begin(); N1!=N.end(); ++N1) {
|
||||||
|
CGAL_NEF_TRACEN(" append between nef3 "<<&*this<<" and "<<&*N1);
|
||||||
|
Shell_entry_const_iterator si;
|
||||||
|
CGAL_forall_shells_of(si,N1->volumes_begin())
|
||||||
|
CGAL::shell_to_nef_3(*N1,si,snc(),true);
|
||||||
|
}
|
||||||
|
SNC_external_structure es(snc());
|
||||||
|
es.clear_external_structure();
|
||||||
|
build_external_structure();
|
||||||
|
mark_bounded_volumes();
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
Nef_polyhedron_3<Kernel,Items, Mark>
|
Nef_polyhedron_3<Kernel,Items, Mark>
|
||||||
difference(const Nef_polyhedron_3<Kernel,Items, Mark>& N1) const
|
difference(const Nef_polyhedron_3<Kernel,Items, Mark>& N1) const
|
||||||
/*{\Mop returns |\Mvar| $-$ |N1|. }*/ {
|
/*{\Mop returns |\Mvar| $-$ |N1|. }*/ {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue