1 #include <Select3D_SensitivePoly.ixx>
2 #include <gp_Pnt2d.hxx>
4 #include <Select3D_Pnt.hxx>
5 #include <Select3D_Pnt2d.hxx>
6 #include <Select3D_Box2d.hxx>
7 #include <TopLoc_Location.hxx>
10 //==================================================
11 // Function: faire disparaitre ce constructeur a la prochaine version...
12 // Purpose : simplement garde pour ne pas perturber la version update
13 //==================================================
15 Select3D_SensitivePoly::
16 Select3D_SensitivePoly(const Handle(SelectBasics_EntityOwner)& OwnerId,
17 const TColgp_Array1OfPnt& ThePoints):
18 Select3D_SensitiveEntity(OwnerId),
19 mypolyg(ThePoints.Upper()-ThePoints.Lower()+1)
21 for (Standard_Integer theIndex = 0 ; theIndex < mypolyg.Size(); ++theIndex)
22 mypolyg.SetPnt(theIndex, ThePoints.Value(ThePoints.Lower()+theIndex));
25 //==================================================
28 //==================================================
30 Select3D_SensitivePoly::
31 Select3D_SensitivePoly(const Handle(SelectBasics_EntityOwner)& OwnerId,
32 const Handle(TColgp_HArray1OfPnt)& ThePoints):
33 Select3D_SensitiveEntity(OwnerId),
34 mypolyg(ThePoints->Upper()-ThePoints->Lower()+1)
36 for (Standard_Integer theIndex = 0; theIndex < mypolyg.Size(); theIndex++)
37 mypolyg.SetPnt(theIndex, ThePoints->Value(ThePoints->Lower()+theIndex));
40 //==================================================
43 //==================================================
45 Select3D_SensitivePoly::
46 Select3D_SensitivePoly(const Handle(SelectBasics_EntityOwner)& OwnerId,
47 const Standard_Integer NbPoints):
48 Select3D_SensitiveEntity(OwnerId),
53 //==================================================
56 //==================================================
58 void Select3D_SensitivePoly::Project(const Handle(Select3D_Projector)& aProj)
60 Select3D_SensitiveEntity:: Project (aProj); // to set the field last proj...
63 Standard_Boolean hasloc = HasLocation();
66 for (Standard_Integer theIndex = 0; theIndex < mypolyg.Size(); ++theIndex)
68 aPnt = mypolyg.Pnt(theIndex);
71 aProj->Project(aPnt.Transformed(Location().Transformation()), aPnt2d);
75 aProj->Project(aPnt, aPnt2d);
77 mybox2d.Update(aPnt2d);
78 mypolyg.SetPnt2d(theIndex, aPnt2d);
82 //==================================================
85 //==================================================
86 void Select3D_SensitivePoly
87 ::Areas(SelectBasics_ListOfBox2d& aSeq)