Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Polyhedron_incremental_builder_3< HDS > Class Template Reference

#include <Polyhedron_incremental_builder_3.h>

Collaboration diagram for Polyhedron_incremental_builder_3< HDS >:

Public Types

typedef HDS Halfedge_data_structure
 
typedef HDS::Vertex Vertex
 
typedef HDS::Halfedge Halfedge
 
typedef HDS::Facet Facet
 
typedef HDS::Point Point
 
typedef HDS::Size Size
 

Public Member Functions

bool error () const
 
 m_verbose (verbose)
 
 hds (h)
 
 ~Polyhedron_incremental_builder_3 ()
 
void begin_surface (Size v, Size f, Size h=0)
 
void add_vertex (const Point &p)
 
void begin_facet ()
 
void add_vertex_to_facet (Size i)
 
void end_facet ()
 
void end_surface ()
 
bool check_unconnected_vertices ()
 
bool remove_unconnected_vertices (Tag_true)
 
bool remove_unconnected_vertices (Tag_false)
 
bool remove_unconnected_vertices ()
 
void rollback ()
 

Public Attributes

 __pad0__: m_error( false)
 

Protected Types

typedef
HDS::Supports_vertex_halfedge 
Supports_vertex_halfedge
 
typedef HDS::Supports_removal Supports_removal
 
typedef HDS::Vertex_iterator Vertex_iterator
 
typedef
Random_access_value_adaptor
< Vertex_iterator, Vertex
Random_access_index
 

