Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-16 08:30:00

0001 // Created on: 1997-03-03
0002 // Created by: Jean-Pierre COMBE
0003 // Copyright (c) 1997-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_SymmetricRelation_HeaderFile
0018 #define _PrsDim_SymmetricRelation_HeaderFile
0019 
0020 #include <gp_Pnt.hxx>
0021 #include <gp_Dir.hxx>
0022 #include <PrsDim_Relation.hxx>
0023 
0024 DEFINE_STANDARD_HANDLE(PrsDim_SymmetricRelation, PrsDim_Relation)
0025 
0026 //! A framework to display constraints of symmetricity
0027 //! between two or more datum Interactive Objects.
0028 //! A plane serves as the axis of symmetry between the
0029 //! shapes of which the datums are parts.
0030 class PrsDim_SymmetricRelation : public PrsDim_Relation
0031 {
0032   DEFINE_STANDARD_RTTIEXT(PrsDim_SymmetricRelation, PrsDim_Relation)
0033 public:
0034   //! Constructs an object to display constraints of symmetricity.
0035   //! This object is defined by a tool aSymmTool, a first
0036   //! shape FirstShape, a second shape SecondShape, and a plane aPlane.
0037   //! aPlane serves as the axis of symmetry.
0038   //! aSymmTool is the shape composed of FirstShape
0039   //! SecondShape and aPlane. It may be queried and
0040   //! edited using the functions GetTool and SetTool.
0041   //! The two shapes are typically two edges, two vertices or two points.
0042   Standard_EXPORT PrsDim_SymmetricRelation(const TopoDS_Shape&       aSymmTool,
0043                                            const TopoDS_Shape&       FirstShape,
0044                                            const TopoDS_Shape&       SecondShape,
0045                                            const Handle(Geom_Plane)& aPlane);
0046 
0047   //! Returns true if the symmetric constraint display is movable.
0048   virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
0049 
0050   //! Sets the tool aSymmetricTool composed of a first
0051   //! shape, a second shape, and a plane.
0052   //! This tool is initially created at construction time.
0053   void SetTool(const TopoDS_Shape& aSymmetricTool) { myTool = aSymmetricTool; }
0054 
0055   //! Returns the tool composed of a first shape, a second
0056   //! shape, and a plane. This tool is created at construction time.
0057   const TopoDS_Shape& GetTool() const { return myTool; }
0058 
0059 private:
0060   Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0061                                        const Handle(Prs3d_Presentation)&         thePrs,
0062                                        const Standard_Integer theMode) Standard_OVERRIDE;
0063 
0064   Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& theSel,
0065                                                 const Standard_Integer theMode) Standard_OVERRIDE;
0066 
0067   Standard_EXPORT void ComputeTwoFacesSymmetric(const Handle(Prs3d_Presentation)& aprs);
0068 
0069   Standard_EXPORT void ComputeTwoEdgesSymmetric(const Handle(Prs3d_Presentation)& aprs);
0070 
0071   Standard_EXPORT void ComputeTwoVerticesSymmetric(const Handle(Prs3d_Presentation)& aprs);
0072 
0073 private:
0074   TopoDS_Shape myTool;
0075   gp_Pnt       myFAttach;
0076   gp_Pnt       mySAttach;
0077   gp_Dir       myFDirAttach;
0078   gp_Dir       myAxisDirAttach;
0079 };
0080 
0081 #endif // _PrsDim_SymmetricRelation_HeaderFile