Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:41

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 
0035   //! Constructs an object to display constraints of symmetricity.
0036   //! This object is defined by a tool aSymmTool, a first
0037   //! shape FirstShape, a second shape SecondShape, and a plane aPlane.
0038   //! aPlane serves as the axis of symmetry.
0039   //! aSymmTool is the shape composed of FirstShape
0040   //! SecondShape and aPlane. It may be queried and
0041   //! edited using the functions GetTool and SetTool.
0042   //! The two shapes are typically two edges, two vertices or two points.
0043   Standard_EXPORT PrsDim_SymmetricRelation(const TopoDS_Shape& aSymmTool, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane);
0044   
0045   //! Returns true if the symmetric constraint display is movable.
0046   virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
0047 
0048   //! Sets the tool aSymmetricTool composed of a first
0049   //! shape, a second shape, and a plane.
0050   //! This tool is initially created at construction time.
0051   void SetTool (const TopoDS_Shape& aSymmetricTool) { myTool = aSymmetricTool; }
0052 
0053   //! Returns the tool composed of a first shape, a second
0054   //! shape, and a plane. This tool is created at construction time.
0055   const TopoDS_Shape& GetTool() const { return myTool; }
0056 
0057 private:
0058 
0059   Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0060                                         const Handle(Prs3d_Presentation)& thePrs,
0061                                         const Standard_Integer theMode) Standard_OVERRIDE;
0062 
0063   Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
0064                                                  const Standard_Integer theMode) Standard_OVERRIDE;
0065 
0066   Standard_EXPORT void ComputeTwoFacesSymmetric (const Handle(Prs3d_Presentation)& aprs);
0067 
0068   Standard_EXPORT void ComputeTwoEdgesSymmetric (const Handle(Prs3d_Presentation)& aprs);
0069 
0070   Standard_EXPORT void ComputeTwoVerticesSymmetric (const Handle(Prs3d_Presentation)& aprs);
0071 
0072 private:
0073 
0074   TopoDS_Shape myTool;
0075   gp_Pnt myFAttach;
0076   gp_Pnt mySAttach;
0077   gp_Dir myFDirAttach;
0078   gp_Dir myAxisDirAttach;
0079 
0080 };
0081 
0082 #endif // _PrsDim_SymmetricRelation_HeaderFile