Protected Member Functions

 CGAL_assertion_code (int check_protocoll;) void initialize_vertex_to_edge_map(Size
 
Tag_true void initialize_vertex_to_edge_map (Size n, Tag_false)
 
void initialize_vertex_to_edge_map (Size n)
 
void push_back_vertex_to_edge_map (Halfedge *, Tag_true)
 
void push_back_vertex_to_edge_map (Halfedge *h, Tag_false)
 
void push_back_vertex_to_edge_map (Halfedge *h)
 
Halfedgeget_vertex_to_edge_map (int i, Tag_true)
 
Halfedgeget_vertex_to_edge_map (int i, Tag_false)
 
Halfedgeget_vertex_to_edge_map (int i)
 
void set_vertex_to_edge_map (int i, Halfedge *h, Tag_true)
 
void set_vertex_to_edge_map (int i, Halfedge *h, Tag_false)
 
void set_vertex_to_edge_map (int i, Halfedge *h)
 
Halfedgelookup_hole (Size w)
 
Size find_vertex (Vertex *v)
 
Size find_facet (Facet *f)
 
Halfedgelookup_halfedge (Size w, Size v)
 
Halfedgelookup_hole (Halfedge *e)
 

Protected Attributes

bool m_error
 
bool m_verbose
 
HDS & hds
 
Size rollback_v
 
Size rollback_f
 
Size rollback_h
 
Size new_vertices
 
Size new_facets
 
Size new_halfedges
 
Facetcurrent_facet
 
Random_access_index index_to_vertex_map
 
std::vector< Halfedge * > vertex_to_edge_map
 
Halfedgeg1
 
Halfedgegprime
 
Halfedgeh1
 
Size w1
 
Size w2
 
Size v1
 
bool first_vertex
 
bool last_vertex
 

Detailed Description

template<class HDS>
class Polyhedron_incremental_builder_3< HDS >

Definition at line 71 of file Polyhedron_incremental_builder_3.h.

Member Typedef Documentation

typedef HDS::Facet Facet

Definition at line 76 of file Polyhedron_incremental_builder_3.h.

typedef HDS::Halfedge Halfedge

Definition at line 75 of file Polyhedron_incremental_builder_3.h.

Definition at line 73 of file Polyhedron_incremental_builder_3.h.

typedef HDS::Point Point

Definition at line 77 of file Polyhedron_incremental_builder_3.h.

typedef HDS::Size Size

Definition at line 78 of file Polyhedron_incremental_builder_3.h.

typedef HDS::Supports_removal Supports_removal
protected

Definition at line 83 of file Polyhedron_incremental_builder_3.h.

typedef HDS::Supports_vertex_halfedge Supports_vertex_halfedge
protected

Definition at line 82 of file Polyhedron_incremental_builder_3.h.

typedef HDS::Vertex Vertex

Definition at line 74 of file Polyhedron_incremental_builder_3.h.

typedef HDS::Vertex_iterator Vertex_iterator
protected

Definition at line 84 of file Polyhedron_incremental_builder_3.h.

Constructor & Destructor Documentation

Definition at line 189 of file Polyhedron_incremental_builder_3.h.

References CGAL_assertion.

189  {
190  CGAL_assertion( check_protocoll == 0);
191  }
#define CGAL_assertion(EX)
Definition: assertions.h:87

Member Function Documentation

CGAL_MEDIUM_INLINE void add_vertex ( const Point p)

Definition at line 666 of file Polyhedron_incremental_builder_3.h.

References CGAL_assertion, Polyhedron_incremental_builder_3< HDS >::hds, Polyhedron_incremental_builder_3< HDS >::index_to_vertex_map, Polyhedron_incremental_builder_3< HDS >::m_error, Polyhedron_incremental_builder_3< HDS >::m_verbose, Halfedge_data_structure_decorator< _HDS >::new_vertex(), Polyhedron_incremental_builder_3< HDS >::new_vertices, Random_access_adaptor< IC >::push_back(), Polyhedron_incremental_builder_3< HDS >::push_back_vertex_to_edge_map(), and Halfedge_data_structure_decorator< _HDS >::set_vertex_halfedge().

666  {
667  CGAL_assertion( check_protocoll == 1);
668  if ( hds.size_of_vertices() >= hds.capacity_of_vertices()) {
669  Verbose_ostream verr( m_verbose);
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;
674  m_error = true;
675  return;
676  }
678  Vertex* v = decorator.new_vertex( hds, p);
680  decorator.set_vertex_halfedge( v, 0);
682  ++new_vertices;
683 }
#define CGAL_assertion(EX)
Definition: assertions.h:87
void push_back_vertex_to_edge_map(Halfedge *, Tag_true)
*********************************************************************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
Definition: roccomf90.h:20
void set_vertex_halfedge(Vertex *v, Halfedge *g) const
void push_back(const IC &k, std::forward_iterator_tag)

Here is the call graph for this function:

void add_vertex_to_facet ( Size  i)

Definition at line 765 of file Polyhedron_incremental_builder_3.h.

References CGAL_assertion, Polyhedron_incremental_builder_3< HDS >::CGAL_assertion_code(), Polyhedron_incremental_builder_3< HDS >::current_facet, Polyhedron_incremental_builder_3< HDS >::end_facet(), Polyhedron_incremental_builder_3< HDS >::find_facet(), Polyhedron_incremental_builder_3< HDS >::first_vertex, Polyhedron_incremental_builder_3< HDS >::g1, Halfedge_data_structure_decorator< _HDS >::get_facet(), Polyhedron_incremental_builder_3< HDS >::get_vertex_to_edge_map(), Polyhedron_incremental_builder_3< HDS >::gprime, Polyhedron_incremental_builder_3< HDS >::h1, Polyhedron_incremental_builder_3< HDS >::hds, Polyhedron_incremental_builder_3< HDS >::index_to_vertex_map, Halfedge::is_border(), k, Polyhedron_incremental_builder_3< HDS >::last_vertex, Polyhedron_incremental_builder_3< HDS >::lookup_halfedge(), Polyhedron_incremental_builder_3< HDS >::lookup_hole(), Polyhedron_incremental_builder_3< HDS >::m_error, Polyhedron_incremental_builder_3< HDS >::m_verbose, Polyhedron_incremental_builder_3< HDS >::new_vertices, Halfedge::next(), Halfedge::opposite(), Halfedge_data_structure_decorator< _HDS >::set_prev(), Polyhedron_incremental_builder_3< HDS >::set_vertex_to_edge_map(), Polyhedron_incremental_builder_3< HDS >::v1, Polyhedron_incremental_builder_3< HDS >::w1, and Polyhedron_incremental_builder_3< HDS >::w2.

Referenced by Polyhedron_incremental_builder_3< HDS >::end_facet().

765  {
766 #else
767 add_vertex_to_facet( std::size_t v2) {
768 #endif
769  if ( m_error)
770  return;
771  Verbose_ostream verr( m_verbose);
772  CGAL_assertion( check_protocoll == 2);
773  if ( v2 >= new_vertices) {
774  verr << " " << std::endl;
775  verr << "Polyhedron_incremental_builder_3<HDS>::" << std::endl;
776  verr << "add_vertex_to_facet(): vertex index " << v2
777  << " is out-of-range [0," << new_vertices-1 << "]."
778  << std::endl;
779  m_error = true;
780  return;
781  }
783 
784  if ( first_vertex) {
786  w1 = v2;
787  first_vertex = false;
788  return;
789  }
790  if ( g1 == 0) {
792  gprime = lookup_halfedge( w1, v2);
793  if ( m_error)
794  return;
795  h1 = g1 = gprime->next();
796  v1 = w2 = v2;
797  return;
798  }
799  // g1, h1, v1, w1, w2 are set. Insert halfedge.
800  // Lookup v1-->v2
801  Halfedge* hprime;
802  if ( last_vertex)
803  hprime = gprime;
804  else {
805  hprime = lookup_halfedge( v1, v2);
806  if ( m_error)
807  return;
808  }
809  Halfedge* h2 = hprime->next();
810  CGAL_assertion( ! last_vertex || h2 == g1);
811  Halfedge* prev = h1->next();
812  h1->set_next( h2);
813  decorator.set_prev( h2, h1);
814 
815  if ( get_vertex_to_edge_map( v1) == 0) { // case 1:
816  h2->opposite()->set_next( h1->opposite());
817  decorator.set_prev( h1->opposite(), h2->opposite());
818  } else { // case 2:
819  bool b1 = h1->opposite()->is_border();
820  bool b2 = h2->opposite()->is_border();
821  if ( b1 && b2) {
822  Halfedge* hole = lookup_hole( v1);
823  if ( m_error)
824  return;
825  CGAL_assertion( hole != NULL);
826  h2->opposite()->set_next( hole->next());
827  decorator.set_prev( hole->next(), h2->opposite());
828  hole->set_next( h1->opposite());
829  decorator.set_prev( h1->opposite(), hole);
830  } else if ( b2) { // case 2.b:
831  CGAL_assertion( prev->is_border());
832  h2->opposite()->set_next( prev);
833  decorator.set_prev( prev, h2->opposite());
834  } else if ( b1) { // case 2.c:
835  CGAL_assertion( hprime->is_border());
836  hprime->set_next( h1->opposite());
837  decorator.set_prev( h1->opposite(), hprime);
838  } else if ( h2->opposite()->next() == h1->opposite()) {// case 2.d:
839  // f1 == f2
840  CGAL_assertion( decorator.get_facet( h1->opposite()) ==
841  decorator.get_facet( h2->opposite()));
842  } else { // case 2.e:
843  if ( prev == h2) { // case _i:
844  // nothing to be done, hole is closed.
845  } else { // case _ii:
846  CGAL_assertion( prev->is_border());
847  CGAL_assertion( hprime->is_border());
848  hprime->set_next( prev);
849  decorator.set_prev( prev, hprime);
850  // Check whether the halfedges around v1 are connected.
851  // It is sufficient to check it for h1 to prev.
852  // Assert loop termination.
853  CGAL_assertion_code( std::size_t k = 0;)
854  // Look for a hole in the facet complex starting at h1.
855  Halfedge* hole = 0;
856  Halfedge* e = h1;
857  do {
858  if ( e->is_border())
859  hole = e;
860  e = e->next()->opposite();
861  CGAL_assertion( k++ < hds.size_of_halfedges());
862  } while ( e->next() != prev && e != h1);
863  if ( e == h1) {
864  // disconnected facet complexes
865  if ( hole) {
866  // The complex can be connected with
867  // the hole at hprime.
868  hprime->set_next( hole->next());
869  decorator.set_prev( hole->next(), hprime);
870  hole->set_next( prev);
871  decorator.set_prev( prev, hole);
872  } else {
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;
879 
880  if ( current_facet && m_verbose) {
881  verr << " involved facets are:";
882  do {
883  if ( ! e->is_border())
884  verr << " " << find_facet(
885  decorator.get_facet(e));
886  e = e->next()->opposite();
887  } while ( e != h1);
888  verr << " (closed cycle) and";
889  e = hprime;
890  do {
891  if ( ! e->is_border())
892  verr << " " << find_facet(
893  decorator.get_facet(e));
894  } while ( e != hprime);
895  verr << "." << std::endl;
896  }
897  m_error = true;
898  return;
899  }
900  }
901  }
902  }
903  }
904  if( h1->vertex() == &(index_to_vertex_map[v1]))
906  CGAL_assertion( h1->vertex() == &(index_to_vertex_map[v1]));
907  h1 = h2;
908  v1 = v2;
909 }
#define CGAL_assertion(EX)
Definition: assertions.h:87
j indices k indices k
Definition: Indexing.h:6
Halfedge opposite() const
Get the ID of the opposite edge of a given edge.
Definition: Manifold_2.h:454
This class encapsulate a halfedge over a window manifold.
Definition: Manifold_2.h:446
Halfedge next() const
Get the next halfedge of its owner element.
Definition: Manifold_2.h:465
void set_vertex_to_edge_map(int i, Halfedge *h, Tag_true)
CGAL_assertion_code(int check_protocoll;) void initialize_vertex_to_edge_map(Size
bool is_border() const
Is the edge a border edge?
Definition: Manifold_2.h:476
void set_prev(Halfedge *h, Halfedge *g) const

Here is the call graph for this function:

Here is the caller graph for this function:

CGAL_MEDIUM_INLINE void begin_facet ( )

Definition at line 738 of file Polyhedron_incremental_builder_3.h.

References CGAL_assertion, Polyhedron_incremental_builder_3< HDS >::CGAL_assertion_code(), Polyhedron_incremental_builder_3< HDS >::current_facet, Polyhedron_incremental_builder_3< HDS >::first_vertex, Polyhedron_incremental_builder_3< HDS >::g1, Polyhedron_incremental_builder_3< HDS >::hds, Polyhedron_incremental_builder_3< HDS >::last_vertex, Polyhedron_incremental_builder_3< HDS >::m_error, Polyhedron_incremental_builder_3< HDS >::m_verbose, Halfedge_data_structure_decorator< _HDS >::new_facet(), and Polyhedron_incremental_builder_3< HDS >::new_vertices.

Referenced by Polyhedron_incremental_builder_3< HDS >::begin_surface().

738  {
739  if ( m_error)
740  return;
741  CGAL_assertion( check_protocoll == 1);
742  CGAL_assertion_code( check_protocoll = 2;)
743  if ( hds.size_of_facets() >= hds.capacity_of_facets()) {
744  Verbose_ostream verr( m_verbose);
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;
749  m_error = true;
750  return;
751  }
752  // initialize all status variables.
753  first_vertex = true; // denotes 'no vertex yet'
754  g1 = 0; // denotes 'no halfedge yet'
755  last_vertex = false;
756 
758  current_facet = decorator.new_facet( hds);
759 }
#define CGAL_assertion(EX)
Definition: assertions.h:87
CGAL_assertion_code(int check_protocoll;) void initialize_vertex_to_edge_map(Size

Here is the call graph for this function:

Here is the caller graph for this function:

CGAL_MEDIUM_INLINE void begin_surface ( Size  v,
Size  f,
Size  h = 0 
)

Definition at line 707 of file Polyhedron_incremental_builder_3.h.

References Polyhedron_incremental_builder_3< HDS >::begin_facet(), CGAL_assertion, Polyhedron_incremental_builder_3< HDS >::CGAL_assertion_code(), CGAL_MEDIUM_INLINE, Polyhedron_incremental_builder_3< HDS >::hds, Polyhedron_incremental_builder_3< HDS >::index_to_vertex_map, Polyhedron_incremental_builder_3< HDS >::initialize_vertex_to_edge_map(), Polyhedron_incremental_builder_3< HDS >::m_error, Polyhedron_incremental_builder_3< HDS >::new_facets, Polyhedron_incremental_builder_3< HDS >::new_halfedges, Polyhedron_incremental_builder_3< HDS >::new_vertices, Random_access_adaptor< IC >::reserve(), Polyhedron_incremental_builder_3< HDS >::rollback_f, Polyhedron_incremental_builder_3< HDS >::rollback_h, Polyhedron_incremental_builder_3< HDS >::rollback_v, and v.

707  {
708 #else
709 begin_surface( std::size_t v, std::size_t f, std::size_t h) {
710 #endif
711  CGAL_assertion( check_protocoll == 0);
712  CGAL_assertion_code( check_protocoll = 1;)
714  new_vertices = 0;
715  new_facets = 0;
716  new_halfedges = 0;
717  rollback_v = hds.size_of_vertices();
718  rollback_f = hds.size_of_facets();
719  rollback_h = hds.size_of_halfedges();
720  if ( h == 0) {
721  // Use the Eulerian equation for connected planar graphs. We do
722  // not know the number of facets that are holes and we do not
723  // know the genus of the surface. So we add 12 and a factor of
724  // 5 percent.
725  h = int((v + f - 2 + 12) * 2.1);
726  }
727  hds.reserve( hds.size_of_vertices() + v,
728  hds.size_of_halfedges() + h,
729  hds.size_of_facets() + f);
730  index_to_vertex_map = Random_access_index( hds.vertices_end());
733 }
#define CGAL_assertion(EX)
Definition: assertions.h:87
Tag_true void initialize_vertex_to_edge_map(Size n, Tag_false)
*********************************************************************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
Definition: roccomf90.h:20
Random_access_value_adaptor< Vertex_iterator, Vertex > Random_access_index
CGAL_assertion_code(int check_protocoll;) void initialize_vertex_to_edge_map(Size
void reserve(size_type r, std::forward_iterator_tag)

Here is the call graph for this function:

bool check_unconnected_vertices ( )

Definition at line 944 of file Polyhedron_incremental_builder_3.h.

References Polyhedron_incremental_builder_3< HDS >::get_vertex_to_edge_map(), i, Polyhedron_incremental_builder_3< HDS >::m_error, Polyhedron_incremental_builder_3< HDS >::m_verbose, and Polyhedron_incremental_builder_3< HDS >::new_vertices.

Referenced by Polyhedron_incremental_builder_3< HDS >::remove_unconnected_vertices().

944  {
945  if ( m_error)
946  return false;
947  bool unconnected = false;
948  Verbose_ostream verr( m_verbose);
949  for( std::size_t i = 0; i < new_vertices; i++) {
950  if( get_vertex_to_edge_map( i) == NULL) {
951  verr << "Polyhedron_incremental_builder_3<HDS>::\n"
952  << "check_unconnected_vertices( verb = true): "
953  << "vertex " << i << " is unconnected." << std::endl;
954  unconnected = true;
955  }
956  }
957  return unconnected;
958 }
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

Here is the caller graph for this function:

void end_facet ( )

Definition at line 914 of file Polyhedron_incremental_builder_3.h.

References Polyhedron_incremental_builder_3< HDS >::add_vertex_to_facet(), CGAL_assertion, Polyhedron_incremental_builder_3< HDS >::CGAL_assertion_code(), Polyhedron_incremental_builder_3< HDS >::current_facet, Polyhedron_incremental_builder_3< HDS >::first_vertex, Polyhedron_incremental_builder_3< HDS >::get_vertex_to_edge_map(), Polyhedron_incremental_builder_3< HDS >::last_vertex, Polyhedron_incremental_builder_3< HDS >::m_error, Polyhedron_incremental_builder_3< HDS >::new_facets, Halfedge_data_structure_decorator< _HDS >::set_facet_halfedge(), Polyhedron_incremental_builder_3< HDS >::w1, and Polyhedron_incremental_builder_3< HDS >::w2.

Referenced by Polyhedron_incremental_builder_3< HDS >::add_vertex_to_facet().

914  {
915  if ( m_error)
916  return;
917  CGAL_assertion( check_protocoll == 2);
919  // cleanup all static status variables
921  last_vertex = true;
923  CGAL_assertion( check_protocoll == 2);
924  CGAL_assertion_code( check_protocoll = 1;)
928  ++new_facets;
929 }
#define CGAL_assertion(EX)
Definition: assertions.h:87
void set_facet_halfedge(Facet *f, Halfedge *g) const
CGAL_assertion_code(int check_protocoll;) void initialize_vertex_to_edge_map(Size

Here is the call graph for this function:

Here is the caller graph for this function:

CGAL_MEDIUM_INLINE void end_surface ( )

Definition at line 934 of file Polyhedron_incremental_builder_3.h.

References CGAL_assertion, Polyhedron_incremental_builder_3< HDS >::CGAL_assertion_code(), and Polyhedron_incremental_builder_3< HDS >::m_error.

934  {
935  if ( m_error)
936  return;
937  CGAL_assertion( check_protocoll == 1);
938  CGAL_assertion_code( check_protocoll = 0;)
939 }
#define CGAL_assertion(EX)
Definition: assertions.h:87
CGAL_assertion_code(int check_protocoll;) void initialize_vertex_to_edge_map(Size

Here is the call graph for this function:

CGAL_LARGE_INLINE HDS::Size find_facet ( Facet f)
protected

Definition at line 513 of file Polyhedron_incremental_builder_3.h.

References CGAL_assertion, Polyhedron_incremental_builder_3< HDS >::hds, n, and Polyhedron_incremental_builder_3< HDS >::new_facets.

Referenced by Polyhedron_incremental_builder_3< HDS >::add_vertex_to_facet(), Polyhedron_incremental_builder_3< HDS >::lookup_halfedge(), and Polyhedron_incremental_builder_3< HDS >::lookup_hole().

513  {
514  if ( ! f)
515  return 0;
516  Size n = 0;
517  typename HDS::Facet_iterator it = hds.facets_begin();
518  while ( &(*it) != f) {
519  CGAL_assertion( it != hds.facets_end());
520  ++n;
521  ++it;
522  }
523  n = n - ( hds.size_of_facets() - new_facets);
524  return n;
525 }
#define CGAL_assertion(EX)
Definition: assertions.h:87
const NT & n

Here is the caller graph for this function:

CGAL_LARGE_INLINE HDS::Size find_vertex ( Vertex v)
protected

Definition at line 492 of file Polyhedron_incremental_builder_3.h.

References CGAL_assertion, Polyhedron_incremental_builder_3< HDS >::hds, n, and Polyhedron_incremental_builder_3< HDS >::new_vertices.

Referenced by Polyhedron_incremental_builder_3< HDS >::lookup_hole().

492  {
493  if ( ! v)
494  return 0;
495  Size n = 0;
496  typename HDS::Vertex_iterator it = hds.vertices_begin();
497  while ( &(*it) != v) {
498  CGAL_assertion( it != hds.vertices_end());
499  ++n;
500  ++it;
501  }
502  n = n - ( hds.size_of_vertices() - new_vertices);
503  return n;
504 }
#define CGAL_assertion(EX)
Definition: assertions.h:87
*********************************************************************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
Definition: roccomf90.h:20
const NT & n

Here is the caller graph for this function:

Halfedge* get_vertex_to_edge_map ( int  i,
Tag_false   
)
inlineprotected

Definition at line 135 of file Polyhedron_incremental_builder_3.h.

References i, and Polyhedron_incremental_builder_3< HDS >::vertex_to_edge_map.

135  {
136  // Use the self-managed array vertex_to_edge_map.
137  return vertex_to_edge_map[i];
138  }
blockLoc i
Definition: read.cpp:79
Halfedge* get_vertex_to_edge_map ( int  i)
inlineprotected

Definition at line 139 of file Polyhedron_incremental_builder_3.h.

References Polyhedron_incremental_builder_3< HDS >::get_vertex_to_edge_map().

139  {
141  }
HDS::Supports_vertex_halfedge Supports_vertex_halfedge
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

hds ( )
inline

Definition at line 185 of file Polyhedron_incremental_builder_3.h.

References Polyhedron_incremental_builder_3< HDS >::CGAL_assertion_code().

185  : m_error( false), m_verbose( verbose), hds(h) {
186  CGAL_assertion_code(check_protocoll = 0;)
187  }
CGAL_assertion_code(int check_protocoll;) void initialize_vertex_to_edge_map(Size

Here is the call graph for this function:

Tag_true void initialize_vertex_to_edge_map ( Size  n,
Tag_false   
)
inlineprotected

Definition at line 117 of file Polyhedron_incremental_builder_3.h.

References Polyhedron_incremental_builder_3< HDS >::vertex_to_edge_map.

Referenced by Polyhedron_incremental_builder_3< HDS >::begin_surface(), and Polyhedron_incremental_builder_3< HDS >::initialize_vertex_to_edge_map().

117  {
118  vertex_to_edge_map = std::vector<Halfedge*>();
119  vertex_to_edge_map.reserve(n);
120  }
const NT & n

Here is the caller graph for this function:

void initialize_vertex_to_edge_map ( Size  n)
inlineprotected

Definition at line 121 of file Polyhedron_incremental_builder_3.h.

References Polyhedron_incremental_builder_3< HDS >::initialize_vertex_to_edge_map().

121  {
123  }
Tag_true void initialize_vertex_to_edge_map(Size n, Tag_false)
HDS::Supports_vertex_halfedge Supports_vertex_halfedge
const NT & n

Here is the call graph for this function:

CGAL_LARGE_INLINE HDS::Halfedge * lookup_halfedge ( Size  w,
Size  v 
)
protected

Definition at line 534 of file Polyhedron_incremental_builder_3.h.

References Assert_compile_time_tag(), CGAL_assertion, Polyhedron_incremental_builder_3< HDS >::current_facet, Polyhedron_incremental_builder_3< HDS >::find_facet(), Halfedge_data_structure_decorator< _HDS >::get_facet(), Polyhedron_incremental_builder_3< HDS >::get_vertex_to_edge_map(), Polyhedron_incremental_builder_3< HDS >::hds, Polyhedron_incremental_builder_3< HDS >::index_to_vertex_map, Halfedge::is_border(), Polyhedron_incremental_builder_3< HDS >::last_vertex, Polyhedron_incremental_builder_3< HDS >::m_error, Polyhedron_incremental_builder_3< HDS >::m_verbose, Polyhedron_incremental_builder_3< HDS >::new_facets, Polyhedron_incremental_builder_3< HDS >::new_halfedges, Polyhedron_incremental_builder_3< HDS >::new_vertices, Halfedge::next(), Halfedge::opposite(), Halfedge_data_structure_decorator< _HDS >::set_facet(), Halfedge_data_structure_decorator< _HDS >::set_prev(), and v.

Referenced by Polyhedron_incremental_builder_3< HDS >::add_vertex_to_facet().

534  {
535  typedef typename HDS::Supports_halfedge_vertex
536  Supports_halfedge_vertex;
537  Assert_compile_time_tag( Supports_halfedge_vertex(), Tag_true());
541  Verbose_ostream verr( m_verbose);
544  if ( e) {
545  CGAL_assertion( e->vertex() == &(index_to_vertex_map[w]));
546  // check that the facet has no self intersections
547  if ( current_facet && current_facet == decorator.get_facet(e)) {
548  verr << " " << std::endl;
549  verr << "Polyhedron_incremental_builder_3<HDS>::"
550  << std::endl;
551  verr << "lookup_halfedge(): input error: facet "
552  << new_facets << " has a self intersection at vertex "
553  << w << "." << std::endl;
554  m_error = true;
555  return 0;
556  }
557  Halfedge* start_edge = e;
558  do {
559  if ( e->next()->vertex() == &(index_to_vertex_map[v]) ) {
560  if ( ! e->next()->is_border()) {
561  verr << " " << std::endl;
562  verr << "Polyhedron_incremental_builder_3"
563  "<HDS>::" << std::endl;
564  verr << "lookup_halfedge(): input error: facet "
565  << new_facets << " shares a halfedge from "
566  "vertex " << w << " to vertex " << v
567  << " with";
568  if ( current_facet)
569  verr << " facet "
570  << find_facet( decorator.get_facet(e->next()))
571  << '.' << std::endl;
572  else
573  verr << " another facet." << std::endl;
574  m_error = true;
575  return 0;
576  }
577  CGAL_assertion( ! e->next()->opposite()->is_border());
578  if ( current_facet &&
579  current_facet ==
580  decorator.get_facet( e->next()->opposite())) {
581  verr << " " << std::endl;
582  verr << "Polyhedron_incremental_builder_3"
583  "<HDS>::" << std::endl;
584  verr << "lookup_halfedge(): input error: facet "
585  << new_facets << " has a self intersection "
586  "at the halfedge from vertex " << w
587  << " to vertex " << v << "." << std::endl;
588  m_error = true;
589  return 0;
590  }
591  decorator.set_facet( e->next(), current_facet);
592  return e;
593  }
594  e = e->next()->opposite();
595  } while ( e != start_edge);
596  }
597  // create a new halfedge
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 "
602  << new_halfedges << " halfedges added while creating facet"
603  << new_facets << '.' << std::endl;
604  m_error = true;
605  return 0;
606  }
607  e = hds.new_edge();
608  new_halfedges++;
609  new_halfedges++;
610  decorator.set_facet( e, current_facet);
611  e->set_vertex( &(index_to_vertex_map[v]));
612  e->set_next( 0);
613  decorator.set_prev( e, e->opposite());
614  e = e->opposite();
615  e->set_vertex( &(index_to_vertex_map[w]));
616  e->set_next( e->opposite());
617  return e;
618 }
#define CGAL_assertion(EX)
Definition: assertions.h:87
Halfedge opposite() const
Get the ID of the opposite edge of a given edge.
Definition: Manifold_2.h:454
This class encapsulate a halfedge over a window manifold.
Definition: Manifold_2.h:446
Halfedge next() const
Get the next halfedge of its owner element.
Definition: Manifold_2.h:465
*********************************************************************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
Definition: roccomf90.h:20
bool is_border() const
Is the edge a border edge?
Definition: Manifold_2.h:476
void Assert_compile_time_tag(const Tag &, const Derived &b)
void set_facet(Halfedge *h, Facet *f) const
void set_prev(Halfedge *h, Halfedge *g) const

Here is the call graph for this function:

Here is the caller graph for this function:

Halfedge* lookup_hole ( Size  w)
inlineprotected
CGAL_LARGE_INLINE HDS::Halfedge * lookup_hole ( Halfedge e)
protected

Definition at line 627 of file Polyhedron_incremental_builder_3.h.

References CGAL_assertion, Polyhedron_incremental_builder_3< HDS >::current_facet, Polyhedron_incremental_builder_3< HDS >::find_facet(), Polyhedron_incremental_builder_3< HDS >::find_vertex(), Halfedge_data_structure_decorator< _HDS >::get_facet(), Halfedge::is_border(), Polyhedron_incremental_builder_3< HDS >::m_error, Polyhedron_incremental_builder_3< HDS >::m_verbose, Polyhedron_incremental_builder_3< HDS >::new_facets, Halfedge::next(), and Halfedge::opposite().

627  {
628  CGAL_assertion( e != NULL);
630  Halfedge* start_edge = e;
631  do {
632  if ( e->next()->is_border()) {
633  return e;
634  }
635  e = e->next()->opposite();
636  } while ( e != start_edge);
637 
638  Verbose_ostream verr( m_verbose);
639  verr << " " << std::endl;
640  verr << "Polyhedron_incremental_builder_3<HDS>::" << std::endl;
641  verr << "lookup_hole(): input error: at vertex "
642  << find_vertex( e->vertex())
643  << " a closed surface already exists and facet "
644  << new_facets << " is nonetheless adjacent." << std::endl;
645  if ( current_facet) {
646  verr << " The closed cycle of facets is:";
647  do {
648  if ( ! e->is_border())
649  verr << " " << find_facet( decorator.get_facet(e));
650  e = e->next()->opposite();
651  } while ( e != start_edge);
652  verr << '.' << std::endl;
653  }
654  m_error = true;
655  return 0;
656 }
#define CGAL_assertion(EX)
Definition: assertions.h:87
Halfedge opposite() const
Get the ID of the opposite edge of a given edge.
Definition: Manifold_2.h:454
This class encapsulate a halfedge over a window manifold.
Definition: Manifold_2.h:446
Halfedge next() const
Get the next halfedge of its owner element.
Definition: Manifold_2.h:465
bool is_border() const
Is the edge a border edge?
Definition: Manifold_2.h:476

Here is the call graph for this function:

m_verbose ( verbose  )
void push_back_vertex_to_edge_map ( Halfedge ,
Tag_true   
)
inlineprotected
void push_back_vertex_to_edge_map ( Halfedge h,
Tag_false   
)
inlineprotected

Definition at line 125 of file Polyhedron_incremental_builder_3.h.

References Polyhedron_incremental_builder_3< HDS >::vertex_to_edge_map.

125  {
126  vertex_to_edge_map.push_back(h);
127  }
void push_back_vertex_to_edge_map ( Halfedge h)
inlineprotected

Definition at line 128 of file Polyhedron_incremental_builder_3.h.

References Polyhedron_incremental_builder_3< HDS >::push_back_vertex_to_edge_map().

128  {
130  }
void push_back_vertex_to_edge_map(Halfedge *, Tag_true)
HDS::Supports_vertex_halfedge Supports_vertex_halfedge

Here is the call graph for this function:

bool remove_unconnected_vertices ( Tag_false  )
inline

Definition at line 239 of file Polyhedron_incremental_builder_3.h.

References Polyhedron_incremental_builder_3< HDS >::check_unconnected_vertices().

Here is the call graph for this function:

bool remove_unconnected_vertices ( )
inline

Definition at line 242 of file Polyhedron_incremental_builder_3.h.

242  {
243  // returns `true' if all unconnected vertices could be removed
244  // succesfully.
246  }
void rollback ( )

Definition at line 688 of file Polyhedron_incremental_builder_3.h.

References CGAL_assertion, Polyhedron_incremental_builder_3< HDS >::CGAL_assertion_code(), CGAL_MEDIUM_INLINE, Polyhedron_incremental_builder_3< HDS >::hds, Polyhedron_incremental_builder_3< HDS >::m_error, Polyhedron_incremental_builder_3< HDS >::rollback_f, Polyhedron_incremental_builder_3< HDS >::rollback_h, and Polyhedron_incremental_builder_3< HDS >::rollback_v.

688  {
689  CGAL_assertion( rollback_v <= hds.size_of_vertices());
690  CGAL_assertion( rollback_h <= hds.size_of_halfedges());
691  CGAL_assertion( rollback_f <= hds.size_of_facets());
692  while ( rollback_v != hds.size_of_vertices())
693  hds.vertex_pop_back();
694  CGAL_assertion((( hds.size_of_halfedges() - rollback_h) & 1) == 0);
695  while ( rollback_h != hds.size_of_halfedges())
696  hds.edge_pop_back();
697  while ( rollback_f != hds.size_of_facets())
698  hds.facet_pop_back();
699  m_error = false;
700  CGAL_assertion_code( check_protocoll = 0;)
701 }
#define CGAL_assertion(EX)
Definition: assertions.h:87
CGAL_assertion_code(int check_protocoll;) void initialize_vertex_to_edge_map(Size

Here is the call graph for this function:

void set_vertex_to_edge_map ( int  i,
Halfedge h,
Tag_true   
)
inlineprotected

Definition at line 142 of file Polyhedron_incremental_builder_3.h.

References i, and Polyhedron_incremental_builder_3< HDS >::index_to_vertex_map.

Referenced by Polyhedron_incremental_builder_3< HDS >::add_vertex_to_facet(), and Polyhedron_incremental_builder_3< HDS >::set_vertex_to_edge_map().

142  {
143  // Use the halfedge pointer within the vertex.
144  index_to_vertex_map[i].set_halfedge(h);
145  }
blockLoc i
Definition: read.cpp:79

Here is the caller graph for this function:

void set_vertex_to_edge_map ( int  i,
Halfedge h,
Tag_false   
)
inlineprotected

Definition at line 146 of file Polyhedron_incremental_builder_3.h.

References i, and Polyhedron_incremental_builder_3< HDS >::vertex_to_edge_map.

146  {
147  // Use the self-managed array vertex_to_edge_map.
148  vertex_to_edge_map[i] = h;
149  }
blockLoc i
Definition: read.cpp:79
void set_vertex_to_edge_map ( int  i,
Halfedge h 
)
inlineprotected

Definition at line 150 of file Polyhedron_incremental_builder_3.h.

References Polyhedron_incremental_builder_3< HDS >::set_vertex_to_edge_map().

150  {
152  }
HDS::Supports_vertex_halfedge Supports_vertex_halfedge
void set_vertex_to_edge_map(int i, Halfedge *h, Tag_true)
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

Member Data Documentation

__pad0__

Definition at line 185 of file Polyhedron_incremental_builder_3.h.


The documentation for this class was generated from the following file: