Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Manipulation of Strong Curves

Functions

bool check_false_strong_1 (Feature_1 &)
 Determine whether a curve is false strong. More...
 
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. More...
 
void merge_features_1 (Vertex *v, Feature_1 &f1, Feature_1 &f2)
 Merge two feature curves into one at vertex v. More...
 
void remove_feature_1 (Feature_1 &f)
 Remove a false strong curve. More...
 

Detailed Description

Function Documentation

bool check_false_strong_1 ( Feature_1 f1)
protected

Determine whether a curve is false strong.

Definition at line 330 of file RFC_Window_overlay_fea.C.

References acc, HDS_accessor< _MP >::get_destination(), HDS_accessor< _MP >::get_halfedge(), HDS_accessor< _MP >::get_next_around_destination(), HDS_accessor< _MP >::get_opposite(), HDS_accessor< _MP >::get_origin(), HDS_accessor< _MP >::get_pane(), RFC_Pane_overlay::unset_strong_edge(), and v.

330  {
331  if ( cos_face_angle( f1.front(),NULL)==-1) return false;
332 
333  Vertex *src = acc.get_origin(f1.front());
334  Vertex *dst = acc.get_destination( f1.back());
335 
336  // is a loop or strong at both ends
337  if ( src == dst || is_on_feature( src) && is_on_feature( dst)
338  && (!_f0_ranks.empty() || is_feature_0(src) || is_feature_0(dst)) ||
339  cos_face_angle(f1.front(),NULL)<0 && cos_face_angle(f1.back(),NULL)<0)
340  return false;
341 
342  // Is it weak ended? If so, pop out the weak edges
343  if ( _strong_ended) {
344  if ( !f1.empty()) for (;;) {
345  Halfedge *h=f1.front(), *hopp=acc.get_opposite(h);
346 
347  if ( is_on_feature( src) || cos_face_angle( h, hopp) <= _cos_uf || is_strong_ad( src))
348  break;
349  else {
351  acc.get_pane( hopp)->unset_strong_edge( hopp);
352  f1.pop_front();
353  }
354  if ( !f1.empty())
355  src = acc.get_origin( f1.front());
356  else
357  return true;
358  }
359 
360  if ( !f1.empty()) for (;;) {
361  Halfedge *h=f1.back();
362  Halfedge *hopp=acc.get_opposite(h);
363 
364  if ( is_on_feature( dst) || cos_face_angle( h, hopp) <= _cos_uf
365  || is_strong_ad( src))
366  break;
367  else {
369  acc.get_pane( hopp)->unset_strong_edge( hopp);
370  f1.pop_back();
371  }
372  if ( !f1.empty())
373  dst = acc.get_destination( f1.back());
374  else
375  return true;
376  }
377  }
378 
379  // is it too short?
380  if ( _min_1f_len) {
381  int c = !(is_strong_ad( src) || is_feature_0( src)) +
382  !(is_strong_ad( dst) || is_feature_0( dst));
383  if ( int(f1.size()) <= c*_min_1f_len)
384  return true;
385  }
386 
387  // is it too close to another features?
388  if ( _long_falseness_check) {
389  if ( _f_list_1.empty() ||
390  (is_strong_ad( src) || is_feature_0( src)) &&
391  (is_strong_ad( dst) || is_feature_0( dst)))
392  return false;
393  for ( Feature_1::const_iterator it=++f1.begin(); it!=f1.end(); ++it) {
394  Vertex *v = acc.get_origin( *it);
395  Halfedge *h0 = acc.get_halfedge( v), *h1=h0;
396  // Loop through incident edges of v
397  do {
398  if ( is_on_feature( acc.get_origin( h1))) { v=NULL; break; }
399  } while ( (h1=acc.get_next_around_destination(h1))!=h0);
400  if (v==NULL) continue;
401  else return false;
402  }
403  return true;
404  }
405  return false;
406 }
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
Definition: HDS_accessor.h:87
Halfedge * get_opposite(Halfedge *h) const
Definition: HDS_accessor.h:99
RFC_Pane_overlay * get_pane(Vertex *v) const
Definition: HDS_accessor.h:128
Halfedge * get_halfedge(Vertex *v) const
Definition: HDS_accessor.h:75
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS 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 v
Definition: roccomf90.h:20
float cos_face_angle(Halfedge *h, Halfedge *hopp)
Compute the cosine of the face angle (dihedral angle) at an edge.
void unset_strong_edge(Halfedge *h)
Feature_list_1 _f_list_1
bool is_feature_0(const Vertex *v) const
static HDS_accessor< Tag_true > acc
bool is_on_feature(const Vertex *v) const
Halfedge_overlay Halfedge
Halfedge * get_next_around_destination(Halfedge *h) const
Definition: HDS_accessor.h:146
Vertex * get_destination(Halfedge *h) const
Definition: HDS_accessor.h:93
std::map< Vertex *, int > _f0_ranks

