View Issue Details

IDProjectCategoryView StatusLast Update
0017899CommunityOCCT:Visualizationpublic2011-12-15 16:30
ReportersanAssigned Tosan 
PrioritynormalSeveritytrivial 
Status closedResolutionfixed 
OSAll 
Fixed in Version6.3.0 
Summary0017899: OCC Forum: Select3D_Box2d does not handle "void" correctly
Description"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);
}
Additional information
and documentation updates
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.
TagsNo tags attached.
Test case number

Attached Files

  • san-OCC17899-v1.tar.gz (588 bytes)
  • nkv-OCC17899-v2.tar.gz (619 bytes)

Activities

2007-11-21 18:43

 

san-OCC17899-v1.tar.gz (588 bytes)

2008-02-11 13:05

 

nkv-OCC17899-v2.tar.gz (619 bytes)

Issue History

Date Modified Username Field Change
2007-12-11 16:45 bugmaster Assigned To bugmaster => san
2007-12-11 16:45 bugmaster Status new => assigned
2008-02-11 15:20 san Status assigned => resolved
2008-02-22 16:22 mkv Status resolved => tested
2008-03-14 10:38 bugmaster Status tested => verified
2009-06-23 18:40 bugmaster Status verified => closed
2009-06-23 18:40 bugmaster Resolution @0@ => fixed
2011-08-02 11:24 bugmaster Category OCCT:VIZ => OCCT:Visualization
2011-12-15 16:30 abv Description Updated
2011-12-15 16:30 abv Additional Information Updated
2011-12-15 16:30 abv Project Open CASCADE => Community