contrib/brl/bbas/imesh/algo/imesh_detect.h
Go to the documentation of this file.
00001 // This is brl/bbas/imesh/algo/imesh_detect.h
00002 #ifndef imesh_detect_h_
00003 #define imesh_detect_h_
00004 //:
00005 // \file
00006 // \brief Detect features on meshes
00007 // \author Matt Leotta (mleotta@lems.brown.edu)
00008 // \date May 30, 2008
00009 //
00010 // \verbatim
00011 //  Modifications
00012 //   <none yet>
00013 // \endverbatim
00014 
00015 
00016 #include <imesh/imesh_mesh.h>
00017 #include <vcl_set.h>
00018 #include <vgl/vgl_vector_3d.h>
00019 
00020 
00021 //: Return the set of triangles that are visible from this viewing direction
00022 //  Backfacing triangles are not rendered or counted if \a backfacing == NULL
00023 // if \a backfacing is valid, backfacing exterior triangles are also added to this set
00024 vcl_set<unsigned int>
00025 imesh_detect_exterior_faces(const imesh_mesh& mesh,
00026                             const vgl_vector_3d<double>& dir,
00027                             unsigned int img_size = 1000,
00028                             vcl_set<unsigned int> *backfacing = NULL);
00029 
00030 
00031 //: Return the set of triangles that are visible in some of the many sample view directions
00032 //  Does NOT render backfacing faces or count them as exterior
00033 vcl_set<unsigned int>
00034 imesh_detect_exterior_faces(const imesh_mesh& mesh,
00035                             unsigned int num_dir_samples = 8,
00036                             unsigned int img_size = 1000);
00037 
00038 
00039 //: Return the set of triangles that are visible in some of the many sample view directions
00040 //  Does render backfacing faces and classifies exterior faces as:
00041 //  - frontfacing - seen only from the front
00042 //  - backfacing  - seen only from the back
00043 //  - bifacing    - seen from both sides
00044 void
00045 imesh_detect_exterior_faces(const imesh_mesh& mesh,
00046                             vcl_set<unsigned int>& frontfacing,
00047                             vcl_set<unsigned int>& backfacing,
00048                             vcl_set<unsigned int>& bifacing,
00049                             unsigned int num_dir_samples = 8,
00050                             unsigned int img_size = 1000);
00051 
00052 #endif // imesh_detect_h_