contrib/brl/bbas/imesh/imesh_detection.h
Go to the documentation of this file.
00001 // This is brl/bbas/imesh/imesh_detection.h
00002 #ifndef imesh_detection_h_
00003 #define imesh_detection_h_
00004 //:
00005 // \file
00006 // \brief Detect features on meshes
00007 // \author Matt Leotta (mleotta@lems.brown.edu)
00008 // \date May 29, 2008
00009 //
00010 // \verbatim
00011 //  Modifications
00012 //   <none yet>
00013 // \endverbatim
00014 
00015 
00016 #include "imesh_mesh.h"
00017 #include <vcl_vector.h>
00018 
00019 //: Return the indices of half edges that are on the mesh boundary
00020 //  The results are organized into loops
00021 vcl_vector<vcl_vector<unsigned int> >
00022 imesh_detect_boundary_loops(const imesh_half_edge_set& half_edges);
00023 
00024 
00025 //: Trace half edges that have been selected into loops
00026 //  \return true if all half edges form loops
00027 //  The loops are returned in \param loops as vectors of half edge indices
00028 bool
00029 imesh_trace_half_edge_loops(const imesh_half_edge_set& half_edges,
00030                             const vcl_vector<bool>& flags,
00031                             vcl_vector<vcl_vector<unsigned int> >& loops);
00032 
00033 //: Return the indices of contour half edges as seen from direction \param dir
00034 //  The results are organized into loops
00035 vcl_vector<vcl_vector<unsigned int> >
00036 imesh_detect_contour_generator(const imesh_mesh& mesh, const vgl_vector_3d<double>& dir);
00037 
00038 //: Mark contour half edges as seen from direction \param dir
00039 //  For each contour edge the half edge with the face normal opposing dir is marked
00040 vcl_vector<bool>
00041 imesh_detect_contours(const imesh_mesh& mesh, vgl_vector_3d<double> dir);
00042 
00043 
00044 //: Return the indices of contour half edges as seen from center of projection \param pt
00045 //  The results are organized into loops
00046 vcl_vector<vcl_vector<unsigned int> >
00047 imesh_detect_contour_generator(const imesh_mesh& mesh, const vgl_point_3d<double>& pt);
00048 
00049 //: Mark contour half edges as seen from center of projection \param pt
00050 //  For each contour edge the half edge with the face normal opposing dir is marked
00051 vcl_vector<bool>
00052 imesh_detect_contours(const imesh_mesh& mesh, const vgl_point_3d<double>& pt);
00053 
00054 
00055 //: Segment the faces into groups of connected components
00056 vcl_vector<vcl_set<unsigned int> >
00057 imesh_detect_connected_components(const imesh_half_edge_set& he);
00058 
00059 //: Compute the set of all faces in the same connected component as \a face
00060 vcl_set<unsigned int>
00061 imesh_detect_connected_faces(const imesh_half_edge_set& he, unsigned int face);
00062 
00063 
00064 #endif // imesh_detection_h_