The main entry of feature detection.
729 int size_edges=0, dropped=0;
733 for ( ; it !=
iend; ++it) {
735 int num_hedgs=pane.
_hds.size_of_halfedges();
736 int num_verts=pane.
_hds.size_of_vertices();
737 size_edges+=num_hedgs/2;
744 std::vector< pair<float, Halfedge*> > tstrong_edges, rstrong_edges;
745 tstrong_edges.reserve(size_edges/10);
746 rstrong_edges.reserve(size_edges/10);
754 for ( RFC_Pane_overlay::HDS::Halfedge_iterator
755 hit=pane.
hds().halfedges_begin(), hend=pane.
hds().halfedges_end();
756 hit!=hend; ++ ++hit) {
762 if ( d <
_cos_uf) tstrong_edges.push_back( make_pair(d,h));
768 std::cout <<
"\tIdentified " << tstrong_edges.size()
770 <<
" in " << t1-t0 <<
" sec." << std::endl;
774 sort(tstrong_edges.begin(),tstrong_edges.end());
777 std::cout <<
"\tSorted theta-strong edges in "
778 << t1-t0 <<
" sec." << std::endl;
781 vector<std::pair<float,Halfedge*> > iedges; iedges.reserve(16);
788 for ( vector< pair<float,Halfedge*> >::iterator
789 it=tstrong_edges.begin(),
iend=tstrong_edges.end(); it!=
iend; ++it){
807 for (
int c=0; c<2; ++c) {
809 Halfedge *h = ((c==0)?f1.back():f1.front());
817 pair<float, Halfedge*> t0(d0,(c==0)?h0:h);
818 pair<float, Halfedge*> cos_max(
HUGE_VALF,NULL);
824 pair<float, Halfedge*> t(d,h1);
825 iedges.push_back( t);
827 if ( t < cos_max) cos_max = t;
832 if ( cos_max.first>
_cos_uf && iedges.size()>1) {
833 for (
int i=0,
s=iedges.size();
i<
s; ++
i) {
836 iedges[
i].first =
acos(iedges[
i].first)*t;
838 sort(iedges.rbegin(),iedges.rend());
842 is_strong = cos_max.first >= iedges[1].first*
_rf ||
845 min_fa_r=
std::min(min_fa_r,cos_max.first/iedges[1].first);
848 float a = -v1*v2/
sqrt((v1*v1)*(v2*v2));
851 rstrong_edges.push_back(make_pair(
cos_face_angle(cos_max.second,0),
865 f1.push_front( hopp);
868 if ( !is_strong)
break;
879 std::cout <<
"\tIdentified " << rstrong_edges.size()
880 <<
" r-strong edges with r=" <<
_rf
881 <<
" in " << t1-t0 <<
" sec." << std::endl;
882 sort(rstrong_edges.begin(), rstrong_edges.end());
891 std::cout <<
"\tFound " <<
_f_list_1.size() <<
" ridges and "
892 <<
_f_list_0.size() <<
" corners and dropped "
893 << dropped <<
" false-strong edges.\n"
894 <<
"\tDone in " << totaltime <<
" sec." << std::endl;
902 for ( Feature_list_1::iterator it=
_f_list_1.begin();
905 for (Feature_1::iterator hi=it->begin(), hiend=it->end(); hi!=hiend; ++hi){
913 free_vector( tstrong_edges); rstrong_edges.clear();
bool is_strong_ad(Vertex *v)
Determine whether a vertex is strong (either theta-strong or relatively strong) in angle defect...
Vertex * get_origin(Halfedge *h) const
void set_strong_edge(Halfedge *h)
std::vector< bool > _is_f_0
void subdiv_feature_curve(const Feature_1 &f1, Feature_list_1 &new_flist, int &dropped)
Subdivide a feature curve by splitting it at 0-features.
void free_vector(std::vector< _TT > &v)
const Pane & pane(const int pid) const
Get a reference to the pane with give id pid.
Halfedge * get_opposite(Halfedge *h) const
RFC_Pane_overlay * get_pane(Vertex *v) const
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
bool marked(const Halfedge *h) const
SURF::Vector_3< Real > Vector_3
std::vector< bool > _is_on_f
Vector_3 get_tangent(const Halfedge *h)
std::list< Feature_1 > Feature_list_1
float cos_face_angle(Halfedge *h, Halfedge *hopp)
Compute the cosine of the face angle (dihedral angle) at an edge.
std::vector< bool > _is_f_1
const Point & point() const
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode iend
void identify_features_0()
Identify the 0-features.
static HDS_accessor< Tag_true > acc
void print_features()
Dump out the 0- and 1-features in Tecplot format into files <name>f0.plt, <name>f1.plt, respectively.
std::vector< float > _fd_1
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Pane_set _pane_set
The set of panes contained in the window.
bool is_on_feature(const Vertex *v) const
Halfedge * get_next_around_origin(Halfedge *h) const
void mark(Halfedge *h) const
std::vector< float > _ad_0
Halfedge_overlay Halfedge
Vertex * get_destination(Halfedge *h) const
CImg< _cimg_Tfloat > acos(const CImg< T > &instance)
RFC_BEGIN_NAME_SPACE double get_wtime()
void dump_strong_edges(const std::vector< std::pair< float, Halfedge * > > &, const std::vector< std::pair< float, Halfedge * > > &)
Dump out the strong edges in Tecplot format into file <name>s1.plt.
std::vector< float > _ea_0