0024750: Replace instantiations of TCollection generic classes by NCollection templat...
[occt.git] / src / Select3D / Select3D_SensitiveSegment.hxx
1 // Created on: 1995-01-25
2 // Created by: Mister rmi
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_SensitiveSegment_HeaderFile
18 #define _Select3D_SensitiveSegment_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22 #include <Standard_Type.hxx>
23
24 #include <Standard_Integer.hxx>
25 #include <Select3D_Pnt.hxx>
26 #include <Select3D_SensitiveEntity.hxx>
27 #include <Handle_SelectBasics_EntityOwner.hxx>
28 #include <gp_Pnt.hxx>
29 #include <SelectMgr_SelectingVolumeManager.hxx>
30 #include <Standard_OStream.hxx>
31
32 class SelectBasics_EntityOwner;
33 class gp_Pnt;
34 class TopLoc_Location;
35
36 //! A framework to define sensitive zones along a segment
37 //!          One gives the 3D start and end point
38 class Select3D_SensitiveSegment : public Select3D_SensitiveEntity
39 {
40 public:
41
42   //! Constructs the sensitive segment object defined by
43   //! the owner theOwnerId, the points theFirstPnt, theLastPnt
44   Standard_EXPORT Select3D_SensitiveSegment (const Handle(SelectBasics_EntityOwner)& theOwnerId,
45                                              const gp_Pnt& theFirstPnt,
46                                              const gp_Pnt& theLastPnt);
47
48   //! changes the start Point of the Segment;
49   void StartPoint (const gp_Pnt& thePnt);
50
51   //! changes the end point of the segment
52   void EndPoint (const gp_Pnt& thePnt);
53
54   //! gives the 3D start Point of the Segment
55   gp_Pnt StartPoint() const;
56
57   //! gives the 3D End Point of the Segment
58   gp_Pnt EndPoint() const;
59
60   //! Returns the amount of points
61   Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
62
63   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
64
65   //! Checks whether the segment overlaps current selecting volume
66   Standard_EXPORT   virtual  Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
67                                                        SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
68
69   //! Returns center of the segment. If location transformation
70   //! is set, it will be applied
71   Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
72
73   //! Returns bounding box of the segment. If location
74   //! transformation is set, it will be applied
75   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
76
77   DEFINE_STANDARD_RTTI(Select3D_SensitiveSegment, Select3D_SensitiveEntity)
78
79 private:
80
81   gp_Pnt myStart;      //!< Start point
82   gp_Pnt myEnd;        //!< End point
83 };
84
85 DEFINE_STANDARD_HANDLE(Select3D_SensitiveSegment, Select3D_SensitiveEntity)
86
87 #include <Select3D_SensitiveSegment.lxx>
88
89 #endif // _Select3D_SensitiveSegment_HeaderFile