0031459: Visualization, AIS_TextLabel - add missing getters
[occt.git] / src / AIS / AIS_TangentRelation.hxx
1 // Created on: 1996-12-05
2 // Created by: Jean-Pierre COMBE/Odile Olivier
3 // Copyright (c) 1996-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 _AIS_TangentRelation_HeaderFile
18 #define _AIS_TangentRelation_HeaderFile
19
20 #include <AIS_Relation.hxx>
21
22 DEFINE_STANDARD_HANDLE(AIS_TangentRelation, AIS_Relation)
23
24 //! A framework to display tangency constraints between
25 //! two or more Interactive Objects of the datum type.
26 //! The datums are normally faces or edges.
27 class AIS_TangentRelation : public AIS_Relation
28 {
29   DEFINE_STANDARD_RTTIEXT(AIS_TangentRelation, AIS_Relation)
30 public:
31
32   //! TwoFacesTangent or TwoEdgesTangent relation
33   //! Constructs an object to display tangency constraints.
34   //! This object is defined by the first shape aFShape, the
35   //! second shape aSShape, the plane aPlane and the index anExternRef.
36   //! aPlane serves as an optional axis.
37   //! anExternRef set to 0 indicates that there is no relation.
38   Standard_EXPORT AIS_TangentRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane, const Standard_Integer anExternRef = 0);
39   
40   //! Returns the external reference for tangency.
41   //! The values are as follows:
42   //! -   0 - there is no connection;
43   //! -   1 - there is a connection to the first shape;
44   //! -   2 - there is a connection to the second shape.
45   //! This reference is defined at construction time.
46   Standard_EXPORT Standard_Integer ExternRef();
47   
48   //! Sets the external reference for tangency, aRef.
49   //! The values are as follows:
50   //! -   0 - there is no connection;
51   //! -   1 - there is a connection to the first shape;
52   //! -   2 - there is a connection to the second shape.
53   //! This reference is initially defined at construction time.
54   Standard_EXPORT void SetExternRef (const Standard_Integer aRef);
55
56 private:
57
58   Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
59   
60   Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
61   
62   Standard_EXPORT void ComputeTwoFacesTangent (const Handle(Prs3d_Presentation)& aPresentation);
63   
64   Standard_EXPORT void ComputeTwoEdgesTangent (const Handle(Prs3d_Presentation)& aPresentation);
65
66   gp_Pnt myAttach;
67   gp_Dir myDir;
68   Standard_Real myLength;
69   Standard_Integer myExternRef;
70
71 };
72
73 #endif // _AIS_TangentRelation_HeaderFile