Here is the call graph for this function:

void merge_features_1 ( Vertex v,
Feature_1 f1,
Feature_1 f2 
)
protected

Merge two feature curves into one at vertex v.

After the operation, f1 becomes the union of f1 and f2, and f2 becomes empty.

Definition at line 297 of file RFC_Window_overlay_fea.C.

References acc, HDS_accessor< _MP >::get_destination(), HDS_accessor< _MP >::get_opposite(), HDS_accessor< _MP >::get_origin(), and RFC_assertion.

297  {
298  RFC_assertion( !f1.empty() && f1!=f2);
299  if ( f2.empty()) return;
300 
301  Vertex *dst, *src;
302 
303  if ( (dst=acc.get_destination( f1.back())) ==
304  acc.get_origin( f2.front()) && v==dst)
305  f1.splice( f1.end(), f2);
306  else if ( (src=acc.get_origin( f1.front())) ==
307  acc.get_destination( f2.back()) && v==src) {
308  f2.splice( f2.end(), f1);
309  f1.swap( f2);
310  }
311  else if ( dst == acc.get_destination( f2.back()) && v==dst) {
312  while ( !f2.empty()) {
313  f1.push_back( acc.get_opposite( f2.back()));
314  f2.pop_back();
315  }
316  }
317  else {
318  RFC_assertion( src == acc.get_origin( f2.front()) && v==src);
319  while ( !f2.empty()) {
320  f1.push_front( acc.get_opposite( f2.front()));
321  f2.pop_front();
322  }
323  }
324  RFC_assertion( f2.empty());
325 }
Vertex * get_origin(Halfedge *h) const
Definition: HDS_accessor.h:87
Halfedge * get_opposite(Halfedge *h) const
Definition: HDS_accessor.h:99
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS 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 v
Definition: roccomf90.h:20
static HDS_accessor< Tag_true > acc
Vertex * get_destination(Halfedge *h) const
Definition: HDS_accessor.h:93
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

void remove_feature_1 ( Feature_1 f)

Remove a false strong curve.

Definition at line 527 of file RFC_Window_overlay_fea.C.

References RFC_Pane_overlay::_f_n_index, acc, RFC_Pane_overlay::get_index(), HDS_accessor< _MP >::get_next_around_destination(), HDS_accessor< _MP >::get_opposite(), HDS_accessor< _MP >::get_pane(), iend, k, and RFC_assertion.

