0024947: Redesign OCCT legacy type system -- automatic
[occt.git] / src / Select3D / Select3D_SensitiveTriangle.hxx
CommitLineData
f751596e 1// Created on: 1997-05-14
2// Created by: Robert COUBLANC
3// Copyright (c) 1997-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_SensitiveTriangle_HeaderFile
18#define _Select3D_SensitiveTriangle_HeaderFile
19
20#include <Standard.hxx>
ec357c5c 21#include <Standard_Type.hxx>
f751596e 22#include <Standard_Type.hxx>
23
24#include <Select3D_TypeOfSensitivity.hxx>
25#include <Select3D_Pnt.hxx>
26#include <Select3D_SensitivePoly.hxx>
27#include <Handle_SelectBasics_EntityOwner.hxx>
28#include <SelectMgr_SelectingVolumeManager.hxx>
29#include <Standard_OStream.hxx>
30
31class Standard_ConstructionError;
32class Standard_OutOfRange;
33class SelectBasics_EntityOwner;
34class gp_Pnt;
35class TColgp_Array1OfPnt2d;
36class Select3D_SensitiveEntity;
37class TopLoc_Location;
38
39
40//! A framework to define selection of triangles in a view.
41//! This comes into play in the detection of meshing and triangulation in surfaces.
42//! In some cases this class can raise Standard_ConstructionError and
43//! Standard_OutOfRange exceptions. For more details see Select3D_SensitivePoly.
2157d6ac 44class Select3D_SensitiveTriangle : public Select3D_SensitiveEntity
f751596e 45{
46public:
47
48 //! Constructs a sensitive triangle object defined by the
49 //! owner theOwnerId, the points P1, P2, P3, and the type of sensitivity Sensitivity.
50 Standard_EXPORT Select3D_SensitiveTriangle (const Handle(SelectBasics_EntityOwner)& theOwnerId,
51 const gp_Pnt& thePnt0,
52 const gp_Pnt& thePnt1,
53 const gp_Pnt& thePnt2,
54 const Select3D_TypeOfSensitivity theType = Select3D_TOS_INTERIOR);
55
56 //! Checks whether the triangle overlaps current selecting volume
57 Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
58 SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
59
60 //! Returns the 3D points P1, P2, P3 used at the time of construction.
61 Standard_EXPORT void Points3D (gp_Pnt& thePnt0, gp_Pnt& thePnt1, gp_Pnt& thePnt2) const;
62
63 //! Returns the center point of the sensitive triangle created at construction time.
64 Standard_EXPORT gp_Pnt Center3D() const;
65
66 //! Returns the copy of this
67 Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
68
69 //! Returns bounding box of the triangle. If location transformation is set, it
70 //! will be applied
71 Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
72
73 //! Returns the amount of points
2157d6ac 74 virtual Standard_Integer NbSubElements() Standard_OVERRIDE { return 3; }
75
76 virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE { return myCentroid; }
f751596e 77
ec357c5c 78 DEFINE_STANDARD_RTTI(Select3D_SensitiveTriangle, Select3D_SensitiveEntity)
f751596e 79
80private:
81
82 Select3D_TypeOfSensitivity mySensType; //!< Type of sensitivity: boundary or interior
83 gp_Pnt myCentroid; //!< Center of triangle
2157d6ac 84 gp_Pnt myPoints[3];
f751596e 85};
86
87DEFINE_STANDARD_HANDLE(Select3D_SensitiveTriangle, Select3D_SensitiveEntity)
88
89#endif