45 borg->
point(), bdst->point(),
46 gdst->point(),
eps_e);
65 gorg->
point(), gdst->point(),
66 bdst->point(),
eps_e);
76 pnt = gorg->
point()+t*(gdst->point()-gorg->
point());
92 std::fabs(b1.
xmax()-b2.xmax())) <= tol_a &&
94 std::fabs(b1.
ymax()-b2.ymax())) <= tol_a &&
96 std::fabs(b1.
zmax()-b2.zmax())) <= tol_a);
100 overlay_features_1() {
103 bool determined_direction=
false;
105 const Real bbox_tol = 1.e-1, d2e_ratio_sq=0.5, d2e_ratio_sq_l=1.e-4;
110 for ( Feature_list_1::iterator it_f_b = lf_b.begin(), iend_f_b=lf_b.end();
111 it_f_b != iend_f_b; ++it_f_b) {
112 std::cout <<
"\nProcessing blue ridge with bounding box "
113 << it_f_b->bbox << std::endl;
115 Feature_1::iterator it_b_mid = it_f_b->begin();
117 std::advance( it_b_mid, (f_b->size()-1)/2);
121 const Point_3 &bpdst = bdst->point();
126 Feature_list_1::iterator f_g = lf_g.end();
127 Feature_1::iterator it_g_mid;
128 Real param=-HUGE_VAL, sqd=HUGE_VAL;
131 for ( Feature_list_1::iterator it_f_g = lf_g.begin(), iend_f_g=lf_g.end();
132 it_f_g != iend_f_g; ++it_f_g) {
138 !
equal( it_f_b->bbox, it_f_g->bbox, bbox_tol))
141 std::cout <<
"\tComparing with green ridge with bounding box "
142 << it_f_g->bbox << std::endl;
143 if ( bnode != NULL) {
146 { it_g_mid = it_f_g->begin(); param = 0.; }
148 { it_g_mid = --it_f_g->end(); param = 1.; }
152 for ( Feature_1::iterator tmp_it_g=it_f_g->begin(),
iend=it_f_g->end();
153 tmp_it_g !=
iend; ++tmp_it_g) {
156 const Point_3 &gporg = gorg->point(), &gpdst = gdst->point();
158 Real gsqlen = (gpdst-gporg).squared_norm(), sd=gsqlen*d2e_ratio_sq;
159 if ( (bpdst-gporg).squared_norm()<sd ||
160 (bpdst-gpdst).squared_norm()<sd) {
168 if ( t>=0 && t <= 1) {
169 Point_3 gp = gporg+t*(gpdst-gporg);
170 Real sd = (gp-bpdst).squared_norm();
171 if (sd < d2e_ratio_sq*(bpdst-b->
origin()->
point()).squared_norm() && sd<sqd) {
172 f_g = it_f_g; it_g_mid = tmp_it_g; param=t; sqd = sd;
173 if ( sqd < d2e_ratio_sq_l*gsqlen)
break;
181 if ( f_g == lf_g.end()) {
182 std::cout <<
"Warning: Could not find match for the blue ridge!" << std::endl;
184 it_f_b = --lf_b.erase( it_f_b);
189 std::cout <<
"\tMatched with green ridge with bounding box "
190 << f_g->
bbox << std::endl;
198 bool dir_match = dir_b*dir_g > 0;
201 if ( bnode == NULL) {
209 if ( !determined_direction) {
216 determined_direction =
true;
225 Feature_1::iterator it_g=it_g_mid;
226 if ( param == 0. && dir_match)
227 {
if ( it_g == f_g->begin()) it_g = f_g->end(); --it_g; }
228 else if ( param == 1. && !dir_match)
229 { ++it_g;
if ( it_g == f_g->end()) it_g = f_g->begin(); }
231 for (Feature_1::iterator it_b=it_b_mid,
iend=--f_b->begin();
232 it_b!=
iend; --it_b) {
253 {
if ( it_g == f_g->begin()) it_g = f_g->end(); --it_g; }
255 { ++it_g;
if ( it_g == f_g->end()) it_g = f_g->begin(); }
263 if ( param == 0. && !dir_match)
264 {
if ( it_g == f_g->begin()) it_g = f_g->end(); --it_g; }
265 else if ( param == 1. && dir_match)
266 { ++it_g;
if ( it_g == f_g->end()) it_g = f_g->begin(); }
268 for (Feature_1::iterator it_b=it_b_mid,
iend=f_b->end(); ++it_b!=
iend; ) {
288 { ++it_g;
if ( it_g == f_g->end()) it_g = f_g->begin(); }
290 {
if ( it_g == f_g->begin()) it_g = f_g->end(); --it_g; }
299 std::cout <<
"Ignored " << dropped <<
" 1-features in \"" <<
B->
name()
300 <<
"\" during matching" << std::endl;
302 if ( (dropped=lf_g.size()-lf_b.size()))
303 std::cout <<
"Ignored " << dropped <<
" 1-features in \"" <<
G->
name()
304 <<
"\" after matching" << std::endl;
std::string name() const
The name of the window.
Vertex * get_origin(Halfedge *h) const
Parent_type parent_type(const int color) const
Real project_green_feature(const Vector_3 &n, const Vector_3 &t, const Point_3 &p1, const Point_3 &p2, const Point_3 &q, const Real eps_p) const
Halfedge * get_opposite(Halfedge *h) const
Vertex_overlay * destination()
RFC_Pane_overlay * get_pane(Vertex *v) const
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
INode * project_next_vertex(Halfedge *, Halfedge *)
RFC_Window_overlay::Feature_list_1 Feature_list_1
This class encapsulate a halfedge over a window manifold.
INode * get_inode(Vertex *v) const
Host_face get_edge_parent(const INode &i0, const INode &i1, const int color) const
Vector_3 & get_tangent(Halfedge *h, Vertex *v)
Vertex_overlay * origin()
RFC_Window_overlay::Vertex Vertex
Point object that represents a single point.
bool snap_on_features() const
#define RFC_END_NAME_SPACE
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
const Point_2S & nat_coor(const int color) const
Real project_blue_feature(const Vector_3 &n1, const Vector_3 &n2, const Vector_3 &t1, const Vector_3 &t2, const Point_3 &q1, const Point_3 &q2, const Point_3 &p, const Real eps_p) const
RFC_Window_overlay::Feature_1 Feature_1
#define RFC_BEGIN_NAME_SPACE
Node destination() const
Obtain the (primary copy of the) destination of the edge.
static bool equal(const Bbox_3 &b1, const Bbox_3 &b2, Real tol_r)
void set_parent(INode *i, Halfedge *h, const Point_2 &p, int color)
Halfedge * halfedge(const int color) const
Feature_list_1 & flist_1()
HDS_accessor< Tag_true > acc
const Point_3< Real > & point() const
Obtain the coordinates of a node.
void insert_node_in_blue_edge(INode &x, Halfedge *b)
Vertex * get_destination(Halfedge *h) const
Some basic geometric data types.
bool is_feature_1(const Halfedge *h) const
Node origin() const
Obtain the (primary copy of the) origin of the edge.
Vector_3 & get_normal(int v)
SURF::Vector_2< Real > Point_2