1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

0022554: Application hangs on selection

This commit is contained in:
AAA 2012-02-22 13:01:33 +00:00 committed by bugmaster
parent 529afc1a20
commit ceae62f08e
15 changed files with 1293 additions and 756 deletions

@ -2,3 +2,4 @@ Select3D_Pnt.hxx
Select3D_Pnt2d.hxx
Select3D_Box2d.hxx
Select3D_Macro.hxx
Select3D_PointData.hxx

@ -80,5 +80,6 @@ is
imported Pnt;
imported Pnt2d;
imported Box2d;
imported PointData;
end Select3D;

@ -0,0 +1,105 @@
#ifndef _Select3D_PointData_HeaderFile
#define _Select3D_PointData_HeaderFile
#include <Select3D_Pnt.hxx>
#include <Select3D_Pnt2d.hxx>
// A framework for safe management of Select3D_SensitivePoly polygons of 3D and 2D points
class Select3D_PointData {
public:
// Constructs internal arrays of 2D and 3D points defined
// by number of points theNbPoints
Select3D_PointData (const Standard_Integer theNbPoints)
{
if (theNbPoints <= 0)
Standard_ConstructionError::Raise("Select3D_PointData");
mynbpoints = theNbPoints;
mypolyg3d = new Select3D_Pnt[mynbpoints];
mypolyg2d = new Select3D_Pnt2d[mynbpoints];
}
// Destructor
~Select3D_PointData ()
{
delete [] mypolyg3d;
delete [] mypolyg2d;
}
// Sets Select3D_Pnt to internal array
// of 3D points if theIndex is valid
void SetPnt (const Standard_Integer theIndex,
const Select3D_Pnt& theValue)
{
if (theIndex < 0 || theIndex >= mynbpoints)
Standard_OutOfRange::Raise("Select3D_PointData::SetPnt");
mypolyg3d[theIndex] = theValue;
}
// Sets gp_Pnt to internal array
// of 3D points if theIndex is valid
void SetPnt (const Standard_Integer theIndex,
const gp_Pnt& theValue)
{
if (theIndex < 0 || theIndex >= mynbpoints)
Standard_OutOfRange::Raise("Select3D_PointData::SetPnt");
mypolyg3d[theIndex] = theValue;
}
// Sets Select3D_Pnt2d to internal array
// of 2D points if theIndex is valid
void SetPnt2d (const Standard_Integer theIndex,
const Select3D_Pnt2d& theValue)
{
if (theIndex < 0 || theIndex >= mynbpoints)
Standard_OutOfRange::Raise("Select3D_PointData::SetPnt2d");
mypolyg2d[theIndex] = theValue;
}
// Sets gp_Pnt2d to internal array
// of 2D points if theIndex is valid
void SetPnt2d (const Standard_Integer theIndex,
const gp_Pnt2d& theValue)
{
if (theIndex < 0 || theIndex >= mynbpoints)
Standard_OutOfRange::Raise("Select3D_PointData::SetPnt2d");
mypolyg2d[theIndex] = theValue;
}
// Returns 3D point from internal array
// if theIndex is valid
Select3D_Pnt Pnt (const Standard_Integer theIndex) const
{
if (theIndex < 0 || theIndex >= mynbpoints)
Standard_OutOfRange::Raise("Select3D_PointData::Pnt");
return mypolyg3d[theIndex];
}
// Returns 2D point from internal array
// if theIndex is valid
Select3D_Pnt2d Pnt2d (const Standard_Integer theIndex) const
{
if (theIndex < 0 || theIndex >= mynbpoints)
Standard_OutOfRange::Raise("Select3D_PointData::Pnt2d");
return mypolyg2d[theIndex];
}
// Returns size of internal arrays
const Standard_Integer Size () const
{
return mynbpoints;
}
private:
// Default constructor
Select3D_PointData () {};
Select3D_Pnt* mypolyg3d;
Select3D_Pnt2d* mypolyg2d;
Standard_Integer mynbpoints;
};
#endif

