1 // Created on: 2000-10-20
2 // Created by: Julia DOROVSKIKH
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _AIS_MidPointRelation_HeaderFile
17 #define _AIS_MidPointRelation_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
22 #include <TopoDS_Shape.hxx>
24 #include <AIS_Relation.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <PrsMgr_PresentationManager3d.hxx>
27 #include <Standard_Integer.hxx>
28 #include <SelectMgr_Selection.hxx>
31 class Prs3d_Presentation;
32 class Prs3d_Projector;
33 class Geom_Transformation;
40 class AIS_MidPointRelation;
41 DEFINE_STANDARD_HANDLE(AIS_MidPointRelation, AIS_Relation)
43 //! presentation of equal distance to point myMidPoint
44 class AIS_MidPointRelation : public AIS_Relation
50 Standard_EXPORT AIS_MidPointRelation(const TopoDS_Shape& aSymmTool, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane);
52 virtual Standard_Boolean IsMovable() const Standard_OVERRIDE;
54 void SetTool (const TopoDS_Shape& aMidPointTool);
56 const TopoDS_Shape& GetTool() const;
58 //! Computes the presentation according to a point of view
59 //! given by <aProjector>.
60 //! To be Used when the associated degenerated Presentations
61 //! have been transformed by <aTrsf> which is not a Pure
62 //! Translation. The HLR Prs can't be deducted automatically
63 //! WARNING :<aTrsf> must be applied
64 //! to the object to display before computation !!!
65 Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
70 DEFINE_STANDARD_RTTIEXT(AIS_MidPointRelation,AIS_Relation)
80 Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
82 Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
84 Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
86 Standard_EXPORT void ComputeFaceFromPnt (const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first);
88 Standard_EXPORT void ComputeEdgeFromPnt (const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first);
90 Standard_EXPORT void ComputeVertexFromPnt (const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first);
92 Standard_EXPORT void ComputePointsOnLine (const gp_Lin& aLin, const Standard_Boolean first);
94 Standard_EXPORT void ComputePointsOnLine (const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Boolean first);
96 Standard_EXPORT void ComputePointsOnCirc (const gp_Circ& aCirc, const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Boolean first);
98 //! ComputePointsOn... methods set myFAttach, myFirstPnt and myLastPnt
99 //! from the following initial data: curve, end points, myMidPoint.
100 //! End points (pnt1 & pnt2) and curve define the trimmed curve.
101 //! If end points are equal, curve is not trimmed (line - special case).
105 //! . circle . myLastPnt
107 //! . pnt1 . myFAttach
108 //! \ arc / . myMidPoint
109 //! .______. myFirstPnt
110 Standard_EXPORT void ComputePointsOnElips (const gp_Elips& anEll, const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Boolean first);
125 #include <AIS_MidPointRelation.lxx>
131 #endif // _AIS_MidPointRelation_HeaderFile