Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/Geom2d_AxisPlacement.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 //! Describes an axis in 2D space.
0030 //! An axis is defined by:
0031 //! - its origin, also termed the "Location point" of the axis,
0032 //! - its unit vector, termed the "Direction" of the axis.
0033 //! Note: Geom2d_AxisPlacement axes provide the
0034 //! same kind of "geometric" services as gp_Ax2d axes
0035 //! but have more complex data structures. The
0036 //! geometric objects provided by the Geom2d package
0037 //! use gp_Ax2d objects to include axes in their data
0038 //! structures, or to define an axis of symmetry or axis of rotation.
0039 //! Geom2d_AxisPlacement axes are used in a context
0040 //! where they can be shared by several objects
0041 //! contained inside a common data structure.
0042 class Geom2d_AxisPlacement : public Geom2d_Geometry
0043 {
0044 
0045 public:
0046   //! Constructs an axis by conversion of the gp_Ax2d axis A.
0047   Standard_EXPORT Geom2d_AxisPlacement(const gp_Ax2d& A);
0048 
0049   //! Constructs an axis from a given origin P and unit vector V.
0050   Standard_EXPORT Geom2d_AxisPlacement(const gp_Pnt2d& P, const gp_Dir2d& V);
0051 
0052   Standard_EXPORT void Reverse();
0053 
0054   //! Reverses the unit vector of this axis.
0055   //! Note:
0056   //! - Reverse assigns the result to this axis, while
0057   //! - Reversed creates a new one.
0058   [[nodiscard]] Standard_EXPORT occ::handle<Geom2d_AxisPlacement> Reversed() const;
0059 
0060   //! Changes the complete definition of the axis placement.
0061   Standard_EXPORT void SetAxis(const gp_Ax2d& A);
0062 
0063   //! Changes the "Direction" of the axis placement.
0064   Standard_EXPORT void SetDirection(const gp_Dir2d& V);
0065 
0066   //! Changes the "Location" point (origin) of the axis placement.
0067   Standard_EXPORT void SetLocation(const gp_Pnt2d& P);
0068 
0069   //! Computes the angle between the "Direction" of
0070   //! two axis placement in radians.
0071   //! The result is comprised between -Pi and Pi.
0072   Standard_EXPORT double Angle(const occ::handle<Geom2d_AxisPlacement>& Other) const;
0073 
0074   //! Converts this axis into a gp_Ax2d axis.
0075   Standard_EXPORT gp_Ax2d Ax2d() const;
0076 
0077   //! Returns the "Direction" of <me>.
0078   //! -C++: return const&
0079   Standard_EXPORT gp_Dir2d Direction() const;
0080 
0081   //! Returns the "Location" point (origin) of the axis placement.
0082   //! -C++: return const&
0083   Standard_EXPORT gp_Pnt2d Location() const;
0084 
0085   //! Applies the transformation T to this axis.
0086   Standard_EXPORT void Transform(const gp_Trsf2d& T) override;
0087 
0088   //! Creates a new object which is a copy of this axis.
0089   Standard_EXPORT occ::handle<Geom2d_Geometry> Copy() const override;
0090 
0091   DEFINE_STANDARD_RTTIEXT(Geom2d_AxisPlacement, Geom2d_Geometry)
0092 
0093 private:
0094   gp_Ax2d axis;
0095 };
0096 
0097 #endif // _Geom2d_AxisPlacement_HeaderFile