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>
28 #include <SelectMgr_SelectingVolumeManager.hxx>
29 #include <Standard_OStream.hxx>
31 class SelectBasics_EntityOwner;
33 class TopLoc_Location;
35 //! A framework to define sensitive zones along a segment
36 //! One gives the 3D start and end point
37 class Select3D_SensitiveSegment : public Select3D_SensitiveEntity
41 //! Constructs the sensitive segment object defined by
42 //! the owner theOwnerId, the points theFirstPnt, theLastPnt
43 Standard_EXPORT Select3D_SensitiveSegment (const Handle(SelectBasics_EntityOwner)& theOwnerId,
44 const gp_Pnt& theFirstPnt,
45 const gp_Pnt& theLastPnt);
47 //! changes the start Point of the Segment;
48 void StartPoint (const gp_Pnt& thePnt);
50 //! changes the end point of the segment
51 void EndPoint (const gp_Pnt& thePnt);
53 //! gives the 3D start Point of the Segment
54 gp_Pnt StartPoint() const;
56 //! gives the 3D End Point of the Segment
57 gp_Pnt EndPoint() const;
59 //! Returns the amount of points
60 Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
62 Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
64 //! Checks whether the segment overlaps current selecting volume
65 Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
66 SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
68 //! Returns center of the segment. If location transformation
69 //! is set, it will be applied
70 Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
72 //! Returns bounding box of the segment. If location
73 //! transformation is set, it will be applied
74 Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
76 DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveSegment,Select3D_SensitiveEntity)
80 gp_Pnt myStart; //!< Start point
81 gp_Pnt myEnd; //!< End point
84 DEFINE_STANDARD_HANDLE(Select3D_SensitiveSegment, Select3D_SensitiveEntity)
86 #include <Select3D_SensitiveSegment.lxx>
88 #endif // _Select3D_SensitiveSegment_HeaderFile