42cf5bc1 |
1 | // Created on: 2000-10-20 |
2 | // Created by: Julia DOROVSKIKH |
3 | // Copyright (c) 2000-2014 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef _AIS_MidPointRelation_HeaderFile |
17 | #define _AIS_MidPointRelation_HeaderFile |
18 | |
42cf5bc1 |
19 | #include <AIS_Relation.hxx> |
7dd7c146 |
20 | |
42cf5bc1 |
21 | class Geom_Plane; |
42cf5bc1 |
22 | class gp_Lin; |
23 | class gp_Pnt; |
24 | class gp_Circ; |
25 | class gp_Elips; |
26 | |
42cf5bc1 |
27 | DEFINE_STANDARD_HANDLE(AIS_MidPointRelation, AIS_Relation) |
28 | |
29 | //! presentation of equal distance to point myMidPoint |
30 | class AIS_MidPointRelation : public AIS_Relation |
31 | { |
7dd7c146 |
32 | DEFINE_STANDARD_RTTIEXT(AIS_MidPointRelation, AIS_Relation) |
42cf5bc1 |
33 | public: |
34 | |
42cf5bc1 |
35 | Standard_EXPORT AIS_MidPointRelation(const TopoDS_Shape& aSymmTool, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane); |
36 | |
37 | virtual Standard_Boolean IsMovable() const Standard_OVERRIDE; |
38 | |
39 | void SetTool (const TopoDS_Shape& aMidPointTool); |
40 | |
41 | const TopoDS_Shape& GetTool() const; |
42 | |
43 | //! Computes the presentation according to a point of view |
44 | //! given by <aProjector>. |
45 | //! To be Used when the associated degenerated Presentations |
46 | //! have been transformed by <aTrsf> which is not a Pure |
47 | //! Translation. The HLR Prs can't be deducted automatically |
48 | //! WARNING :<aTrsf> must be applied |
49 | //! to the object to display before computation !!! |
50 | Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; |
51 | |
42cf5bc1 |
52 | private: |
53 | |
42cf5bc1 |
54 | Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; |
55 | |
56 | Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; |
57 | |
79104795 |
58 | Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; |
42cf5bc1 |
59 | |
60 | Standard_EXPORT void ComputeFaceFromPnt (const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first); |
61 | |
62 | Standard_EXPORT void ComputeEdgeFromPnt (const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first); |
63 | |
64 | Standard_EXPORT void ComputeVertexFromPnt (const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first); |
65 | |
66 | Standard_EXPORT void ComputePointsOnLine (const gp_Lin& aLin, const Standard_Boolean first); |
67 | |
68 | Standard_EXPORT void ComputePointsOnLine (const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Boolean first); |
69 | |
70 | Standard_EXPORT void ComputePointsOnCirc (const gp_Circ& aCirc, const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Boolean first); |
71 | |
72 | //! ComputePointsOn... methods set myFAttach, myFirstPnt and myLastPnt |
73 | //! from the following initial data: curve, end points, myMidPoint. |
74 | //! End points (pnt1 & pnt2) and curve define the trimmed curve. |
75 | //! If end points are equal, curve is not trimmed (line - special case). |
76 | //! |
77 | //! .------. pnt2 |
78 | //! / |
79 | //! . circle . myLastPnt |
80 | //! | | |
81 | //! . pnt1 . myFAttach |
82 | //! \ arc / . myMidPoint |
83 | //! .______. myFirstPnt |
84 | Standard_EXPORT void ComputePointsOnElips (const gp_Elips& anEll, const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Boolean first); |
85 | |
86 | TopoDS_Shape myTool; |
87 | gp_Pnt myMidPoint; |
88 | gp_Pnt myFAttach; |
89 | gp_Pnt myFirstPnt1; |
90 | gp_Pnt myFirstPnt2; |
91 | gp_Pnt mySAttach; |
92 | gp_Pnt mySecondPnt1; |
93 | gp_Pnt mySecondPnt2; |
94 | |
42cf5bc1 |
95 | }; |
96 | |
42cf5bc1 |
97 | #include <AIS_MidPointRelation.lxx> |
98 | |
42cf5bc1 |
99 | #endif // _AIS_MidPointRelation_HeaderFile |