527  {
528 
529  for ( Feature_1::iterator it=f.begin(), iend=f.end(); it != iend; ++it) {
531  }
532 
533  for ( Feature_1::iterator it=f.begin(), iend=f.end(); it != iend; ++it) {
534  Halfedge *k = *it, *kopp = acc.get_opposite( k);
535  RFC_assertion( !acc.get_pane(k)->_f_n_index.empty());
536  do {
537  Halfedge *h0 = k, *h = h0;
538  do {
541  pane._f_n_index[ pane.get_index( h)] = -1;
542  } while ( (h=acc.get_next_around_destination(h)) != h0);
543  } while ( (k=(k==kopp)?*it:kopp) != *it);
544  }
545 }
const Pane & pane(const int pid) const
Get a reference to the pane with give id pid.
Halfedge * get_opposite(Halfedge *h) const
Definition: HDS_accessor.h:99
j indices k indices k
Definition: Indexing.h:6
RFC_Pane_overlay * get_pane(Vertex *v) const
Definition: HDS_accessor.h:128
**********************************************************************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
static HDS_accessor< Tag_true > acc
std::vector< int > _f_n_index
void unset_strong_edge(Halfedge *h) const
int get_index(const Vertex *v) const
bool is_feature_1(const Halfedge *h) const
Halfedge_overlay Halfedge
Halfedge * get_next_around_destination(Halfedge *h) const
Definition: HDS_accessor.h:146
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

void subdiv_feature_curve ( const Feature_1 f1,
Feature_list_1 new_flist,
int &  dropped 
)
protected

Subdivide a feature curve by splitting it at 0-features.

Some false strong edges may be filtered out during this step.

Definition at line 412 of file RFC_Window_overlay_fea.C.

References acc, d, HDS_accessor< _MP >::get_destination(), HDS_accessor< _MP >::get_opposite(), HDS_accessor< _MP >::get_origin(), HDS_accessor< _MP >::get_pane(), i, max(), min(), RFC_assertion, RFC_Pane_overlay::unset_strong_edge(), and v.

