Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-25 10:08:51

0001 // Created on: 1993-03-09
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 _Geom_AxisPlacement_HeaderFile
0018 #define _Geom_AxisPlacement_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <gp_Ax1.hxx>
0023 #include <Geom_Geometry.hxx>
0024 #include <Standard_Real.hxx>
0025 class gp_Dir;
0026 class gp_Pnt;
0027 
0028 //! The abstract class AxisPlacement describes the
0029 //! common behavior of positioning systems in 3D space,
0030 //! such as axis or coordinate systems.
0031 //! The Geom package provides two implementations of
0032 //! 3D positioning systems:
0033 //! - the axis (Geom_Axis1Placement class), which is defined by:
0034 //! - its origin, also termed the "Location point" of the axis,
0035 //! - its unit vector, termed the "Direction" or "main
0036 //! Direction" of the axis;
0037 //! - the right-handed coordinate system
0038 //! (Geom_Axis2Placement class), which is defined by:
0039 //! - its origin, also termed the "Location point" of the coordinate system,
0040 //! - three orthogonal unit vectors, termed
0041 //! respectively the "X Direction", the "Y Direction"
0042 //! and the "Direction" of the coordinate system. As
0043 //! the coordinate system is right-handed, these
0044 //! unit vectors have the following relation:
0045 //! "Direction" = "X Direction" ^
0046 //! "Y Direction". The "Direction" is also
0047 //! called the "main Direction" because, when the
0048 //! unit vector is modified, the "X Direction" and "Y
0049 //! Direction" are recomputed, whereas when the "X
0050 //! Direction" or "Y Direction" is modified, the "main Direction" does not change.
0051 //! The axis whose origin is the origin of the positioning
0052 //! system and whose unit vector is its "main Direction" is
0053 //! also called the "Axis" or "main Axis" of the positioning system.
0054 class Geom_AxisPlacement : public Geom_Geometry
0055 {
0056 
0057 public:
0058   //! Assigns A1 as the "main Axis" of this positioning system. This modifies
0059   //! - its origin, and
0060   //! - its "main Direction".
0061   //! If this positioning system is a
0062   //! Geom_Axis2Placement, then its "X Direction" and
0063   //! "Y Direction" are recomputed.
0064   //! Exceptions
0065   //! For a Geom_Axis2Placement:
0066   //! Standard_ConstructionError if A1 and the
0067   //! previous "X Direction" of the coordinate system are parallel.
0068   Standard_EXPORT void SetAxis(const gp_Ax1& A1);
0069 
0070   //! Changes the direction of the axis placement.
0071   //! If <me> is an axis placement two axis the main "Direction"
0072   //! is modified and the "XDirection" and "YDirection" are
0073   //! recomputed.
0074   //! Raises ConstructionError only for an axis placement two axis if V and the
0075   //! previous "XDirection" are parallel because it is not possible
0076   //! to calculate the new "XDirection" and the new "YDirection".
0077   Standard_EXPORT virtual void SetDirection(const gp_Dir& V) = 0;
0078 
0079   //! Assigns the point P as the origin of this positioning system.
0080   Standard_EXPORT void SetLocation(const gp_Pnt& P);
0081 
0082   //! Computes the angular value, in radians, between the
0083   //! "main Direction" of this positioning system and that
0084   //! of positioning system Other. The result is a value between 0 and Pi.
0085   Standard_EXPORT double Angle(const occ::handle<Geom_AxisPlacement>& Other) const;
0086 
0087   //! Returns the main axis of the axis placement.
0088   //! For an "Axis2placement" it is the main axis (Location, Direction ).
0089   //! For an "Axis1Placement" this method returns a copy of <me>.
0090   Standard_EXPORT const gp_Ax1& Axis() const;
0091 
0092   //! Returns the main "Direction" of an axis placement.
0093   Standard_EXPORT gp_Dir Direction() const;
0094 
0095   //! Returns the Location point (origin) of the axis placement.
0096   Standard_EXPORT gp_Pnt Location() const;
0097 
0098   DEFINE_STANDARD_RTTIEXT(Geom_AxisPlacement, Geom_Geometry)
0099 
0100 protected:
0101   gp_Ax1 axis;
0102 };
0103 
0104 #endif // _Geom_AxisPlacement_HeaderFile