@ -10,6 +10,8 @@ class SensitiveCircle from Select3D
inherits SensitivePoly from Select3D
---Purpose: A framework to define sensitive 3D arcs and circles.
-- In some cases this class can raise Standard_ConstructionError and
-- Standard_OutOfRange exceptions. For more details see Select3D_SensitivePoly.
uses
Pnt from gp,
Pnt2d from gp,
@ -29,6 +31,10 @@ uses
SensitiveEntity from Select3D,
Circle from Geom
raises
ConstructionError from Standard,
OutOfRange from Standard
is
Create (OwnerId : EntityOwner from SelectBasics;
TheCircle : Circle from Geom;
@ -114,7 +120,7 @@ is
Project(me: mutable;aProjector: Projector from Select3D) is redefined virtual;
ComputeCenter3D(me: mutable);
ComputeCenter3D(me: mutable) is private;
---Level: Internal
---Purpose: Computes myCenter3D as the barycenter of points from mypolyg3d

@ -19,16 +19,28 @@
static Standard_Integer S3D_GetCircleNBPoints(const Handle(Geom_Circle)& C,
const Standard_Integer anInputNumber)
{
// Check if number of points is invalid.
// In this case mypolyg raises Standard_ConstructionError
// exception (look constructor bellow).
if (anInputNumber <= 0)
return 0;
if (C->Radius()>Precision::Confusion())
return 2*anInputNumber+1;
// The radius is too small and circle degenerates into point
return 1;
}
static Standard_Integer S3D_GetArcNBPoints(const Handle(Geom_Circle)& C,
const Standard_Integer anInputNumber)
{
// There is no need to check number of points here.
// In case of invalid number of points this method returns
// -1 or smaller value.
if (C->Radius()>Precision::Confusion())
return 2*anInputNumber-1;
// The radius is too small and circle degenerates into point
return 1;
}
@ -49,7 +61,7 @@ myCircle(TheCircle),
mystart(0),
myend(0)
{
if(mynbpoints!=1)
if (mypolyg.Size() != 1)
{
gp_Pnt p1,p2;
gp_Vec v1;
@ -58,30 +70,32 @@ myend(0)
Standard_Real R = TheCircle->Radius();
Standard_Integer rank = 1;
Standard_Real curu =ustart;
for(Standard_Integer i=1;i<=NbPoints;i++)
for(Standard_Integer anIndex=1;anIndex<=NbPoints;anIndex++)
{
TheCircle->D1(curu,p1,v1);
v1.Normalize();
((Select3D_Pnt*)mypolyg3d)[rank-1] = p1;
mypolyg.SetPnt(rank-1, p1);
rank++;
p2 = gp_Pnt(p1.X()+v1.X()*tan(du/2.)*R,
p1.Y()+v1.Y()*tan(du/2.)*R,
p1.Z()+v1.Z()*tan(du/2.)*R);
((Select3D_Pnt*)mypolyg3d)[rank-1] = p2;
mypolyg.SetPnt(rank-1, p2);
rank++;
curu+=du;
}
((Select3D_Pnt*)mypolyg3d)[NbPoints*2] = ((Select3D_Pnt*)mypolyg3d)[0];
// Copy the first point to the last point of mypolyg
mypolyg.SetPnt(NbPoints*2, mypolyg.Pnt(0));
// Get myCenter3D
myCenter3D = TheCircle->Location();
}
// Radius = 0.0
else
{
((Select3D_Pnt*)mypolyg3d)[0] = TheCircle->Location();
mypolyg.SetPnt(0, TheCircle->Location());
// Get myCenter3D
myCenter3D = ((Select3D_Pnt*)mypolyg3d)[0];
myCenter3D = mypolyg.Pnt(0);
}
}
@ -104,7 +118,7 @@ myCircle(TheCircle),
mystart(u1),
myend(u2)
{
if(mynbpoints > 1)
if (mypolyg.Size() != 1)
{
gp_Pnt p1,p2;
gp_Vec v1;
@ -120,29 +134,29 @@ myend(u2)
Standard_Integer rank = 1;
Standard_Real curu = mystart;
for(Standard_Integer i=1;i<=NbPoints-1;i++)
for(Standard_Integer anIndex=1;anIndex<=NbPoints-1;anIndex++)
{
TheCircle->D1(curu,p1,v1);
v1.Normalize();
((Select3D_Pnt*)mypolyg3d)[rank-1] = p1;
mypolyg.SetPnt(rank-1, p1);
rank++;
p2 = gp_Pnt(p1.X()+v1.X()*tan(du/2.)*R,
p1.Y()+v1.Y()*tan(du/2.)*R,
p1.Z()+v1.Z()*tan(du/2.)*R);
((Select3D_Pnt*)mypolyg3d)[rank-1] = p2;
mypolyg.SetPnt(rank-1, p2);
rank++;
curu+=du;
}
TheCircle->D0(myend,p1);
((Select3D_Pnt*)mypolyg3d)[NbPoints*2-2] = p1;
mypolyg.SetPnt(NbPoints*2-2, p1);
// Get myCenter3D
myCenter3D = TheCircle->Location();
}
else
{
((Select3D_Pnt*)mypolyg3d)[0] = TheCircle->Location();
mypolyg.SetPnt(0, TheCircle->Location());
// Get myCenter3D
myCenter3D = ((Select3D_Pnt*)mypolyg3d)[0];
myCenter3D = mypolyg.Pnt(0);
}
}
@ -160,10 +174,10 @@ myDetectedIndex(-1),
mystart(0),
myend(0)
{
if (mynbpoints > 1)
if (mypolyg.Size() != 1)
ComputeCenter3D();
else
myCenter3D = ((Select3D_Pnt*)mypolyg3d)[0];
myCenter3D = mypolyg.Pnt(0);
}
//=======================================================================
@ -180,10 +194,10 @@ myDetectedIndex(-1),
mystart(0),
myend(0)
{
if (mynbpoints > 1)
if (mypolyg.Size() != 1)
ComputeCenter3D();
else
myCenter3D = ((Select3D_Pnt*)mypolyg3d)[0];
myCenter3D = mypolyg.Pnt(0);
}
//=======================================================================
@ -197,23 +211,24 @@ Matches(const Standard_Real X,
const Standard_Real aTol,
Standard_Real& DMin)
{
if(mynbpoints>1)
Standard_Integer aSize = mypolyg.Size();
if (aSize != 1)
{
Standard_Boolean Found = Standard_False;
Standard_Integer i = 0;
Standard_Integer anIndex = 0;
if(!myFillStatus)
{
while(i < mynbpoints-2 && !Found)
while(anIndex < aSize-2 && !Found)
{
Standard_Integer TheStat =
Select3D_SensitiveTriangle::Status(((Select3D_Pnt2d*)mypolyg2d)[i],
((Select3D_Pnt2d*)mypolyg2d)[i+1],
((Select3D_Pnt2d*)mypolyg2d)[i+2],
Select3D_SensitiveTriangle::Status(mypolyg.Pnt2d(anIndex),
mypolyg.Pnt2d(anIndex+1),
mypolyg.Pnt2d(anIndex+2),
gp_XY(X,Y),aTol,DMin);
Found = (TheStat != 2);
if(Found) myDetectedIndex = i;
i += 2;
if(Found) myDetectedIndex = anIndex;
anIndex += 2;
}
}
else
@ -223,7 +238,7 @@ Matches(const Standard_Real X,
// Get coordinates of the bounding box
Bnd_Box2d(mybox2d).Get(Xmin,Ymin,Xmax,Ymax);
TColgp_Array1OfPnt2d anArrayOf2dPnt(1, mynbpoints);
TColgp_Array1OfPnt2d anArrayOf2dPnt(1, aSize);
// Fill anArrayOf2dPnt with points from mypolig2d
Points2D(anArrayOf2dPnt);
@ -248,10 +263,14 @@ Matches(const Standard_Real X,
myDetectedIndex=-1;
else
Select3D_SensitiveEntity::Matches(X,Y,aTol,DMin);
return Found;
}
return Standard_True;
// Circle degenerates into point
DMin = gp_Pnt2d(X, Y).Distance(mypolyg.Pnt2d(0));
if (DMin <= aTol*SensitivityFactor())
return Select3D_SensitiveEntity::Matches(X,Y,aTol,DMin);
return Standard_False;
}
//=======================================================================
@ -270,9 +289,12 @@ Matches(const Standard_Real XMin,
Bnd_Box2d abox;
abox.Update(Min(XMin,XMax),Min(YMin,YMax),Max(XMin,XMax),Max(YMin,YMax));
abox.Enlarge(aTol);
for(Standard_Integer i=0;i<mynbpoints;i++)
if(abox.IsOut(((Select3D_Pnt2d*)mypolyg2d)[i])) return Standard_False;
for(Standard_Integer anIndex=0;anIndex<mypolyg.Size();anIndex++)
{
if(abox.IsOut(mypolyg.Pnt2d(anIndex)))
return Standard_False;
}
return Standard_True;
}
@ -286,17 +308,19 @@ Matches (const TColgp_Array1OfPnt2d& aPoly,
const Bnd_Box2d& aBox,
const Standard_Real aTol)
{
myDetectedIndex = -1;
Standard_Real Umin,Vmin,Umax,Vmax;
aBox.Get(Umin,Vmin,Umax,Vmax);
Standard_Real Tolu,Tolv;
Tolu = 1e-7;
Tolv = 1e-7;
Tolu = Precision::Confusion();
Tolv = Precision::Confusion();
CSLib_Class2d aClassifier2d(aPoly,aTol,aTol,Umin,Vmin,Umax,Vmax);
for(Standard_Integer j=1;j<=mynbpoints;j++)
for(Standard_Integer anIndex=0;anIndex<mypolyg.Size();++anIndex)
{
Standard_Integer RES = aClassifier2d.SiDans(((Select3D_Pnt2d*)mypolyg2d)[j-1]);
if(RES!=1) return Standard_False;
Standard_Integer RES = aClassifier2d.SiDans(mypolyg.Pnt2d(anIndex));
if(RES!=1)
return Standard_False;
}
return Standard_True;
}
@ -311,7 +335,7 @@ ArrayBounds(Standard_Integer & Low,
Standard_Integer & Up) const
{
Low = 0;
Up = mynbpoints-1;
Up = mypolyg.Size()-1;
}
//=======================================================================
@ -322,9 +346,9 @@ ArrayBounds(Standard_Integer & Low,
gp_Pnt Select3D_SensitiveCircle::
GetPoint3d(const Standard_Integer Rank) const
{
if(Rank>=0&& Rank<mynbpoints)
return ((Select3D_Pnt*)mypolyg3d)[Rank];
return ((Select3D_Pnt*)mypolyg3d)[0];
if(Rank>=0 && Rank<mypolyg.Size())
return mypolyg.Pnt(Rank);
return gp_Pnt();
}
@ -335,12 +359,11 @@ GetPoint3d(const Standard_Integer Rank) const
void Select3D_SensitiveCircle::Dump(Standard_OStream& S,const Standard_Boolean FullDump) const
{
// Standard_Integer rank(1);
gp_XYZ CDG(0.,0.,0.);
Standard_Integer aSize = mypolyg.Size();
S<<"\tSensitiveCircle 3D :";
Standard_Boolean isclosed = 1== mynbpoints;
Standard_Boolean isclosed = 1== aSize;
if(isclosed)
S<<"(Closed Circle)"<<endl;
else
@ -352,20 +375,11 @@ void Select3D_SensitiveCircle::Dump(Standard_OStream& S,const Standard_Boolean F
if(FullDump)
{
Standard_Integer EndIndex = isclosed? mynbpoints-2 : mynbpoints-1, nbpt(0);
for(Standard_Integer i=0;i<EndIndex;i+=2)
{
CDG +=((Select3D_Pnt*)mypolyg3d)[i];
nbpt++;
}
gp_XYZ aCenter = myCenter3D;
Standard_Real R = (aCenter-mypolyg.Pnt(0)).Modulus();
CDG/=nbpt;
Standard_Real R = (CDG-((Select3D_Pnt*)mypolyg3d)[0]).Modulus();
S<<"\t\t Center : ("<<CDG.X()<<" , "<<CDG.Y()<<" , "<<CDG.Z()<<" )"<<endl;
S<<"\t\t Center : ("<<aCenter.X()<<" , "<<aCenter.Y()<<" , "<<aCenter.Z()<<" )"<<endl;
S<<"\t\t Radius :"<<R<<endl;
}
}
@ -376,28 +390,19 @@ void Select3D_SensitiveCircle::Dump(Standard_OStream& S,const Standard_Boolean F
Standard_Real Select3D_SensitiveCircle::ComputeDepth(const gp_Lin& EyeLine) const
{
gp_Pnt CDG;
gp_XYZ aCDG;
if(myDetectedIndex==-1)
{
gp_XYZ CurCoord(((Select3D_Pnt*)mypolyg3d)[0]);
Standard_Boolean isclosed = 1==mynbpoints;
Standard_Integer EndIndex = isclosed ? mynbpoints-2 : mynbpoints-1, nbpt(0);
for(Standard_Integer i=1;i<EndIndex;i+=2)
{
CurCoord +=((Select3D_Pnt*)mypolyg3d)[i];
nbpt++;
}
CDG.SetXYZ(CurCoord);
aCDG = myCenter3D;
}
else
{
gp_XYZ CurCoord(((Select3D_Pnt*)mypolyg3d)[myDetectedIndex]);
CurCoord+=((Select3D_Pnt*)mypolyg3d)[myDetectedIndex+1];
CurCoord+=((Select3D_Pnt*)mypolyg3d)[myDetectedIndex+2];
CDG.SetXYZ(CurCoord);
aCDG += mypolyg.Pnt(myDetectedIndex);
aCDG += mypolyg.Pnt(myDetectedIndex+1);
aCDG += mypolyg.Pnt(myDetectedIndex+2);
aCDG /= 3.;
}
return ElCLib::Parameter(EyeLine,CDG);
return ElCLib::Parameter(EyeLine,gp_Pnt(aCDG));
}
//=======================================================================
@ -426,10 +431,11 @@ Handle(Select3D_SensitiveEntity) Select3D_SensitiveCircle::GetConnected(const To
// this was constructed using TColgp_Array1OfPnt
else
{
TColgp_Array1OfPnt aPolyg(1, mynbpoints);
for(Standard_Integer i = 1; i <= mynbpoints; ++i)
Standard_Integer aSize = mypolyg.Size();
TColgp_Array1OfPnt aPolyg(1, aSize);
for(Standard_Integer anIndex = 1; anIndex <= aSize; ++anIndex)
{
aPolyg.SetValue(i, ((Select3D_Pnt*)mypolyg3d)[i-1]);
aPolyg.SetValue(anIndex, mypolyg.Pnt(anIndex-1));
}
aNewEntity = new Select3D_SensitiveCircle(myOwnerId, aPolyg, myFillStatus);
}
@ -450,7 +456,6 @@ Handle(Select3D_SensitiveEntity) Select3D_SensitiveCircle::GetConnected(const To
void Select3D_SensitiveCircle::Project(const Handle_Select3D_Projector &aProjector)
{
Select3D_SensitivePoly::Project(aProjector);
// Project the center of the circle
gp_Pnt2d aCenter;
aProjector->Project(myCenter3D, aCenter);
myCenter2D = aCenter;
@ -463,28 +468,21 @@ void Select3D_SensitiveCircle::Project(const Handle_Select3D_Projector &aProject
void Select3D_SensitiveCircle::ComputeCenter3D()
{
gp_XYZ aCenter(0., 0., 0.);
if(mynbpoints > 1)
gp_XYZ aCenter;
Standard_Integer nbpoints = mypolyg.Size();
if (nbpoints != 1)
{
// The mass of points system
Standard_Integer aMass = mynbpoints - 1;
Standard_Integer aMass = nbpoints - 1;
// Find the circle barycenter
for(Standard_Integer i = 0; i < mynbpoints-1; ++i)
for (Standard_Integer anIndex = 0; anIndex < nbpoints-1; ++anIndex)
{
aCenter += ((Select3D_Pnt*)mypolyg3d)[i];
aCenter += mypolyg.Pnt(anIndex);
}
myCenter3D = aCenter / aMass;
}
else if (mynbpoints == 1)
{
myCenter3D = ((Select3D_Pnt*)mypolyg3d)[0];
}
// bad case! there are no points in mypolyg3d
// It can lead to incorrect computation of
// parameter DMin in method Matches.
// In spite of this myCenter3D isn't left uninitialized
else
{
myCenter3D = aCenter;
myCenter3D = mypolyg.Pnt(0);
}
}

@ -11,6 +11,8 @@ class SensitiveCurve from Select3D
inherits SensitivePoly from Select3D
---Purpose: A framework to define a sensitive 3D curve.
-- In some cases this class can raise Standard_ConstructionError and
-- Standard_OutOfRange exceptions. For more details see Select3D_SensitivePoly.
uses
Pnt from gp,
@ -26,6 +28,10 @@ uses
Box2d from Bnd,
Location from TopLoc,
SensitiveEntity from Select3D
raises
ConstructionError from Standard,
OutOfRange from Standard
is

@ -68,7 +68,7 @@ Standard_Boolean Select3D_SensitiveCurve
Standard_Real& DMin)
{
Standard_Integer Rank;
TColgp_Array1OfPnt2d aArrayOf2dPnt(1, mynbpoints);
TColgp_Array1OfPnt2d aArrayOf2dPnt(1, mypolyg.Size());
Points2D(aArrayOf2dPnt);
if (SelectBasics_BasicTool::MatchPolyg2d (aArrayOf2dPnt,
X, Y,
@ -99,9 +99,10 @@ Matches (const Standard_Real XMin,
Bnd_Box2d BoundBox;
BoundBox.Update(XMin-aTol,YMin-aTol,XMax+aTol,YMax+aTol);
for(Standard_Integer j=0; j<mynbpoints; j++)
for(Standard_Integer anIndex=0; anIndex<mypolyg.Size(); ++anIndex)
{
if(BoundBox.IsOut(((Select3D_Pnt2d*)mypolyg2d)[j])) return Standard_False;
if(BoundBox.IsOut(mypolyg.Pnt2d(anIndex)))
return Standard_False;
}
return Standard_True;
}
@ -123,10 +124,11 @@ Matches (const TColgp_Array1OfPnt2d& aPoly,
Tolv = 1e-7;
CSLib_Class2d aClassifier2d(aPoly,aTol,aTol,Umin,Vmin,Umax,Vmax);
for(Standard_Integer j=0;j<mynbpoints;j++)
for(Standard_Integer anIndex=0;anIndex<mypolyg.Size();++anIndex)
{
Standard_Integer RES = aClassifier2d.SiDans(((Select3D_Pnt2d*)mypolyg2d)[j]);
if(RES!=1) return Standard_False;
Standard_Integer RES = aClassifier2d.SiDans(mypolyg.Pnt2d(anIndex));
if(RES!=1)
return Standard_False;
}
return Standard_True;
}
@ -144,9 +146,9 @@ void Select3D_SensitiveCurve
Standard_Real Step = (aCurve->LastParameter()- aCurve->FirstParameter())/(NbP-1);
Standard_Real Curparam = aCurve->FirstParameter();
for(Standard_Integer i=0;i<mynbpoints;i++)
for(Standard_Integer anIndex=0;anIndex<mypolyg.Size();++anIndex)
{
((Select3D_Pnt*)mypolyg3d)[i] = aCurve->Value(Curparam);
mypolyg.SetPnt(anIndex, aCurve->Value(Curparam));
Curparam+=Step;
}
}
@ -162,11 +164,10 @@ void Select3D_SensitiveCurve::Dump(Standard_OStream& S,const Standard_Boolean Fu
if (HasLocation())
S<<"\t\tExisting Location"<<endl;
S<<"\t\tNumber Of Points :"<<mynbpoints<<endl;
S<<"\t\tNumber Of Points :"<<mypolyg.Size()<<endl;
if(FullDump)
{
// S<<"\t\t\tOwner:"<<myOwnerId<<endl;
Select3D_SensitiveEntity::DumpBox(S,mybox2d);
}
}
@ -178,11 +179,27 @@ void Select3D_SensitiveCurve::Dump(Standard_OStream& S,const Standard_Boolean Fu
Standard_Real Select3D_SensitiveCurve::ComputeDepth(const gp_Lin& EyeLine) const
{
if(mylastseg==0) return Precision::Infinite(); // non implemente actuellement...
gp_XYZ TheCDG(((Select3D_Pnt*)mypolyg3d)[mylastseg]);
TheCDG+=((Select3D_Pnt*)mypolyg3d)[mylastseg+1];
TheCDG/=2.;
return ElCLib::Parameter(EyeLine,gp_Pnt(TheCDG));
Standard_Real aDepth = Precision::Infinite();
// Not implemented
if(mylastseg==0)
return aDepth;
gp_XYZ aCDG;
// In case if mylastseg and mylastseg+1 are not valid
// the depth will be infinite
if (mylastseg < mypolyg.Size())
{
aCDG = mypolyg.Pnt(mylastseg);
if (mylastseg+1 < mypolyg.Size())
{
aCDG += mypolyg.Pnt(mylastseg+1);
aCDG /= 2.;
}
aDepth = ElCLib::Parameter(EyeLine,gp_Pnt(aCDG));
}
return aDepth;
}
//=======================================================================
@ -202,11 +219,12 @@ Handle(Select3D_SensitiveEntity) Select3D_SensitiveCurve::GetConnected(const Top
// this was constructed using TColgp_HArray1OfPnt
else
{
Handle(TColgp_HArray1OfPnt) aPoints = new TColgp_HArray1OfPnt(1, mynbpoints);
Standard_Integer aSize = mypolyg.Size();
Handle(TColgp_HArray1OfPnt) aPoints = new TColgp_HArray1OfPnt(1, aSize);
// Fill the array with points from mypolyg3d
for (Standard_Integer i = 1; i <= mynbpoints; ++i)
for (Standard_Integer anIndex = 1; anIndex <= aSize; ++anIndex)
{
aPoints->SetValue(i, ((Select3D_Pnt*)mypolyg3d)[i-1]);
aPoints->SetValue(anIndex, mypolyg.Pnt(anIndex-1));
}
aNewEntity = new Select3D_SensitiveCurve(myOwnerId, aPoints);
}

@ -9,6 +9,8 @@ class SensitiveFace from Select3D
inherits SensitivePoly from Select3D
---Purpose: Sensitive Entity to make a face selectable.
-- In some cases this class can raise Standard_ConstructionError and
-- Standard_OutOfRange exceptions. For more details see Select3D_SensitivePoly.
uses
EntityOwner from SelectBasics,
@ -23,6 +25,10 @@ uses
Location from TopLoc,
SensitiveEntity from Select3D
raises
ConstructionError from Standard,
OutOfRange from Standard
is
Create (OwnerId : EntityOwner from SelectBasics;

@ -88,28 +88,27 @@ Matches(const Standard_Real X,
// then min. distance of the polyhedron or cdg...
Standard_Real aTol2 = aTol*aTol;
gp_XY CDG(0.,0.);
// for(Standard_Integer I=1;I<=Nbp-1;I++){
Standard_Integer I;
for(I=1;I<mynbpoints-1;I++)
Standard_Integer aSize = mypolyg.Size(), anIndex;
gp_XY CDG;
for(anIndex=0;anIndex<aSize;++anIndex)
{
CDG+=((Select3D_Pnt2d*)mypolyg2d)[I-1];
CDG+=mypolyg.Pnt2d(anIndex);
}
if(mynbpoints>1)
if(aSize>1)
{
CDG/= (mynbpoints-1);
CDG/=(aSize-1);
}
DMin2=Min(DMin2,gp_XY(CDG.X()-X,CDG.Y()-Y).SquareModulus());
DMin = Sqrt(DMin2);
Standard_Boolean isplane2d(Standard_True);
for( I=1;I<mynbpoints-1;I++)
for(anIndex=1;anIndex<aSize;++anIndex)
{
gp_XY V1(((Select3D_Pnt2d*)mypolyg2d)[I]),V(X,Y);
V1-=((Select3D_Pnt2d*)mypolyg2d)[I-1];
V-=((Select3D_Pnt2d*)mypolyg2d)[I-1];
gp_XY V1(mypolyg.Pnt2d(anIndex)),V(X,Y);
V1-=mypolyg.Pnt2d(anIndex-1);
V-=mypolyg.Pnt2d(anIndex-1);
Standard_Real Vector = V1^V;
Standard_Real V1V1 = V1.SquareModulus();
DMin2 =
@ -117,7 +116,8 @@ Matches(const Standard_Real X,
Min(DMin2,V.SquareModulus()): // if the segment is too small...
Min(DMin2,Vector*Vector/V1V1);
//cdg ...
gp_XY PlaneTest(CDG);PlaneTest-=((Select3D_Pnt2d*)mypolyg2d)[I-1];
gp_XY PlaneTest(CDG);
PlaneTest-=mypolyg.Pnt2d(anIndex-1);
Standard_Real valtst = PlaneTest^V1;
if(isplane2d && Abs(valtst)>aTol) isplane2d=Standard_False;
}
@ -127,7 +127,7 @@ Matches(const Standard_Real X,
}
//otherwise it is checked if the point is in the face...
TColgp_Array1OfPnt2d aArrayOf2dPnt(1, mynbpoints);
TColgp_Array1OfPnt2d aArrayOf2dPnt(1, aSize);
Points2D(aArrayOf2dPnt);
CSLib_Class2d TheInOutTool(aArrayOf2dPnt,aTol,aTol,Xmin,Ymin,Xmax,Ymax);
Standard_Integer TheStat = TheInOutTool.SiDans(gp_Pnt2d(X,Y));
@ -165,9 +165,10 @@ Matches (const Standard_Real XMin,
Bnd_Box2d BoundBox;
BoundBox.Update(XMin-aTol,YMin-aTol,XMax+aTol,YMax+aTol);
for(Standard_Integer j=1;j<=mynbpoints-1;j++)
for(Standard_Integer anIndex=0;anIndex<mypolyg.Size();++anIndex)
{
if(BoundBox.IsOut(((Select3D_Pnt2d*)mypolyg2d)[j-1])) return Standard_False;
if(BoundBox.IsOut(mypolyg.Pnt2d(anIndex)))
return Standard_False;
}
return Standard_True;
}
@ -189,10 +190,12 @@ Matches (const TColgp_Array1OfPnt2d& aPoly,
Tolv = 1e-7;
CSLib_Class2d aClassifier2d(aPoly,aTol,aTol,Umin,Vmin,Umax,Vmax);
for(Standard_Integer j=1;j<=mynbpoints;j++)
gp_Pnt2d aPnt2d;
for(Standard_Integer anIndex=0;anIndex<mypolyg.Size();++anIndex)
{
Standard_Integer RES = aClassifier2d.SiDans(((Select3D_Pnt2d*)mypolyg2d)[j-1]);
if(RES!=1) return Standard_False;
Standard_Integer RES = aClassifier2d.SiDans(mypolyg.Pnt2d(anIndex));
if(RES!=1)
return Standard_False;
}
return Standard_True;
}
@ -213,9 +216,7 @@ void Select3D_SensitiveFace::Dump(Standard_OStream& S,const Standard_Boolean Ful
if(FullDump)
{
S<<"\t\tNumber Of Points :"<<mynbpoints<<endl;
// S<<"\t\t\tOwner:"<<myOwnerId<<endl;
S<<"\t\tNumber Of Points :"<<mypolyg.Size()<<endl;
Select3D_SensitiveEntity::DumpBox(S,mybox2d);
}
}
@ -228,12 +229,14 @@ void Select3D_SensitiveFace::Dump(Standard_OStream& S,const Standard_Boolean Ful
Standard_Real Select3D_SensitiveFace::ComputeDepth(const gp_Lin& EyeLine) const
{
Standard_Real aDepth = Precision::Infinite();
Standard_Real aDepthMin = !mylastprj.IsNull() ? mylastprj->DepthMin() : -Precision::Infinite();
Standard_Real aDepthMax = !mylastprj.IsNull() ? mylastprj->DepthMax() : Precision::Infinite();
Standard_Real aDepthTest;
for (Standard_Integer i = 0; i < mynbpoints - 1; i++)
for (Standard_Integer anIndex = 0; anIndex < mypolyg.Size()-1; ++anIndex)
{
aDepthTest = ElCLib::Parameter (EyeLine, ((Select3D_Pnt* )mypolyg3d)[i]);
aDepthTest = ElCLib::Parameter (EyeLine, mypolyg.Pnt(anIndex));
if (aDepthTest < aDepth && (aDepthTest > aDepthMin) && (aDepthTest < aDepthMax))
{
aDepth = aDepthTest;
@ -250,10 +253,11 @@ Standard_Real Select3D_SensitiveFace::ComputeDepth(const gp_Lin& EyeLine) const
Handle(Select3D_SensitiveEntity) Select3D_SensitiveFace::GetConnected(const TopLoc_Location &theLocation)
{
// Create a copy of this
TColgp_Array1OfPnt aPoints(1, mynbpoints);
for (Standard_Integer i = 1; i <= mynbpoints; ++i)
Standard_Integer aSize = mypolyg.Size();
TColgp_Array1OfPnt aPoints(1, aSize);
for (Standard_Integer anIndex = 1; anIndex <= aSize; ++anIndex)
{
aPoints.SetValue(i, ((Select3D_Pnt*)mypolyg3d)[i-1]);
aPoints.SetValue(anIndex, mypolyg.Pnt(anIndex-1));
}
Handle(Select3D_SensitiveEntity) aNewEntity =

@ -2,6 +2,9 @@ deferred class SensitivePoly from Select3D
inherits SensitiveEntity from Select3D
---Purpose: Sensitive Entity to make a face selectable.
-- In some cases this class can raise Standard_ConstructionError and
-- Standard_OutOfRange exceptions from its member Select3D_PointData
-- mypolyg.
uses
EntityOwner from SelectBasics,
@ -10,7 +13,12 @@ uses
Array1OfPnt from TColgp,
HArray1OfPnt from TColgp,
Array1OfPnt2d from TColgp,
Box2d from Select3D
Box2d from Select3D,
PointData from Select3D
raises
ConstructionError from Standard,
OutOfRange from Standard
is
@ -58,15 +66,8 @@ is
---Purpose: Returns the 2D points of the array used at construction time.
---C++: inline
Destroy(me: mutable);
---C++: alias ~
fields
mypolyg3d : Address from Standard is protected;
mypolyg2d : Address from Standard is protected;
mybox2d : Box2d from Select3D is protected;
mynbpoints : Integer from Standard is protected;
mypolyg : PointData from Select3D is protected;
end SensitivePoly;

@ -15,13 +15,11 @@
Select3D_SensitivePoly::
Select3D_SensitivePoly(const Handle(SelectBasics_EntityOwner)& OwnerId,
const TColgp_Array1OfPnt& ThePoints):
Select3D_SensitiveEntity(OwnerId)
Select3D_SensitiveEntity(OwnerId),
mypolyg(ThePoints.Upper()-ThePoints.Lower()+1)
{
mynbpoints = ThePoints.Upper()-ThePoints.Lower()+1;
mypolyg3d = new Select3D_Pnt[mynbpoints];
mypolyg2d = new Select3D_Pnt2d[mynbpoints];
for(Standard_Integer i=0;i<mynbpoints;i++)
((Select3D_Pnt*)mypolyg3d)[i] = ThePoints.Value(ThePoints.Lower()+i);
for (Standard_Integer theIndex = 0 ; theIndex < mypolyg.Size(); ++theIndex)
mypolyg.SetPnt(theIndex, ThePoints.Value(ThePoints.Lower()+theIndex));
}
//==================================================
@ -32,13 +30,11 @@ Select3D_SensitiveEntity(OwnerId)
Select3D_SensitivePoly::
Select3D_SensitivePoly(const Handle(SelectBasics_EntityOwner)& OwnerId,
const Handle(TColgp_HArray1OfPnt)& ThePoints):
Select3D_SensitiveEntity(OwnerId)
Select3D_SensitiveEntity(OwnerId),
mypolyg(ThePoints->Upper()-ThePoints->Lower()+1)
{
mynbpoints = ThePoints->Upper()-ThePoints->Lower()+1;
mypolyg3d = new Select3D_Pnt[mynbpoints];
mypolyg2d = new Select3D_Pnt2d[mynbpoints];
for(Standard_Integer i=0;i<mynbpoints;i++)
((Select3D_Pnt*)mypolyg3d)[i] = ThePoints->Value(ThePoints->Lower()+i);
for (Standard_Integer theIndex = 0; theIndex < mypolyg.Size(); theIndex++)
mypolyg.SetPnt(theIndex, ThePoints->Value(ThePoints->Lower()+theIndex));
}
//==================================================
@ -49,11 +45,9 @@ Select3D_SensitiveEntity(OwnerId)
Select3D_SensitivePoly::
Select3D_SensitivePoly(const Handle(SelectBasics_EntityOwner)& OwnerId,
const Standard_Integer NbPoints):
Select3D_SensitiveEntity(OwnerId)
Select3D_SensitiveEntity(OwnerId),
mypolyg(NbPoints)
{
mynbpoints = NbPoints;
mypolyg3d = new Select3D_Pnt[mynbpoints];
mypolyg2d = new Select3D_Pnt2d[mynbpoints];
}
//==================================================
@ -68,9 +62,10 @@ void Select3D_SensitivePoly::Project(const Handle(Select3D_Projector)& aProj)
Standard_Boolean hasloc = HasLocation();
gp_Pnt2d aPnt2d;
for(Standard_Integer i=0;i<mynbpoints;i++)
gp_Pnt aPnt;
for (Standard_Integer theIndex = 0; theIndex < mypolyg.Size(); ++theIndex)
{
gp_Pnt aPnt(((Select3D_Pnt*)mypolyg3d)[i].x, ((Select3D_Pnt*)mypolyg3d)[i].y, ((Select3D_Pnt*)mypolyg3d)[i].z);
aPnt = mypolyg.Pnt(theIndex);
if (hasloc)
{
aProj->Project(aPnt.Transformed(Location().Transformation()), aPnt2d);
@ -80,7 +75,7 @@ void Select3D_SensitivePoly::Project(const Handle(Select3D_Projector)& aProj)
aProj->Project(aPnt, aPnt2d);
}
mybox2d.Update(aPnt2d);
((Select3D_Pnt2d*)mypolyg2d)[i] = aPnt2d;
mypolyg.SetPnt2d(theIndex, aPnt2d);
}
}
@ -94,13 +89,3 @@ void Select3D_SensitivePoly
aSeq.Append(mybox2d);
}
//==================================================
// Function: Destroy
// Purpose :
//==================================================
void Select3D_SensitivePoly::Destroy()
{
delete[] (Select3D_Pnt*)mypolyg3d;
delete[] (Select3D_Pnt2d*)mypolyg2d;
}

@ -6,21 +6,20 @@
inline void Select3D_SensitivePoly
::Points3D( Handle(TColgp_HArray1OfPnt)& theHArrayOfPnt )
{
theHArrayOfPnt = new TColgp_HArray1OfPnt(1,mynbpoints);
for(Standard_Integer i = 1; i <= mynbpoints; i++)
Standard_Integer aSize = mypolyg.Size();
theHArrayOfPnt = new TColgp_HArray1OfPnt(1,aSize);
for(Standard_Integer anIndex = 1; anIndex <= aSize; anIndex++)
{
gp_Pnt aPnt(((Select3D_Pnt*)mypolyg3d)[i-1].x, ((Select3D_Pnt*)mypolyg3d)[i-1].y, ((Select3D_Pnt*)mypolyg3d)[i-1].z);
theHArrayOfPnt->SetValue(i, aPnt);
theHArrayOfPnt->SetValue(anIndex, mypolyg.Pnt(anIndex-1));
}
}
inline void Select3D_SensitivePoly
::Points2D( TColgp_Array1OfPnt2d& aArrayOf2dPnt)
{
for(Standard_Integer i = 1; i <= mynbpoints; i++)
for(Standard_Integer anIndex = 1; anIndex <= mypolyg.Size(); anIndex++)
{
gp_Pnt2d aPnt2d(((Select3D_Pnt2d*)mypolyg2d)[i-1].x, ((Select3D_Pnt2d*)mypolyg2d)[i-1].y);
aArrayOf2dPnt.SetValue(i,aPnt2d);
aArrayOf2dPnt.SetValue(anIndex, mypolyg.Pnt2d(anIndex-1));
}
}

@ -10,6 +10,8 @@ inherits SensitivePoly from Select3D
---Purpose: A framework to define selection of triangles in a view.
-- This comes into play in the detection of meshing and triangulation in surfaces.
-- In some cases this class can raise Standard_ConstructionError and
-- Standard_OutOfRange exceptions. For more details see Select3D_SensitivePoly.
uses
EntityOwner from SelectBasics,
@ -24,6 +26,10 @@ uses
Location from TopLoc,
SensitiveEntity from Select3D
raises
ConstructionError from Standard,
OutOfRange from Standard
is
Create (OwnerId : EntityOwner from SelectBasics;
P1,P2,P3 : Pnt from gp;

@ -18,9 +18,6 @@
#include <CSLib_Class2d.hxx>
#define COORD(a,b) ((Select3D_Pnt*)mypolyg3d)[(a)].b
#define COORD2d(a,b) ((Select3D_Pnt2d*)mypolyg2d)[(a)].b
static Standard_Boolean S3D_Str_NearSegment (const gp_XY& p0, const gp_XY& p1, const gp_XY& TheP,
const Standard_Real aTol, Standard_Real& aDMin)
{
@ -56,9 +53,9 @@ Select3D_SensitiveTriangle(const Handle(SelectBasics_EntityOwner)& OwnerId,
Select3D_SensitivePoly(OwnerId,3),
mytype (aType)
{
((Select3D_Pnt*)mypolyg3d)[0] = P0;
((Select3D_Pnt*)mypolyg3d)[1] = P1;
((Select3D_Pnt*)mypolyg3d)[2] = P2;
mypolyg.SetPnt(0, P0);
mypolyg.SetPnt(1, P1);
mypolyg.SetPnt(2, P2);
}
//==================================================
@ -110,9 +107,9 @@ Matches (const Standard_Real XMin,
Min(YMin,YMax)-aTol,
Max(XMin,XMax)+aTol,
Max(YMin,YMax)+aTol);
for(Standard_Integer i=0;i<=2;i++)
for(Standard_Integer anIndex=0;anIndex<=2;++anIndex)
{
if(B.IsOut(((Select3D_Pnt2d*)mypolyg2d)[i]))
if(B.IsOut(mypolyg.Pnt2d(anIndex)))
return Standard_False;
}
return Standard_True;
@ -135,10 +132,11 @@ Matches (const TColgp_Array1OfPnt2d& aPoly,
Tolv = 1e-7;
CSLib_Class2d aClassifier2d(aPoly,aTol,aTol,Umin,Vmin,Umax,Vmax);
for(Standard_Integer i=0;i<=2;i++)
for(Standard_Integer anIndex=0;anIndex<=2;++anIndex)
{
Standard_Integer RES = aClassifier2d.SiDans(((Select3D_Pnt2d*)mypolyg2d)[i]);
if(RES!=1) return Standard_False;
Standard_Integer RES = aClassifier2d.SiDans(mypolyg.Pnt2d(anIndex));
if(RES!=1)
return Standard_False;
}
return Standard_True;
}
@ -150,9 +148,9 @@ Matches (const TColgp_Array1OfPnt2d& aPoly,
void Select3D_SensitiveTriangle::Points3D(gp_Pnt& P0,gp_Pnt& P1,gp_Pnt& P2) const
{
P0 = ((Select3D_Pnt*)mypolyg3d)[0];
P1 = ((Select3D_Pnt*)mypolyg3d)[1];
P2 = ((Select3D_Pnt*)mypolyg3d)[2];
P0 = mypolyg.Pnt(0);
P1 = mypolyg.Pnt(1);
P2 = mypolyg.Pnt(2);
}
//==================================================
@ -162,11 +160,11 @@ Matches (const TColgp_Array1OfPnt2d& aPoly,
gp_Pnt Select3D_SensitiveTriangle::Center3D() const
{
gp_XYZ CDG(((Select3D_Pnt*)mypolyg3d)[0]);
CDG += ((Select3D_Pnt*)mypolyg3d)[1];
CDG += ((Select3D_Pnt*)mypolyg3d)[2];
CDG /=3.;
return gp_Pnt(CDG);;
gp_XYZ aPnt1, aPnt2, aPnt3;
aPnt1 = mypolyg.Pnt(0);
aPnt2 = mypolyg.Pnt(1);
aPnt3 = mypolyg.Pnt(2);
return gp_Pnt((aPnt1+aPnt2+aPnt3)/3.);
}
//==================================================
@ -176,8 +174,11 @@ gp_Pnt Select3D_SensitiveTriangle::Center3D() const
gp_XY Select3D_SensitiveTriangle::Center2D() const
{
return (gp_XY(((Select3D_Pnt2d*)mypolyg2d)[0])+gp_XY(((Select3D_Pnt2d*)mypolyg2d)[1])
+gp_XY(((Select3D_Pnt2d*)mypolyg2d)[2]))/3.;
gp_XY aPnt1, aPnt2, aPnt3;
aPnt1 = mypolyg.Pnt2d(0);
aPnt2 = mypolyg.Pnt2d(1);
aPnt3 = mypolyg.Pnt2d(2);
return (aPnt1+aPnt2+aPnt3)/3.;
}
//=======================================================================
@ -190,8 +191,8 @@ Standard_Integer Select3D_SensitiveTriangle::Status(const Standard_Real X,
const Standard_Real aTol,
Standard_Real& DMin) const
{
return Status(((Select3D_Pnt2d*)mypolyg2d)[0],((Select3D_Pnt2d*)mypolyg2d)[1],
((Select3D_Pnt2d*)mypolyg2d)[2],gp_XY(X,Y),aTol,DMin);
return Status(mypolyg.Pnt2d(0), mypolyg.Pnt2d(1), mypolyg.Pnt2d(2),
gp_XY(X,Y), aTol, DMin);
}
//=======================================================================
@ -310,18 +311,25 @@ void Select3D_SensitiveTriangle::Dump(Standard_OStream& S,const Standard_Boolean
if(HasLocation())
S<<"\t\tExisting Location"<<endl;
S<<"\t\t P0 [ "<<COORD(0,x)<<" , "<<COORD(0,y) <<" , "<<COORD(0,z)<<" ]"<<endl;
S<<"\t\t P1 [ "<<COORD(1,x)<<" , "<<COORD(1,y) <<" , "<<COORD(1,z)<<" ]"<<endl;
S<<"\t\t P2 [ "<<COORD(2,x)<<" , "<<COORD(2,y) <<" , "<<COORD(2,z)<<" ]"<<endl;
gp_Pnt aPnt1, aPnt2, aPnt3;
aPnt1 = mypolyg.Pnt(0);
aPnt2 = mypolyg.Pnt(1);
aPnt3 = mypolyg.Pnt(2);
S<<"\t\t P0 [ "<<aPnt1.X()<<" , "<<aPnt1.Y()<<" , "<<aPnt1.Z()<<" ]"<<endl;
S<<"\t\t P1 [ "<<aPnt2.X()<<" , "<<aPnt2.Y()<<" , "<<aPnt2.Z()<<" ]"<<endl;
S<<"\t\t P2 [ "<<aPnt3.X()<<" , "<<aPnt3.Y()<<" , "<<aPnt3.Z()<<" ]"<<endl;
if(FullDump)
{
S<<"\t\tProjected Points"<<endl;
S<<"\t\t 0.[ "<<COORD2d(0,x)<<" , "<<COORD2d(0,y)<<" ]"<<endl;
S<<"\t\t 1.[ "<<COORD2d(1,x)<<" , "<<COORD2d(1,y)<<" ]"<<endl;
S<<"\t\t 2.[ "<<COORD2d(2,x)<<" , "<<COORD2d(2,y)<<" ]"<<endl;
// S<<"\t\t\tOwner:"<<myOwnerId<<endl;
gp_Pnt2d aPnt1, aPnt2, aPnt3;
aPnt1 = mypolyg.Pnt2d(0);
aPnt2 = mypolyg.Pnt2d(1);
aPnt3 = mypolyg.Pnt2d(2);
S<<"\t\t 0.[ "<<aPnt1.X()<<" , "<<aPnt1.Y()<<" ]"<<endl;
S<<"\t\t 1.[ "<<aPnt2.X()<<" , "<<aPnt2.Y()<<" ]"<<endl;
S<<"\t\t 2.[ "<<aPnt3.X()<<" , "<<aPnt3.Y()<<" ]"<<endl;
Select3D_SensitiveEntity::DumpBox(S,mybox2d);
}
}
@ -333,9 +341,12 @@ void Select3D_SensitiveTriangle::Dump(Standard_OStream& S,const Standard_Boolean
Standard_Real Select3D_SensitiveTriangle::ComputeDepth(const gp_Lin& EyeLine) const
{
gp_Pnt P1 = ((Select3D_Pnt*)mypolyg3d)[0];
gp_Pnt P2 = ((Select3D_Pnt*)mypolyg3d)[1];
gp_Pnt P3 = ((Select3D_Pnt*)mypolyg3d)[2];
Standard_Real prof(Precision::Infinite());
gp_Pnt P1, P2, P3;
P1 = mypolyg.Pnt(0);
P2 = mypolyg.Pnt(1);
P3 = mypolyg.Pnt(2);
gp_Trsf TheTrsf ;
if(HasLocation())
@ -348,7 +359,6 @@ Standard_Real Select3D_SensitiveTriangle::ComputeDepth(const gp_Lin& EyeLine) co
P3.Transform(TheTrsf);
}
Standard_Real prof(Precision::Infinite());
// formula calculation of the point parameters on intersection
// t = (P1P2 ^P1P3)* OP1 / ((P1P2^P1P3)*Dir)
@ -385,11 +395,7 @@ GetConnected(const TopLoc_Location &theLocation)
{
// Create a copy of this
Handle(Select3D_SensitiveEntity) aNewEntity =
new Select3D_SensitiveTriangle(myOwnerId,
((Select3D_Pnt*)mypolyg3d)[0],
((Select3D_Pnt*)mypolyg3d)[1],
((Select3D_Pnt*)mypolyg3d)[2],
mytype);
new Select3D_SensitiveTriangle(myOwnerId, mypolyg.Pnt(0), mypolyg.Pnt(1), mypolyg.Pnt(2), mytype);
if (HasLocation())
aNewEntity->SetLocation(Location());

File diff suppressed because it is too large Load Diff