contrib/brl/bbas/btol/btol_face_algs.h
Go to the documentation of this file.
00001 #ifndef btol_face_algs_h_
00002 #define btol_face_algs_h_
00003 //-----------------------------------------------------------------------------
00004 //:
00005 // \file
00006 // \author J.L. Mundy
00007 // \brief topology algorithms involving faces or face-centric routines
00008 // \verbatim
00009 //  Modifications
00010 //   Initial version October 30, 2003
00011 // \endverbatim
00012 //
00013 //-----------------------------------------------------------------------------
00014 #include <vnl/vnl_matrix_fixed.h>
00015 #include <vgl/vgl_polygon.h>
00016 #include <vsol/vsol_point_2d_sptr.h>
00017 #include <vsol/vsol_polygon_2d_sptr.h>
00018 #include <vtol/vtol_vertex_sptr.h>
00019 #include <vtol/vtol_edge_2d_sptr.h>
00020 #include <vtol/vtol_face_2d_sptr.h>
00021 #include <vtol/vtol_one_chain_sptr.h>
00022 #include <vcl_vector.h>
00023 
00024 class btol_face_algs
00025 {
00026  public:
00027   static  bool vtol_to_vgl(vtol_face_2d_sptr const & face,
00028                            vgl_polygon<double>& poly);
00029 
00030   static  bool vgl_to_vtol(vgl_polygon<double>const & poly,
00031                            vtol_face_2d_sptr& face);
00032 
00033   static  bool vsol_to_vtol(vsol_polygon_2d_sptr const & poly,
00034                             vtol_face_2d_sptr& face);
00035 
00036   static  bool edge_intersects(vtol_face_2d_sptr const & face,
00037 
00038                                vtol_edge_2d_sptr const & edge);
00039 
00040   static bool intersecting_edges(vtol_face_2d_sptr const & face,
00041                                  vcl_vector<vtol_edge_2d_sptr> const & edges,
00042                                  vcl_vector<vtol_edge_2d_sptr>& inter_edges);
00043 
00044   //:only valid for face with straight line edges
00045   static vsol_point_2d_sptr centroid(vtol_face_2d_sptr const & face);
00046 
00047   //:create an axis-aligned box face
00048   static vtol_face_2d_sptr box(const double x0, const double y0,
00049                                const double width, const double height);
00050   //:create a one chain from a set of vertices
00051   static
00052     vtol_one_chain_sptr one_chain(vcl_vector<vtol_vertex_sptr> const& verts);
00053 
00054   //:transform the face with a general 3x3 planar mapping
00055   static vtol_face_2d_sptr transform(vtol_face_2d_sptr const& face,
00056                                      vnl_matrix_fixed<double, 3, 3> const& T);
00057  private:
00058   // Do not instantiate an object of this type, just use the static methods:
00059   btol_face_algs() {}
00060   ~btol_face_algs() {}
00061 };
00062 
00063 #endif // btol_face_algs_h_