52 #ifndef CGAL_POLYHEDRON_INCREMENTAL_BUILDER_3_H
53 #define CGAL_POLYHEDRON_INCREMENTAL_BUILDER_3_H 1
54 #ifndef CGAL_RANDOM_ACCESS_VALUE_ADAPTOR_H
56 #endif // CGAL_RANDOM_ACCESS_VALUE_ADAPTOR_H
57 #ifndef CGAL_PROTECT_VECTOR
59 #define CGAL_PROTECT_VECTOR
60 #endif // CGAL_PROTECT_VECTOR
61 #ifndef CGAL_HALFEDGE_DATA_STRUCTURE_DECORATOR_H
63 #endif // CGAL_HALFEDGE_DATA_STRUCTURE_DECORATOR_H
64 #ifndef CGAL_IO_VERBOSE_OSTREAM_H
66 #endif // CGAL_IO_VERBOSE_OSTREAM_H
76 typedef typename HDS::Facet
Facet;
77 typedef typename HDS::Point
Point;
78 typedef typename HDS::Size
Size;
81 typedef typename HDS::Supports_vertex_halfedge
195 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
198 void begin_surface( std::size_t
v, std::size_t f, std::size_t h = 0);
211 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
219 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
256 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
281 #else // CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS //
282 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
293 typename HDS::Vertex_iterator it =
hds.vertices_begin();
294 while ( &(*it) != v) {
303 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
314 typename HDS::Facet_iterator it =
hds.facets_begin();
315 while ( &(*it) != f) {
324 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
326 typename HDS::Halfedge*
332 typedef typename HDS::Supports_halfedge_vertex
333 Supports_halfedge_vertex;
345 verr <<
" " << std::endl;
346 verr <<
"Polyhedron_incremental_builder_3<HDS>::"
348 verr <<
"lookup_halfedge(): input error: facet "
349 <<
new_facets <<
" has a self intersection at vertex "
350 << w <<
"." << std::endl;
358 verr <<
" " << std::endl;
359 verr <<
"Polyhedron_incremental_builder_3"
360 "<HDS>::" << std::endl;
361 verr <<
"lookup_halfedge(): input error: facet "
363 "vertex " << w <<
" to vertex " << v
370 verr <<
" another facet." << std::endl;
378 verr <<
" " << std::endl;
379 verr <<
"Polyhedron_incremental_builder_3"
380 "<HDS>::" << std::endl;
381 verr <<
"lookup_halfedge(): input error: facet "
383 "at the halfedge from vertex " << w
384 <<
" to vertex " << v <<
"." << std::endl;
392 }
while ( e != start_edge);
395 if (
hds.size_of_halfedges() >=
hds.capacity_of_halfedges()) {
396 verr <<
" " << std::endl;
397 verr <<
"Polyhedron_incremental_builder_3<HDS>::" << std::endl;
398 verr <<
"lookup_halfedge(): capacity error: more than "
417 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
419 typename HDS::Halfedge*
433 }
while ( e != start_edge);
436 verr <<
" " << std::endl;
437 verr <<
"Polyhedron_incremental_builder_3<HDS>::" << std::endl;
438 verr <<
"lookup_hole(): input error: at vertex "
440 <<
" a closed surface already exists and facet "
441 <<
new_facets <<
" is nonetheless adjacent." << std::endl;
443 verr <<
" The closed cycle of facets is:";
448 }
while ( e != start_edge);
449 verr <<
'.' << std::endl;
455 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
465 if (
hds.size_of_vertices() >=
hds.capacity_of_vertices()) {
467 verr <<
" " << std::endl;
468 verr <<
"Polyhedron_incremental_builder_3<HDS>::" << std::endl;
469 verr <<
"add_vertex(): capacity error: more than " <<
new_vertices
470 <<
" vertices added." << std::endl;
481 #endif // CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS //
484 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
485 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
496 typename HDS::Vertex_iterator it =
hds.vertices_begin();
497 while ( &(*it) != v) {
506 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
517 typename HDS::Facet_iterator it =
hds.facets_begin();
518 while ( &(*it) != f) {
527 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
529 typename HDS::Halfedge*
535 typedef typename HDS::Supports_halfedge_vertex
536 Supports_halfedge_vertex;
548 verr <<
" " << std::endl;
549 verr <<
"Polyhedron_incremental_builder_3<HDS>::"
551 verr <<
"lookup_halfedge(): input error: facet "
552 <<
new_facets <<
" has a self intersection at vertex "
553 << w <<
"." << std::endl;
561 verr <<
" " << std::endl;
562 verr <<
"Polyhedron_incremental_builder_3"
563 "<HDS>::" << std::endl;
564 verr <<
"lookup_halfedge(): input error: facet "
566 "vertex " << w <<
" to vertex " << v
573 verr <<
" another facet." << std::endl;
581 verr <<
" " << std::endl;
582 verr <<
"Polyhedron_incremental_builder_3"
583 "<HDS>::" << std::endl;
584 verr <<
"lookup_halfedge(): input error: facet "
586 "at the halfedge from vertex " << w
587 <<
" to vertex " << v <<
"." << std::endl;
595 }
while ( e != start_edge);
598 if (
hds.size_of_halfedges() >=
hds.capacity_of_halfedges()) {
599 verr <<
" " << std::endl;
600 verr <<
"Polyhedron_incremental_builder_3<HDS>::" << std::endl;
601 verr <<
"lookup_halfedge(): capacity error: more than "
620 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
622 typename HDS::Halfedge*
636 }
while ( e != start_edge);
639 verr <<
" " << std::endl;
640 verr <<
"Polyhedron_incremental_builder_3<HDS>::" << std::endl;
641 verr <<
"lookup_hole(): input error: at vertex "
643 <<
" a closed surface already exists and facet "
644 <<
new_facets <<
" is nonetheless adjacent." << std::endl;
646 verr <<
" The closed cycle of facets is:";
651 }
while ( e != start_edge);
652 verr <<
'.' << std::endl;
658 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
668 if (
hds.size_of_vertices() >=
hds.capacity_of_vertices()) {
670 verr <<
" " << std::endl;
671 verr <<
"Polyhedron_incremental_builder_3<HDS>::" << std::endl;
672 verr <<
"add_vertex(): capacity error: more than " <<
new_vertices
673 <<
" vertices added." << std::endl;
684 #endif // CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS //
685 template <
class HDS>
693 hds.vertex_pop_back();
698 hds.facet_pop_back();
706 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
709 begin_surface( std::size_t v, std::size_t f, std::size_t h) {
725 h = int((v + f - 2 + 12) * 2.1);
727 hds.reserve(
hds.size_of_vertices() +
v,
728 hds.size_of_halfedges() + h,
729 hds.size_of_facets() + f);
743 if (
hds.size_of_facets() >=
hds.capacity_of_facets()) {
745 verr <<
" " << std::endl;
746 verr <<
"Polyhedron_incremental_builder_3<HDS>::" << std::endl;
747 verr <<
"begin_facet(): capacity error: more than " <<
new_vertices
748 <<
" facets added." << std::endl;
761 template <
class HDS>
764 #ifndef CGAL_CFG_NO_SCOPE_MEMBER_FUNCTION_PARAMETERS
774 verr <<
" " << std::endl;
775 verr <<
"Polyhedron_incremental_builder_3<HDS>::" << std::endl;
776 verr <<
"add_vertex_to_facet(): vertex index " << v2
848 hprime->set_next( prev);
862 }
while ( e->next() != prev && e !=
h1);
868 hprime->set_next( hole->next());
869 decorator.
set_prev( hole->next(), hprime);
870 hole->set_next( prev);
873 verr <<
" " << std::endl;
874 verr <<
"Polyhedron_incremental_builder_3<"
875 "HDS>::" << std::endl;
876 verr <<
"add_vertex_to_facet(): input error: "
877 "disconnected facet complexes at vertex "
878 <<
v1 <<
":" << std::endl;
881 verr <<
" involved facets are:";
883 if ( ! e->is_border())
886 e = e->next()->opposite();
888 verr <<
" (closed cycle) and";
891 if ( ! e->is_border())
894 }
while ( e != hprime);
895 verr <<
"." << std::endl;
911 template <
class HDS>
941 template < class HDS>
947 bool unconnected =
false;
951 verr <<
"Polyhedron_incremental_builder_3<HDS>::\n"
952 <<
"check_unconnected_vertices( verb = true): "
953 <<
"vertex " <<
i <<
" is unconnected." << std::endl;
960 template <
class HDS>
975 #endif // CGAL_POLYHEDRON_INCREMENTAL_BUILDER_3_H //
Random_access_index index_to_vertex_map
bool check_unconnected_vertices()
#define CGAL_assertion(EX)
Facet * new_facet(HDS &hds) const
Halfedge * get_vertex_to_edge_map(int i)
void begin_surface(Size v, Size f, Size h=0)
Size find_facet(Facet *f)
#define CGAL_LARGE_INLINE
Halfedge opposite() const
Get the ID of the opposite edge of a given edge.
void push_back_vertex_to_edge_map(Halfedge *, Tag_true)
void push_back_vertex_to_edge_map(Halfedge *h, Tag_false)
This class encapsulate a halfedge over a window manifold.
void push_back_vertex_to_edge_map(Halfedge *h)
void set_facet_halfedge(Facet *f, Halfedge *g) const
Tag_true void initialize_vertex_to_edge_map(Size n, Tag_false)
Halfedge next() const
Get the next halfedge of its owner element.
Halfedge * lookup_halfedge(Size w, Size v)
HDS::Supports_vertex_halfedge Supports_vertex_halfedge
#define CGAL_MEDIUM_INLINE
void add_vertex(const Point &p)
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Random_access_value_adaptor< Vertex_iterator, Vertex > Random_access_index
void set_vertex_to_edge_map(int i, Halfedge *h, Tag_true)
Facet * get_facet(Halfedge *h) const
bool remove_unconnected_vertices()
void set_vertex_to_edge_map(int i, Halfedge *h, Tag_false)
Halfedge * get_vertex_to_edge_map(int i, Tag_true)
CGAL_assertion_code(int check_protocoll;) void initialize_vertex_to_edge_map(Size
Vertex * new_vertex(HDS &hds) const
bool is_border() const
Is the edge a border edge?
void Assert_compile_time_tag(const Tag &, const Derived &b)
void reserve(size_type r, std::forward_iterator_tag)
void set_vertex_to_edge_map(int i, Halfedge *h)
void set_facet(Halfedge *h, Facet *f) const
void add_vertex_to_facet(Size i)
void set_vertex_halfedge(Vertex *v, Halfedge *g) const
HDS Halfedge_data_structure
#define CGAL_BEGIN_NAMESPACE
Size find_vertex(Vertex *v)
void initialize_vertex_to_edge_map(Size n)
std::vector< Halfedge * > vertex_to_edge_map
HDS::Vertex_iterator Vertex_iterator
HDS::Supports_removal Supports_removal
void set_prev(Halfedge *h, Halfedge *g) const
bool remove_unconnected_vertices(Tag_false)
Halfedge * lookup_hole(Size w)
#define CGAL_END_NAMESPACE
Halfedge * get_vertex_to_edge_map(int i, Tag_false)
void push_back(const IC &k, std::forward_iterator_tag)