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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Select3D_SensitiveSegment_HeaderFile
18 #define _Select3D_SensitiveSegment_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22 #include <Standard_Type.hxx>
24 #include <Standard_Integer.hxx>
25 #include <Select3D_Pnt.hxx>
26 #include <Select3D_SensitiveEntity.hxx>
27 #include <Handle_SelectBasics_EntityOwner.hxx>
29 #include <SelectMgr_SelectingVolumeManager.hxx>
30 #include <Standard_OStream.hxx>
32 class SelectBasics_EntityOwner;
34 class TopLoc_Location;
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
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);
48 //! changes the start Point of the Segment;
49 void StartPoint (const gp_Pnt& thePnt);
51 //! changes the end point of the segment
52 void EndPoint (const gp_Pnt& thePnt);
54 //! gives the 3D start Point of the Segment
55 gp_Pnt StartPoint() const;
57 //! gives the 3D End Point of the Segment
58 gp_Pnt EndPoint() const;
60 //! Returns the amount of points
61 Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
63 Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
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;
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;
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;
77 DEFINE_STANDARD_RTTI(Select3D_SensitiveSegment, Select3D_SensitiveEntity)
81 gp_Pnt myStart; //!< Start point
82 gp_Pnt myEnd; //!< End point
85 DEFINE_STANDARD_HANDLE(Select3D_SensitiveSegment, Select3D_SensitiveEntity)
87 #include <Select3D_SensitiveSegment.lxx>
89 #endif // _Select3D_SensitiveSegment_HeaderFile