contrib/brl/bbas/btol/btol_edge_algs.h
Go to the documentation of this file.
00001 #ifndef btol_edge_algs_h_
00002 #define btol_edge_algs_h_
00003 
00004 //-----------------------------------------------------------------------------
00005 //:
00006 // \file
00007 // \author J.L. Mundy
00008 // \brief topology algorithms involving edges or edge-centric routines
00009 //
00010 // \verbatim
00011 // Initial version November 25, 2002
00012 // \endverbatim
00013 //
00014 //-----------------------------------------------------------------------------
00015 #include <vcl_vector.h>
00016 #include "dll.h"
00017 #include <vtol/vtol_vertex_sptr.h>
00018 #include <vtol/vtol_edge_sptr.h>
00019 #include <vtol/vtol_vertex_2d_sptr.h>
00020 #include <vtol/vtol_edge_2d_sptr.h>
00021 #include <vsol/vsol_box_2d.h>
00022 class btol_edge_algs
00023 {
00024  public:
00025   static BTOL_DLL_DATA const double tol;
00026   ~btol_edge_algs();
00027   //: use static methods
00028 
00029   //:Splits e at v and returns the two edges e1, e2, which are incident at v.
00030   static bool split_edge_2d(vtol_vertex_2d_sptr const& v,
00031                             vtol_edge_2d_sptr const& e,
00032                             vtol_edge_2d_sptr& e1, vtol_edge_2d_sptr& e2);
00033 
00034   //:Removes e's inferiors from e and removes e from superiors of e's inferiors
00035   static bool unlink_all_inferiors_twoway(vtol_edge_2d_sptr const& e);
00036 
00037   //:Replace va on edge e by vb
00038   static bool subst_vertex_on_edge(vtol_vertex_sptr const& va,
00039                                    vtol_vertex_sptr const& vb,
00040                                    vtol_edge_sptr const& e);
00041 
00042   //:A convenient erase interface
00043   static void edge_2d_erase(vcl_vector<vtol_edge_2d_sptr>& edges,
00044                             vtol_edge_2d_sptr const& e);
00045 
00046   //:Get the bounding box for a set of edges
00047   static vsol_box_2d bounding_box(vcl_vector<vtol_edge_2d_sptr>& edges);
00048   
00049   //:Find the vertex closest to the specified position
00050   static vtol_vertex_2d_sptr closest_vertex(vtol_edge_2d_sptr const& e,
00051                                             const double x, const double y);
00052  private:
00053   btol_edge_algs();
00054 };
00055 
00056 #endif