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 <Select3D_SensitiveEntity.hxx>
21 #include <SelectMgr_SelectingVolumeManager.hxx>
23 //! A framework to define sensitive zones along a segment
24 //! One gives the 3D start and end point
25 class Select3D_SensitiveSegment : public Select3D_SensitiveEntity
27 DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveSegment, Select3D_SensitiveEntity)
30 //! Constructs the sensitive segment object defined by
31 //! the owner theOwnerId, the points theFirstPnt, theLastPnt
32 Standard_EXPORT Select3D_SensitiveSegment (const Handle(SelectMgr_EntityOwner)& theOwnerId,
33 const gp_Pnt& theFirstPnt,
34 const gp_Pnt& theLastPnt);
36 //! changes the start Point of the Segment;
37 void SetStartPoint (const gp_Pnt& thePnt) { myStart = thePnt; }
39 //! changes the end point of the segment
40 void SetEndPoint (const gp_Pnt& thePnt) { myEnd = thePnt; }
42 //! gives the 3D start Point of the Segment
43 const gp_Pnt& StartPoint() const { return myStart; }
45 //! gives the 3D End Point of the Segment
46 const gp_Pnt& EndPoint() const { return myEnd; }
48 //! Returns the amount of points
49 Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
51 Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
53 //! Checks whether the segment overlaps current selecting volume
54 Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
55 SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
57 //! Returns center of the segment. If location transformation
58 //! is set, it will be applied
59 Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
61 //! Returns bounding box of the segment. If location
62 //! transformation is set, it will be applied
63 Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
67 //! changes the start Point of the Segment;
68 void StartPoint (const gp_Pnt& thePnt) { myStart = thePnt; }
70 //! changes the end point of the segment
71 void EndPoint (const gp_Pnt& thePnt) { myEnd = thePnt; }
75 gp_Pnt myStart; //!< Start point
76 gp_Pnt myEnd; //!< End point
79 DEFINE_STANDARD_HANDLE(Select3D_SensitiveSegment, Select3D_SensitiveEntity)
81 #endif // _Select3D_SensitiveSegment_HeaderFile