42cf5bc1 |
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 | |
787ff240 |
17 | #ifndef _PrsDim_TangentRelation_HeaderFile |
18 | #define _PrsDim_TangentRelation_HeaderFile |
42cf5bc1 |
19 | |
787ff240 |
20 | #include <PrsDim_Relation.hxx> |
42cf5bc1 |
21 | |
787ff240 |
22 | DEFINE_STANDARD_HANDLE(PrsDim_TangentRelation, PrsDim_Relation) |
42cf5bc1 |
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. |
787ff240 |
27 | class PrsDim_TangentRelation : public PrsDim_Relation |
42cf5bc1 |
28 | { |
787ff240 |
29 | DEFINE_STANDARD_RTTIEXT(PrsDim_TangentRelation, PrsDim_Relation) |
42cf5bc1 |
30 | public: |
31 | |
42cf5bc1 |
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. |
787ff240 |
38 | Standard_EXPORT PrsDim_TangentRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane, const Standard_Integer anExternRef = 0); |
42cf5bc1 |
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. |
787ff240 |
46 | Standard_Integer ExternRef() { return myExternRef; } |
47 | |
42cf5bc1 |
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. |
787ff240 |
54 | void SetExternRef (const Standard_Integer aRef) { myExternRef = aRef; } |
42cf5bc1 |
55 | |
42cf5bc1 |
56 | private: |
57 | |
decbff0d |
58 | Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr, |
59 | const Handle(Prs3d_Presentation)& thePrs, |
60 | const Standard_Integer theMode) Standard_OVERRIDE; |
61 | |
62 | Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel, |
63 | const Standard_Integer theMode) Standard_OVERRIDE; |
64 | |
42cf5bc1 |
65 | Standard_EXPORT void ComputeTwoFacesTangent (const Handle(Prs3d_Presentation)& aPresentation); |
decbff0d |
66 | |
42cf5bc1 |
67 | Standard_EXPORT void ComputeTwoEdgesTangent (const Handle(Prs3d_Presentation)& aPresentation); |
68 | |
787ff240 |
69 | private: |
70 | |
42cf5bc1 |
71 | gp_Pnt myAttach; |
72 | gp_Dir myDir; |
73 | Standard_Real myLength; |
74 | Standard_Integer myExternRef; |
75 | |
42cf5bc1 |
76 | }; |
77 | |
787ff240 |
78 | #endif // _PrsDim_TangentRelation_HeaderFile |