0031456: Visualization - move out Dimensions and Relations from package AIS to PrsDims
[occt.git] / src / PrsDim / PrsDim_MidPointRelation.hxx
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 _PrsDim_MidPointRelation_HeaderFile
17 #define _PrsDim_MidPointRelation_HeaderFile
18
19 #include <PrsDim_Relation.hxx>
20
21 class Geom_Plane;
22 class gp_Lin;
23 class gp_Pnt;
24 class gp_Circ;
25 class gp_Elips;
26
27 DEFINE_STANDARD_HANDLE(PrsDim_MidPointRelation, PrsDim_Relation)
28
29 //! presentation of equal distance to point myMidPoint
30 class PrsDim_MidPointRelation : public PrsDim_Relation
31 {
32   DEFINE_STANDARD_RTTIEXT(PrsDim_MidPointRelation, PrsDim_Relation)
33 public:
34
35   Standard_EXPORT PrsDim_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 { return Standard_True; }
38
39   void SetTool (const TopoDS_Shape& aMidPointTool) { myTool = aMidPointTool; }
40
41   const TopoDS_Shape& GetTool() const { return myTool; }
42
43 private:
44
45   Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
46   
47   Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
48   
49   Standard_EXPORT void ComputeFaceFromPnt (const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first);
50   
51   Standard_EXPORT void ComputeEdgeFromPnt (const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first);
52   
53   Standard_EXPORT void ComputeVertexFromPnt (const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first);
54   
55   Standard_EXPORT void ComputePointsOnLine (const gp_Lin& aLin, const Standard_Boolean first);
56   
57   Standard_EXPORT void ComputePointsOnLine (const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Boolean first);
58   
59   Standard_EXPORT void ComputePointsOnCirc (const gp_Circ& aCirc, const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Boolean first);
60   
61   //! ComputePointsOn... methods set myFAttach, myFirstPnt and myLastPnt
62   //! from the following initial data: curve, end points, myMidPoint.
63   //! End points (pnt1 & pnt2) and curve define the trimmed curve.
64   //! If end points are equal, curve is not trimmed (line - special case).
65   //!
66   //! .------. pnt2
67   //! /        
68   //! .  circle  . myLastPnt
69   //! |          |
70   //! . pnt1     . myFAttach
71   //! \   arc  /          . myMidPoint
72   //! .______. myFirstPnt
73   Standard_EXPORT void ComputePointsOnElips (const gp_Elips& anEll, const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Boolean first);
74
75 private:
76
77   TopoDS_Shape myTool;
78   gp_Pnt myMidPoint;
79   gp_Pnt myFAttach;
80   gp_Pnt myFirstPnt1;
81   gp_Pnt myFirstPnt2;
82   gp_Pnt mySAttach;
83   gp_Pnt mySecondPnt1;
84   gp_Pnt mySecondPnt2;
85
86 };
87
88 #endif // _AIS_MidPointRelation_HeaderFile