MantisBT - Community
View Issue Details
0017899Community[OCCT] OCCT:Visualizationpublic2007-11-21 20:412011-12-15 16:30
san 
san 
normaltrivial 
closedfixed 
All
 
[OCCT] 6.3.0 
0017899: OCC Forum: Select3D_Box2d does not handle "void" correctly
"void" state of Select3D_Box2d class is initalized and processed incorrectly.

"void" currently means all four coordinates of a 2d box are zeros.
Therefore, if Update() method is called with a point lying in a negative
quadrant, 2d box is computed incorrectly: xmax and ymax remain zeros.
Similar problem happens to xmin and ymin if a point lying in a positive
quadrant is passed to Update(): xmin and ymin remain zeros.

It is necessary either to introduce "isVoid" field in the 2d box class and take
this flag into account in Update() method, or to use some "invalid" values for
coordinates of a "void" box in order to detect this state correctly in Update().

==============================================
Original messages from the forum
(http://www.opencascade.org/org/forum/thread_12459 [^])

 Stephane Routelous 2007-11-20 15:20
I encounter the problem with Select3D_SensitiveCurve after the first rotation.
This means the second time the detection areas are computed, I end up with a
Select3d_Box2d "using" the point (0,0) as maximum. This cause the detection
areas to be messed up.
The original code will not work correctly if you add only positive of negative
points to your box
the problem is not in the IsVoid test, but in the Update method :
ex : if you have
Select3D_Box2d b;
b.Update(gp_Pnt2d(-10,10));
b.Update(gp_Pnt2d(-20,-20));

you will endup with xmin=ymin=-20 xmax=ymax=0 instead of xmax=ymax=-10
because of the "aBox.Update(xmin, ymin, xmax, ymax);"

inline void Update(const gp_Pnt2d& thePnt)
{
Bnd_Box2d aBox;
aBox.Set(thePnt);
if ( !isVoid ) //if you don't add that, the 2d box will be wrong
aBox.Update(xmin, ymin, xmax, ymax);
SetField(aBox);
}
Documentation remark, added by san 2008-02-11 13:20:10:

Changes:
Initialization of Select3D_Box2d class used by interactive selection has been
corrected in order for the box coordinates to be updated properly and thus to
avoid picking errors.
No tags attached.
gz san-OCC17899-v1.tar.gz (588) 2007-11-21 18:43
https://tracker.dev.opencascade.org/
gz nkv-OCC17899-v2.tar.gz (619) 2008-02-11 13:05
https://tracker.dev.opencascade.org/
Issue History
2007-12-11 16:45bugmasterAssigned Tobugmaster => san
2007-12-11 16:45bugmasterStatusnew => assigned
2008-02-11 15:20sanStatusassigned => resolved
2008-02-22 16:22mkvStatusresolved => tested
2008-03-14 10:38bugmasterStatustested => verified
2009-06-23 18:40bugmasterStatusverified => closed
2009-06-23 18:40bugmasterResolution@0@ => fixed
2011-08-02 11:24bugmasterCategoryOCCT:VIZ => OCCT:Visualization
2011-12-15 16:30abvDescription Updatedbug_revision_view_page.php?rev_id=1261#r1261
2011-12-15 16:30abvAdditional Information Updatedbug_revision_view_page.php?rev_id=1263#r1263
2011-12-15 16:30abvProjectOpen CASCADE => Community

There are no notes attached to this issue.