Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:17:37

0001 // Created on: 1996-12-05
0002 // Created by: Jean-Pierre COMBE/Odile Olivier
0003 // Copyright (c) 1996-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _PrsDim_ParallelRelation_HeaderFile
0018 #define _PrsDim_ParallelRelation_HeaderFile
0019 
0020 #include <PrsDim_Relation.hxx>
0021 #include <DsgPrs_ArrowSide.hxx>
0022 
0023 //! A framework to display constraints of parallelism
0024 //! between two or more Interactive Objects. These
0025 //! entities can be faces or edges.
0026 class PrsDim_ParallelRelation : public PrsDim_Relation
0027 {
0028   DEFINE_STANDARD_RTTIEXT(PrsDim_ParallelRelation, PrsDim_Relation)
0029 public:
0030   //! Constructs an object to display parallel constraints.
0031   //! This object is defined by the first shape aFShape and
0032   //! the second shape aSShape and the plane aPlane.
0033   Standard_EXPORT PrsDim_ParallelRelation(const TopoDS_Shape&            aFShape,
0034                                           const TopoDS_Shape&            aSShape,
0035                                           const occ::handle<Geom_Plane>& aPlane);
0036 
0037   //! Constructs an object to display parallel constraints.
0038   //! This object is defined by the first shape aFShape and
0039   //! the second shape aSShape the plane aPlane, the
0040   //! position aPosition, the type of arrow, aSymbolPrs and
0041   //! its size anArrowSize.
0042   Standard_EXPORT PrsDim_ParallelRelation(const TopoDS_Shape&            aFShape,
0043                                           const TopoDS_Shape&            aSShape,
0044                                           const occ::handle<Geom_Plane>& aPlane,
0045                                           const gp_Pnt&                  aPosition,
0046                                           const DsgPrs_ArrowSide         aSymbolPrs,
0047                                           const double                   anArrowSize = 0.01);
0048 
0049   //! Returns true if the parallelism is movable.
0050   bool IsMovable() const override { return true; }
0051 
0052 private:
0053   Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
0054                                const occ::handle<Prs3d_Presentation>&         thePrs,
0055                                const int                                      theMode) override;
0056 
0057   Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSel,
0058                                         const int                               theMode) override;
0059 
0060   Standard_EXPORT void ComputeTwoFacesParallel(
0061     const occ::handle<Prs3d_Presentation>& aPresentation);
0062 
0063   Standard_EXPORT void ComputeTwoEdgesParallel(
0064     const occ::handle<Prs3d_Presentation>& aPresentation);
0065 
0066 private:
0067   gp_Pnt myFAttach;
0068   gp_Pnt mySAttach;
0069   gp_Dir myDirAttach;
0070 };
0071 
0072 #endif // _PrsDim_ParallelRelation_HeaderFile