Back to home page

EIC code displayed by LXR

 
 

    


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

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