Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-26 09:04:29

0001 // Created on: 2000-10-20
0002 // Created by: Julia DOROVSKIKH
0003 // Copyright (c) 2000-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _PrsDim_MidPointRelation_HeaderFile
0017 #define _PrsDim_MidPointRelation_HeaderFile
0018 
0019 #include <PrsDim_Relation.hxx>
0020 
0021 class Geom_Plane;
0022 class gp_Lin;
0023 class gp_Circ;
0024 class gp_Elips;
0025 
0026 //! presentation of equal distance to point myMidPoint
0027 class PrsDim_MidPointRelation : public PrsDim_Relation
0028 {
0029   DEFINE_STANDARD_RTTIEXT(PrsDim_MidPointRelation, PrsDim_Relation)
0030 public:
0031   Standard_EXPORT PrsDim_MidPointRelation(const TopoDS_Shape&            aSymmTool,
0032                                           const TopoDS_Shape&            FirstShape,
0033                                           const TopoDS_Shape&            SecondShape,
0034                                           const occ::handle<Geom_Plane>& aPlane);
0035 
0036   bool IsMovable() const override { return true; }
0037 
0038   void SetTool(const TopoDS_Shape& aMidPointTool) { myTool = aMidPointTool; }
0039 
0040   const TopoDS_Shape& GetTool() const { return myTool; }
0041 
0042 private:
0043   Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
0044                                const occ::handle<Prs3d_Presentation>&         thePrs,
0045                                const int                                      theMode) override;
0046 
0047   Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSel,
0048                                         const int                               theMode) override;
0049 
0050   Standard_EXPORT void ComputeFaceFromPnt(const occ::handle<Prs3d_Presentation>& aprs,
0051                                           const bool                             first);
0052 
0053   Standard_EXPORT void ComputeEdgeFromPnt(const occ::handle<Prs3d_Presentation>& aprs,
0054                                           const bool                             first);
0055 
0056   Standard_EXPORT void ComputeVertexFromPnt(const occ::handle<Prs3d_Presentation>& aprs,
0057                                             const bool                             first);
0058 
0059   Standard_EXPORT void ComputePointsOnLine(const gp_Lin& aLin, const bool first);
0060 
0061   Standard_EXPORT void ComputePointsOnLine(const gp_Pnt& pnt1,
0062                                            const gp_Pnt& pnt2,
0063                                            const bool    first);
0064 
0065   Standard_EXPORT void ComputePointsOnCirc(const gp_Circ& aCirc,
0066                                            const gp_Pnt&  pnt1,
0067                                            const gp_Pnt&  pnt2,
0068                                            const bool     first);
0069 
0070   //! ComputePointsOn... methods set myFAttach, myFirstPnt and myLastPnt
0071   //! from the following initial data: curve, end points, myMidPoint.
0072   //! End points (pnt1 & pnt2) and curve define the trimmed curve.
0073   //! If end points are equal, curve is not trimmed (line - special case).
0074   //!
0075   //! .------. pnt2
0076   //! /
0077   //! .  circle  . myLastPnt
0078   //! |          |
0079   //! . pnt1     . myFAttach
0080   //! \   arc  /          . myMidPoint
0081   //! .______. myFirstPnt
0082   Standard_EXPORT void ComputePointsOnElips(const gp_Elips& anEll,
0083                                             const gp_Pnt&   pnt1,
0084                                             const gp_Pnt&   pnt2,
0085                                             const bool      first);
0086 
0087 private:
0088   TopoDS_Shape myTool;
0089   gp_Pnt       myMidPoint;
0090   gp_Pnt       myFAttach;
0091   gp_Pnt       myFirstPnt1;
0092   gp_Pnt       myFirstPnt2;
0093   gp_Pnt       mySAttach;
0094   gp_Pnt       mySecondPnt1;
0095   gp_Pnt       mySecondPnt2;
0096 };
0097 
0098 #endif // _AIS_MidPointRelation_HeaderFile