MantisBT - Community
View Issue Details
0017899Community[OCCT] OCCT:Visualizationpublic2007-11-21 20:412011-12-15 16:30
[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
( [^])

 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;

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;
if ( !isVoid ) //if you don't add that, the 2d box will be wrong
aBox.Update(xmin, ymin, xmax, ymax);
Documentation remark, added by san 2008-02-11 13:20:10:

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
gz nkv-OCC17899-v2.tar.gz (619) 2008-02-11 13:05
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.