File indexing completed on 2026-09-19 09:29:10
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 <gp_Pnt.hxx>
0023 #include <NCollection_Array1.hxx>
0024 #include <NCollection_HArray1.hxx>
0025 #include <SelectMgr_SelectingVolumeManager.hxx>
0026
0027
0028
0029
0030 class Select3D_SensitiveCurve : public Select3D_SensitivePoly
0031 {
0032 DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveCurve, Select3D_SensitivePoly)
0033 public:
0034
0035
0036
0037 Select3D_SensitiveCurve(const occ::handle<SelectMgr_EntityOwner>& theOwnerId,
0038 const occ::handle<Geom_Curve>& theCurve,
0039 const int theNbPnts = 17)
0040 : Select3D_SensitivePoly(theOwnerId, true, theNbPnts)
0041 {
0042 loadPoints(theCurve, theNbPnts);
0043 mySFactor = 3;
0044 }
0045
0046
0047
0048 Standard_EXPORT Select3D_SensitiveCurve(
0049 const occ::handle<SelectMgr_EntityOwner>& theOwnerId,
0050 const occ::handle<NCollection_HArray1<gp_Pnt>>& thePoints);
0051
0052
0053
0054 Standard_EXPORT Select3D_SensitiveCurve(const occ::handle<SelectMgr_EntityOwner>& theOwnerId,
0055 const NCollection_Array1<gp_Pnt>& thePoints);
0056
0057
0058 Standard_EXPORT occ::handle<Select3D_SensitiveEntity> GetConnected() override;
0059
0060 private:
0061 void loadPoints(const occ::handle<Geom_Curve>& theCurve, const int theNbPnts)
0062 {
0063 const double aStep = (theCurve->LastParameter() - theCurve->FirstParameter()) / (theNbPnts - 1);
0064 double aParam = theCurve->FirstParameter();
0065 for (int aPntIdx = 0; aPntIdx < myPolyg.Size(); ++aPntIdx)
0066 {
0067 myPolyg.SetPnt(aPntIdx, theCurve->Value(aParam));
0068 aParam += aStep;
0069 }
0070 }
0071 };
0072
0073 #endif