0030675: Visualization - remove redundant proxy classes in hierarchy of PrsMgr_Presen...
[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   //! computes the presentation according to a point of view
57   //! given by <aProjector>.
58   //! To be Used when the associated degenerated Presentations
59   //! have been transformed by <aTrsf> which is not a Pure
60   //! Translation. The HLR Prs can't be deducted automatically
61   //! WARNING :<aTrsf> must be applied
62   //! to the object to display before computation  !!!
63   Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
64
65 private:
66
67   Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
68   
69   Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
70   
71   Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
72   
73   Standard_EXPORT void ComputeTwoFacesTangent (const Handle(Prs3d_Presentation)& aPresentation);
74   
75   Standard_EXPORT void ComputeTwoEdgesTangent (const Handle(Prs3d_Presentation)& aPresentation);
76
77   gp_Pnt myAttach;
78   gp_Dir myDir;
79   Standard_Real myLength;
80   Standard_Integer myExternRef;
81
82 };
83
84 #endif // _AIS_TangentRelation_HeaderFile