Re: Highliting problem (is a ComputeDepth probrem?)

I think it's a problem in Select3D_Projector.

Select3D_SensitiveTriangulation::ComputeDepth require a EyeLine in global coordinate, but Select3D_Projector::Shoot return not like that in my test.

I think this problem is Select3D_Projector::Proj use myView, but Select3D_Projector::Shoot use myInvTrasf.

I try to write a patch of this problem. Please tell me is my understanding is OK or Not?

gp_Lin Select3D_Projector::Shoot
(const Standard_Real X,
const Standard_Real Y) const
{
gp_Lin L;

#ifdef MY_OCC1576
if(!myView.IsNull()){
Standard_Real Xout,Yout, Zout, px,py,pz;
Standard_Integer XPix, YPix;
// projection plane Xv,Yv into the pixel point Xp,Yp
myView->Convert( X,Y, XPix,YPix);
// projected point Xp,Yp into a point of the reference frame of the view defined by X,Y,Z.
myView->Convert( XPix,YPix, Xout,Yout,Zout );
// Proj is negative?
myView->Proj( px, py, pz );
L = gp_Lin(gp_Pnt(Xout,Yout,Zout),
gp_Dir(-px,-py,-pz));
}
else{
#endif
if (myPersp) {
L = gp_Lin(gp_Pnt(0,0, myFocus),
gp_Dir(X,Y,-myFocus));
}
else {
L = gp_Lin(gp_Pnt(X,Y,0),
gp_Dir(0,0,-1));
}
L.Transform(myInvTrsf);
#ifdef MY_OCC1576
}
#endif
return L;
}

Francois Lauzon's picture

Hi,
it seems to be working, I try it here with some models, but I can't tell you if your understanding is ok, because I don't know about the internal of 3d selection/highlighting.

Francois.