Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/Select3D_SensitiveSegment.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Created on: 1995-01-25
0002 // Created by: Mister rmi
0003 // Copyright (c) 1995-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Select3D_SensitiveSegment_HeaderFile
0018 #define _Select3D_SensitiveSegment_HeaderFile
0019 
0020 #include <Select3D_SensitiveEntity.hxx>
0021 #include <SelectMgr_SelectingVolumeManager.hxx>
0022 
0023 //! A framework to define sensitive zones along a segment
0024 //!          One gives the 3D start and end point
0025 class Select3D_SensitiveSegment : public Select3D_SensitiveEntity
0026 {
0027   DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveSegment, Select3D_SensitiveEntity)
0028 public:
0029 
0030   //! Constructs the sensitive segment object defined by
0031   //! the owner theOwnerId, the points theFirstPnt, theLastPnt
0032   Standard_EXPORT Select3D_SensitiveSegment (const Handle(SelectMgr_EntityOwner)& theOwnerId,
0033                                              const gp_Pnt& theFirstPnt,
0034                                              const gp_Pnt& theLastPnt);
0035 
0036   //! changes the start Point of the Segment;
0037   void SetStartPoint (const gp_Pnt& thePnt) { myStart = thePnt; }
0038 
0039   //! changes the end point of the segment
0040   void SetEndPoint (const gp_Pnt& thePnt) { myEnd = thePnt; }
0041 
0042   //! gives the 3D start Point of the Segment
0043   const gp_Pnt& StartPoint() const { return myStart; }
0044 
0045   //! gives the 3D End Point of the Segment
0046   const gp_Pnt& EndPoint() const { return myEnd; }
0047 
0048   //! Returns the amount of points
0049   Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
0050 
0051   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
0052 
0053   //! Checks whether the segment overlaps current selecting volume
0054   Standard_EXPORT   virtual  Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
0055                                                        SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
0056 
0057   //! Returns center of the segment. If location transformation
0058   //! is set, it will be applied
0059   Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
0060 
0061   //! Returns bounding box of the segment. If location
0062   //! transformation is set, it will be applied
0063   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
0064 
0065   //! Returns TRUE if BVH tree is in invalidated state
0066   virtual Standard_Boolean ToBuildBVH() const Standard_OVERRIDE { return Standard_False; }
0067 
0068 public:
0069 
0070   //! changes the start Point of the Segment;
0071   void StartPoint (const gp_Pnt& thePnt) { myStart = thePnt; }
0072 
0073   //! changes the end point of the segment
0074   void EndPoint (const gp_Pnt& thePnt) { myEnd = thePnt; }
0075 
0076   //! Dumps the content of me into the stream
0077   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0078 
0079 private:
0080 
0081   gp_Pnt myStart;      //!< Start point
0082   gp_Pnt myEnd;        //!< End point
0083 };
0084 
0085 DEFINE_STANDARD_HANDLE(Select3D_SensitiveSegment, Select3D_SensitiveEntity)
0086 
0087 #endif // _Select3D_SensitiveSegment_HeaderFile