Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:32

0001 // Created on: 1993-03-24
0002 // Created by: JCV
0003 // Copyright (c) 1993-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 _Geom2d_AxisPlacement_HeaderFile
0018 #define _Geom2d_AxisPlacement_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <gp_Ax2d.hxx>
0023 #include <Geom2d_Geometry.hxx>
0024 #include <Standard_Real.hxx>
0025 class gp_Pnt2d;
0026 class gp_Dir2d;
0027 class gp_Trsf2d;
0028 
0029 
0030 class Geom2d_AxisPlacement;
0031 DEFINE_STANDARD_HANDLE(Geom2d_AxisPlacement, Geom2d_Geometry)
0032 
0033 //! Describes an axis in 2D space.
0034 //! An axis is defined by:
0035 //! - its origin, also termed the "Location point" of the axis,
0036 //! - its unit vector, termed the "Direction" of the axis.
0037 //! Note: Geom2d_AxisPlacement axes provide the
0038 //! same kind of "geometric" services as gp_Ax2d axes
0039 //! but have more complex data structures. The
0040 //! geometric objects provided by the Geom2d package
0041 //! use gp_Ax2d objects to include axes in their data
0042 //! structures, or to define an axis of symmetry or axis of rotation.
0043 //! Geom2d_AxisPlacement axes are used in a context
0044 //! where they can be shared by several objects
0045 //! contained inside a common data structure.
0046 class Geom2d_AxisPlacement : public Geom2d_Geometry
0047 {
0048 
0049 public:
0050 
0051   
0052   //! Constructs an axis by conversion of the gp_Ax2d axis A.
0053   Standard_EXPORT Geom2d_AxisPlacement(const gp_Ax2d& A);
0054   
0055   //! Constructs an axis from a given origin P and unit vector V.
0056   Standard_EXPORT Geom2d_AxisPlacement(const gp_Pnt2d& P, const gp_Dir2d& V);
0057   
0058   Standard_EXPORT void Reverse();
0059   
0060   //! Reverses the unit vector of this axis.
0061   //! Note:
0062   //! - Reverse assigns the result to this axis, while
0063   //! - Reversed creates a new one.
0064   Standard_NODISCARD Standard_EXPORT Handle(Geom2d_AxisPlacement) Reversed() const;
0065   
0066   //! Changes the complete definition of the axis placement.
0067   Standard_EXPORT void SetAxis (const gp_Ax2d& A);
0068   
0069 
0070   //! Changes the "Direction" of the axis placement.
0071   Standard_EXPORT void SetDirection (const gp_Dir2d& V);
0072   
0073 
0074   //! Changes the "Location" point (origin) of the axis placement.
0075   Standard_EXPORT void SetLocation (const gp_Pnt2d& P);
0076   
0077 
0078   //! Computes the angle between the "Direction" of
0079   //! two axis placement in radians.
0080   //! The result is comprised between -Pi and Pi.
0081   Standard_EXPORT Standard_Real Angle (const Handle(Geom2d_AxisPlacement)& Other) const;
0082   
0083   //! Converts this axis into a gp_Ax2d axis.
0084   Standard_EXPORT gp_Ax2d Ax2d() const;
0085   
0086   //! Returns the "Direction" of <me>.
0087   //! -C++: return const&
0088   Standard_EXPORT gp_Dir2d Direction() const;
0089   
0090 
0091   //! Returns the "Location" point (origin) of the axis placement.
0092   //! -C++: return const&
0093   Standard_EXPORT gp_Pnt2d Location() const;
0094   
0095   //! Applies the transformation T to this axis.
0096   Standard_EXPORT void Transform (const gp_Trsf2d& T) Standard_OVERRIDE;
0097   
0098   //! Creates a new object which is a copy of this axis.
0099   Standard_EXPORT Handle(Geom2d_Geometry) Copy() const Standard_OVERRIDE;
0100 
0101 
0102 
0103 
0104   DEFINE_STANDARD_RTTIEXT(Geom2d_AxisPlacement,Geom2d_Geometry)
0105 
0106 protected:
0107 
0108 
0109 
0110 
0111 private:
0112 
0113 
0114   gp_Ax2d axis;
0115 
0116 
0117 };
0118 
0119 
0120 
0121 
0122 
0123 
0124 
0125 #endif // _Geom2d_AxisPlacement_HeaderFile