📄 snc_items.h
字号:
if(shalfloop_ != sncp()->shalfloops_end()) valid = valid && (++SFace_const_iterator(sfaces_begin_) == sfaces_last_); else valid = valid && (sfaces_begin_ == sfaces_last_); } valid = valid && (sfaces_begin_ != sncp()->sfaces_end()); if(sfaces_begin_ == sfaces_last_) { valid = valid && (shalfloop_ == sncp()->shalfloops_end()); } else valid = valid && (sfaces_begin_->sface_cycles_begin() != sfaces_begin_->sface_cycles_end()); verr << "end of CGAL::SNC_items<...>::Vertex::is_valid(): structure is " << ( valid ? "valid." : "NOT VALID.") << std::endl; return valid; } }; // Vertex//----------------------------------------------------------------------------- template <typename Refs> class SVertex { // == Halfedge typedef void* GenPtr; typedef typename Refs::Mark Mark; typedef typename Refs::Vector_3 Vector_3; typedef typename Refs::Sphere_point Sphere_point; typedef typename Refs::Vertex_handle Vertex_handle; typedef typename Refs::Halfedge_handle Halfedge_handle; typedef typename Refs::SVertex_handle SVertex_handle; typedef typename Refs::SHalfedge_handle SHalfedge_handle; typedef typename Refs::SFace_handle SFace_handle; typedef typename Refs::Vertex_const_handle Vertex_const_handle; typedef typename Refs::Halfedge_const_handle Halfedge_const_handle; typedef typename Refs::SVertex_const_handle SVertex_const_handle; typedef typename Refs::SHalfedge_const_handle SHalfedge_const_handle; typedef typename Refs::SFace_const_handle SFace_const_handle; Vertex_handle center_vertex_; Mark mark_; SVertex_handle twin_; SHalfedge_handle out_sedge_; SFace_handle incident_sface_; GenPtr info_; Sphere_point point_; public: SVertex() : center_vertex_(), mark_(), twin_(), out_sedge_(), incident_sface_(), info_(), point_() {} SVertex(Mark m) : center_vertex_(), mark_(m), twin_(), out_sedge_(), incident_sface_(), info_(), point_() {} ~SVertex() { CGAL_NEF_TRACEN(" destroying Halfedge item "<<&*this); } SVertex(const SVertex<Refs>& e) { center_vertex_ = e.center_vertex_; point_ = e.point_; mark_ = e.mark_; twin_ = e.twin_; out_sedge_ = e.out_sedge_; incident_sface_ = e.incident_sface_; info_ = 0; } SVertex<Refs>& operator=(const SVertex<Refs>& e) { center_vertex_ = e.center_vertex_; point_ = e.point_; mark_ = e.mark_; twin_ = e.twin_; out_sedge_ = e.out_sedge_; incident_sface_ = e.incident_sface_; info_ = 0; return *this; } Vertex_handle& center_vertex() { return center_vertex_; } Vertex_const_handle center_vertex() const { return center_vertex_; } Vertex_handle& source() { return center_vertex_; } Vertex_const_handle source() const { return center_vertex_; } Vertex_handle& target() { return twin()->source(); } Vertex_const_handle target() const { return twin()->source(); } Mark& mark() { return mark_; } const Mark& mark() const { return mark_; } Vector_3 vector() const { return (point_ - CGAL::ORIGIN); } Sphere_point& point(){ return point_; } const Sphere_point& point() const { return point_; } SVertex_handle& twin() { return twin_; } SVertex_const_handle twin() const { return twin_; } SHalfedge_handle& out_sedge() { return out_sedge_; } SHalfedge_const_handle out_sedge() const { return out_sedge_; } SFace_handle& incident_sface() { return incident_sface_; } SFace_const_handle incident_sface() const { return incident_sface_; } bool is_isolated() const { return (out_sedge() == SHalfedge_handle()); } GenPtr& info() { return info_; } const GenPtr& info() const { return info_; } public: std::string debug() const { std::stringstream os; set_pretty_mode(os); os<<"sv [ "<<point_<<info_<<" ] "; return os.str(); } bool is_twin() const { return (&*twin_ < this); } bool is_valid( bool verb = false, int level = 0) const { Verbose_ostream verr(verb); verr << "begin CGAL::SNC_items<...>::SVertex::is_valid( verb=true, " "level = " << level << "):" << std::endl; bool valid = (center_vertex_ != NULL && center_vertex_ != Vertex_handle()); valid = valid && (twin_ != NULL && twin_ != SVertex_handle() && twin_ != SVertex_handle()); // valid = valid && (out_sedge_ != NULL); // valid = valid && (incident_sface_ != SFace_handle()); // valid = valid &&((out_sedge_ != NULL && incident_sface_ == NULL) || // (out_sedge_ == NULL && incident_sface_ != NULL)); valid = valid && (out_sedge_ != NULL || incident_sface_ != NULL); verr << "end of CGAL::SNC_items<...>::SVertex::is_valid(): structure is " << ( valid ? "valid." : "NOT VALID.") << std::endl; return valid; } }; // SVertex//----------------------------------------------------------------------------- template <typename Refs> class Halffacet { typedef void* GenPtr; typedef typename Refs::Mark Mark; typedef typename Refs::Plane_3 Plane_3; typedef typename Refs::Halffacet_handle Halffacet_handle; typedef typename Refs::Halffacet_const_handle Halffacet_const_handle; typedef typename Refs::Volume_handle Volume_handle; typedef typename Refs::Volume_const_handle Volume_const_handle; typedef typename Refs::Object_list Object_list; typedef typename Refs::Halffacet_cycle_iterator Halffacet_cycle_iterator; typedef typename Refs::Halffacet_cycle_const_iterator Halffacet_cycle_const_iterator; Plane_3 supporting_plane_; Mark mark_; Halffacet_handle twin_; Volume_handle volume_; Object_list boundary_entry_objects_; // SEdges, SLoops public: Halffacet() : supporting_plane_(), mark_() {} Halffacet(const Plane_3& h, Mark m) : supporting_plane_(h), mark_(m) {} ~Halffacet() { CGAL_NEF_TRACEN(" destroying Halffacet item "<<&*this); } Halffacet(const Halffacet<Refs>& f) { supporting_plane_ = f.supporting_plane_; mark_ = f.mark_; twin_ = f.twin_; CGAL_NEF_TRACEN("VOLUME const"); volume_ = f.volume_; boundary_entry_objects_ = f.boundary_entry_objects_; } Halffacet<Refs>& operator=(const Halffacet<Refs>& f) { if (this == &f) return *this; supporting_plane_ = f.supporting_plane_; mark_ = f.mark_; twin_ = f.twin_; CGAL_NEF_TRACEN("VOLUME op="); volume_ = f.volume_; boundary_entry_objects_ = f.boundary_entry_objects_; return *this; } Mark& mark() { return mark_; } const Mark& mark() const { return mark_; } Halffacet_handle& twin() { return twin_; } Halffacet_const_handle twin() const { return twin_; } Plane_3& plane() { return supporting_plane_; } const Plane_3& plane() const { return supporting_plane_; } Volume_handle& incident_volume() { return volume_; } Volume_const_handle incident_volume() const { return volume_; } Object_list& boundary_entry_objects() { return boundary_entry_objects_; } const Object_list& boundary_entry_objects() const { return boundary_entry_objects_; } GenPtr& info() { return this->info_; } const GenPtr& info() const { return this->info_; } Halffacet_cycle_iterator facet_cycles_begin() { return boundary_entry_objects_.begin(); } Halffacet_cycle_iterator facet_cycles_end() { return boundary_entry_objects_.end(); } Halffacet_cycle_const_iterator facet_cycles_begin() const { return boundary_entry_objects_.begin(); } Halffacet_cycle_const_iterator facet_cycles_end() const { return boundary_entry_objects_.end(); } bool is_twin() const { return (&*twin_ < this); } bool is_valid( bool verb = false, int level = 0) const { Verbose_ostream verr(verb); verr << "begin CGAL::SNC_items<...>::Halffacet::is_valid( verb=true, " "level = " << level << "):" << std::endl; bool valid = (twin_ != NULL && twin_ != Halffacet_handle()); valid = valid && (volume_ != NULL && volume_ != Volume_handle()); valid = valid && (supporting_plane_.a() != 0 || supporting_plane_.b() != 0 || supporting_plane_.c() != 0); valid = valid && (!boundary_entry_objects_.empty()); verr << "end of CGAL::SNC_items<...>::Halffacet::is_valid(): structure is " << ( valid ? "valid." : "NOT VALID.") << std::endl; return valid; } }; // Halffacet//----------------------------------------------------------------------------- template <typename Refs> class Volume { typedef void* GenPtr; typedef typename Refs::Mark Mark; typedef typename Refs::Volume_handle Volume_handle; typedef typename Refs::Volume_const_handle Volume_const_handle; typedef typename Refs::Object_list Object_list; typedef typename Refs::Shell_entry_iterator Shell_entry_iterator; typedef typename Refs::Shell_entry_const_iterator Shell_entry_const_iterator; Mark mark_; Object_list shell_entry_objects_; // SFaces public: Volume() {} Volume(Mark m) : mark_(m) {} ~Volume() { CGAL_NEF_TRACEN(" destroying Volume item "<<&*this); } Volume(const Volume<Refs>& v) { mark_ = v.mark_; shell_entry_objects_ = v.shell_entry_objects_; } Volume<Refs>& operator=(const Volume<Refs>& v) { if (this == &v) return *this; mark_ = v.mark_; shell_entry_objects_ = v.shell_entry_objects_; return *this; } Mark& mark() { return mark_; } const Mark& mark() const { return mark_; } GenPtr& info() { return this->info_; } const GenPtr& info() const { return this->info_; } Object_list& shell_entry_objects() { return shell_entry_objects_; } const Object_list& shell_entry_objects() const { return shell_entry_objects_; } Shell_entry_iterator shells_begin() { return shell_entry_objects_.begin(); } Shell_entry_iterator shells_end() { return shell_entry_objects_.end(); } Shell_entry_const_iterator shells_begin() const { return shell_entry_objects_.begin(); } Shell_entry_const_iterator shells_end() const { return shell_entry_objects_.end(); } bool is_valid( bool verb = false, int level = 0) const { Verbose_ostream verr(verb); verr << "begin CGAL::SNC_items<...>::Volume::is_valid( verb=true, " "level = " << level << "):" << std::endl; bool valid = (!shell_entry_objects_.empty()); verr << "end of CGAL::SNC_items<...>::Volume::is_valid(): structure is " << ( valid ? "valid." : "NOT VALID.") << std::endl; return valid; } }; // Volume//----------------------------------------------------------------------------- template <typename Refs> class SHalfedge { typedef void* GenPtr; typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_circle Sphere_circle; typedef typename Refs::Halfedge_handle Halfedge_handle; typedef typename Refs::Halfedge_const_handle Halfedge_const_handle; typedef typename Refs::SVertex_handle SVertex_handle; typedef typename Refs::SVertex_const_handle SVertex_const_handle; typedef typename Refs::SHalfedge_handle SHalfedge_handle; typedef typename Refs::SHalfedge_const_handle SHalfedge_const_handle; typedef typename Refs::SFace_handle SFace_handle;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -