1e63a87bdc49bee1ca4b48700a5193e3185ffd77
[occt.git] / src / Select3D / Select3D_SensitiveCurve.hxx
1 // Created on: 1995-03-13
2 // Created by: Robert COUBLANC
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _Select3D_SensitiveCurve_HeaderFile
18 #define _Select3D_SensitiveCurve_HeaderFile
19
20 #include <Geom_Curve.hxx>
21 #include <Select3D_SensitivePoly.hxx>
22 #include <TColgp_HArray1OfPnt.hxx>
23 #include <SelectMgr_SelectingVolumeManager.hxx>
24
25 class Standard_ConstructionError;
26 class Standard_OutOfRange;
27
28 //! A framework to define a sensitive 3D curve.
29 //! In some cases this class can raise Standard_ConstructionError and
30 //! Standard_OutOfRange exceptions. For more details see Select3D_SensitivePoly.
31 class Select3D_SensitiveCurve : public Select3D_SensitivePoly
32 {
33   DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveCurve, Select3D_SensitivePoly)
34 public:
35
36   //! Constructs a sensitive curve object defined by the
37   //! owner theOwnerId, the curve theCurve, and the
38   //! maximum number of points on the curve: theNbPnts.
39   Standard_EXPORT Select3D_SensitiveCurve (const Handle(SelectMgr_EntityOwner)& theOwnerId,
40                                            const Handle(Geom_Curve)& theCurve,
41                                            const Standard_Integer theNbPnts = 17);
42
43   //! Constructs a sensitive curve object defined by the
44   //! owner theOwnerId and the set of points ThePoints.
45   Standard_EXPORT Select3D_SensitiveCurve (const Handle(SelectMgr_EntityOwner)& theOwnerId,
46                                            const Handle(TColgp_HArray1OfPnt)& thePoints);
47
48   //! Creation of Sensitive Curve from Points.
49   //!          Warning : This Method should disappear in the next version...
50   Standard_EXPORT Select3D_SensitiveCurve (const Handle(SelectMgr_EntityOwner)& theOwnerId,
51                                            const TColgp_Array1OfPnt& thePoints);
52
53   //! Returns the copy of this
54   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
55
56 private:
57
58   void loadPoints (const Handle(Geom_Curve)& aCurve,
59                    const Standard_Integer NbPoints);
60
61 private:
62
63   Handle(Geom_Curve) myCurve;     //!< Curve points
64 };
65
66 DEFINE_STANDARD_HANDLE(Select3D_SensitiveCurve, Select3D_SensitivePoly)
67
68 #endif // _Select3D_SensitiveCurve_HeaderFile