File indexing completed on 2025-01-18 10:04:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _Select3D_SensitiveCurve_HeaderFile
0018 #define _Select3D_SensitiveCurve_HeaderFile
0019
0020 #include <Geom_Curve.hxx>
0021 #include <Select3D_SensitivePoly.hxx>
0022 #include <TColgp_HArray1OfPnt.hxx>
0023 #include <SelectMgr_SelectingVolumeManager.hxx>
0024
0025
0026
0027
0028
0029 class Select3D_SensitiveCurve : public Select3D_SensitivePoly
0030 {
0031 DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveCurve, Select3D_SensitivePoly)
0032 public:
0033
0034
0035
0036
0037 Select3D_SensitiveCurve (const Handle(SelectMgr_EntityOwner)& theOwnerId,
0038 const Handle(Geom_Curve)& theCurve,
0039 const Standard_Integer theNbPnts = 17)
0040 : Select3D_SensitivePoly (theOwnerId, Standard_True, theNbPnts)
0041 {
0042 loadPoints (theCurve, theNbPnts);
0043 mySFactor = 3;
0044 }
0045
0046
0047
0048 Standard_EXPORT Select3D_SensitiveCurve (const Handle(SelectMgr_EntityOwner)& theOwnerId,
0049 const Handle(TColgp_HArray1OfPnt)& thePoints);
0050
0051
0052
0053 Standard_EXPORT Select3D_SensitiveCurve (const Handle(SelectMgr_EntityOwner)& theOwnerId,
0054 const TColgp_Array1OfPnt& thePoints);
0055
0056
0057 Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
0058
0059 private:
0060
0061 void loadPoints (const Handle(Geom_Curve)& theCurve,
0062 const Standard_Integer theNbPnts)
0063 {
0064 const Standard_Real aStep = (theCurve->LastParameter() - theCurve->FirstParameter()) / (theNbPnts - 1);
0065 Standard_Real aParam = theCurve->FirstParameter();
0066 for (Standard_Integer aPntIdx = 0; aPntIdx < myPolyg.Size(); ++aPntIdx)
0067 {
0068 myPolyg.SetPnt (aPntIdx, theCurve->Value (aParam));
0069 aParam += aStep;
0070 }
0071 }
0072
0073 };
0074
0075 DEFINE_STANDARD_HANDLE(Select3D_SensitiveCurve, Select3D_SensitivePoly)
0076
0077 #endif