413  {
414 
415  // We loop through all vertices in the curve to locate the 0-features
416  list< Feature_1::const_iterator> divs;
417  Vertex *src = acc.get_origin(f1.front());
418  Vertex *trg = acc.get_destination( f1.back());
419  bool isloop = (src==trg);
420 
421  // A 1-feature is dangling if one of its end point is a terminus
422  bool isdangling = !isloop &&
423  (_f0_ranks.find( src) == _f0_ranks.end() ||
424  _f0_ranks.find( trg) == _f0_ranks.end());
425 
426  float cos_min_fa_before=1, cos_min_fa_after=1;
427  Feature_1::const_iterator f1end = f1.end(), hfirst = f1end, hlast=f1end;
428 
429  for (Feature_1::const_iterator hprev=f1.begin(),hi=++f1.begin(),hnext=hi;
430  hi!=f1end; hprev=hi,hi=hnext) {
431  ++hnext;
432  Vertex *v = acc.get_origin(*hi);
433  if ( is_feature_0( v)) { RFC_assertion( hi==f1.begin()); continue; }
434 
435  float cos_ea = cos_edge_angle( f1, hi, isloop);
436  if ( cos_ea <= _cos_ue ||
437  is_rstrong_ea( f1, hprev, hnext, cos_ea, isloop)) {
438  divs.push_back( hi);
439  // When breaking loops, mark breakpoints as corners
440  set_feature_0( acc.get_origin( *hi));
441  }
442  else if ( isdangling) {
443  // Mark transitions between strong and week edges for danging 1-features
444  // as 0-feature
445  float dpre = cos_face_angle( *hprev, acc.get_opposite( *hprev));
446  float d = cos_face_angle( *hi, acc.get_opposite( *hi));
447 
448  if ( hfirst == f1end && dpre < cos_min_fa_before)
449  cos_min_fa_before = dpre;
450 
451  if ( std::min( dpre,d) <= _cos_weakend &&
452  std::max( dpre,d) > _cos_weakend ) {
453  if ( hfirst == f1end) hfirst = hi;
454  hlast = hi; cos_min_fa_after = 1.;
455  }
456 
457  if ( d < cos_min_fa_before) cos_min_fa_after = d;
458  }
459  }
460 
461  if ( isdangling && divs.empty() ) {
462  if ( hfirst!=f1end && cos_min_fa_before>_cos_weakend &&
463  _f0_ranks.find( src) == _f0_ranks.end() )
464  { divs.push_back( hfirst); set_feature_0( acc.get_origin( *hfirst)); }
465 
466  if ( hlast!=f1end && hlast!=hfirst && cos_min_fa_after>_cos_weakend &&
467  _f0_ranks.find( trg) == _f0_ranks.end())
468  { divs.push_back( hlast); set_feature_0( acc.get_origin( *hlast)); }
469  }
470 
471  if ( isloop) {
472  // Finally, we process end vertices
473  Feature_1::const_iterator hi = f1.begin();
474  float cos_ea = cos_edge_angle( f1, hi, isloop);
475  if ( cos_ea <= _cos_ue ||
476  is_rstrong_ea( f1,f1end,++f1.begin(),cos_ea,isloop)) {
477  // When breaking loops, mark breakpoints as corners
478  divs.push_back( f1end); set_feature_0( acc.get_origin( *hi));
479  }
480  }
481  else
482  divs.push_back( f1end);
483 
484  // Now subdivide the curve into sub-curves
485  Feature_list_1 subcur;
486  if ( divs.size()==0)
487  subcur.push_back( f1);
488  else {
489  subcur.push_back( Feature_1( f1.begin(),divs.front()));
490  list< Feature_1::const_iterator>::const_iterator dit=divs.begin();
491  for ( list< Feature_1::const_iterator>::const_iterator
492  dinext=dit; ++dinext != divs.end(); dit=dinext)
493  subcur.push_back( Feature_1( *dit, *dinext));
494 
495  if ( isloop) {
496  Feature_1 &newf=subcur.front();
497  newf.insert( newf.begin(), *dit, f1end);
498  }
499  }
500 
501  // Check the sub-curves to filter out false-strongness.
502  for (Feature_list_1::iterator sit=subcur.begin();sit!=subcur.end();++sit) {
503  if ( check_false_strong_1( *sit)) {
504  for ( Feature_1::const_iterator i=sit->begin(); i!=sit->end(); ++i) {
505  acc.get_pane(*i)->unset_strong_edge(*i); ++dropped;
506  Halfedge *hopp=acc.get_opposite(*i);
507  acc.get_pane( hopp)->unset_strong_edge( hopp);
508  }
509  }
510  else {
511  // Set all vertices on-feature
512  set_on_feature( acc.get_origin( sit->front()));
513  for ( Feature_1::const_iterator i=sit->begin(); i!=sit->end(); ++i)
515 
516  Vertex *src = acc.get_origin(sit->front());
517  Vertex *dst = acc.get_destination(sit->back());
518 
519  if ( src!=dst) { set_feature_0( src); set_feature_0( dst); }
520  new_flist.push_back( Feature_1()); new_flist.back().swap(*sit);
521  }
522  }
523 }
Vertex * get_origin(Halfedge *h) const
Definition: HDS_accessor.h:87
float cos_edge_angle(const Halfedge *h1, const Halfedge *h2)
Compute the cosine of the edge angle at a vertex between two incident feature edges.
void set_on_feature(Vertex *v) const
const NT & d
Halfedge * get_opposite(Halfedge *h) const
Definition: HDS_accessor.h:99
RFC_Pane_overlay * get_pane(Vertex *v) const
Definition: HDS_accessor.h:128
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
bool check_false_strong_1(Feature_1 &)
Determine whether a curve is false strong.
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS 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 v
Definition: roccomf90.h:20
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.
bool is_rstrong_ea(const Feature_1 &f1, Feature_1::const_iterator hprev, Feature_1::const_iterator hnext, float cos_ea, bool isloop)
Determine whether a vertex is relatively strong in edge angle within a give feature.
void unset_strong_edge(Halfedge *h)
bool is_feature_0(const Vertex *v) const
static HDS_accessor< Tag_true > acc
blockLoc i
Definition: read.cpp:79
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
void set_feature_0(Vertex *v) const
Halfedge_overlay Halfedge
Vertex * get_destination(Halfedge *h) const
Definition: HDS_accessor.h:93
std::map< Vertex *, int > _f0_ranks
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function: