1 // Created on: 1993-03-09
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Geom_AxisPlacement_HeaderFile
18 #define _Geom_AxisPlacement_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
24 #include <Geom_Geometry.hxx>
25 #include <Standard_Real.hxx>
26 class Standard_ConstructionError;
32 class Geom_AxisPlacement;
33 DEFINE_STANDARD_HANDLE(Geom_AxisPlacement, Geom_Geometry)
35 //! The abstract class AxisPlacement describes the
36 //! common behavior of positioning systems in 3D space,
37 //! such as axis or coordinate systems.
38 //! The Geom package provides two implementations of
39 //! 3D positioning systems:
40 //! - the axis (Geom_Axis1Placement class), which is defined by:
41 //! - its origin, also termed the "Location point" of the axis,
42 //! - its unit vector, termed the "Direction" or "main
43 //! Direction" of the axis;
44 //! - the right-handed coordinate system
45 //! (Geom_Axis2Placement class), which is defined by:
46 //! - its origin, also termed the "Location point" of the coordinate system,
47 //! - three orthogonal unit vectors, termed
48 //! respectively the "X Direction", the "Y Direction"
49 //! and the "Direction" of the coordinate system. As
50 //! the coordinate system is right-handed, these
51 //! unit vectors have the following relation:
52 //! "Direction" = "X Direction" ^
53 //! "Y Direction". The "Direction" is also
54 //! called the "main Direction" because, when the
55 //! unit vector is modified, the "X Direction" and "Y
56 //! Direction" are recomputed, whereas when the "X
57 //! Direction" or "Y Direction" is modified, the "main Direction" does not change.
58 //! The axis whose origin is the origin of the positioning
59 //! system and whose unit vector is its "main Direction" is
60 //! also called the "Axis" or "main Axis" of the positioning system.
61 class Geom_AxisPlacement : public Geom_Geometry
67 //! Assigns A1 as the "main Axis" of this positioning system. This modifies
69 //! - its "main Direction".
70 //! If this positioning system is a
71 //! Geom_Axis2Placement, then its "X Direction" and
72 //! "Y Direction" are recomputed.
74 //! For a Geom_Axis2Placement:
75 //! Standard_ConstructionError if A1 and the
76 //! previous "X Direction" of the coordinate system are parallel.
77 Standard_EXPORT void SetAxis (const gp_Ax1& A1);
80 //! Changes the direction of the axis placement.
81 //! If <me> is an axis placement two axis the main "Direction"
82 //! is modified and the "XDirection" and "YDirection" are
84 //! Raises ConstructionError only for an axis placement two axis if V and the
85 //! previous "XDirection" are parallel because it is not possible
86 //! to calculate the new "XDirection" and the new "YDirection".
87 Standard_EXPORT virtual void SetDirection (const gp_Dir& V) = 0;
90 //! Assigns the point P as the origin of this positioning system.
91 Standard_EXPORT void SetLocation (const gp_Pnt& P);
93 //! Computes the angular value, in radians, between the
94 //! "main Direction" of this positioning system and that
95 //! of positioning system Other. The result is a value between 0 and Pi.
96 Standard_EXPORT Standard_Real Angle (const Handle(Geom_AxisPlacement)& Other) const;
98 //! Returns the main axis of the axis placement.
99 //! For an "Axis2placement" it is the main axis (Location, Direction ).
100 //! For an "Axis1Placement" this method returns a copy of <me>.
101 Standard_EXPORT const gp_Ax1& Axis() const;
104 //! Returns the main "Direction" of an axis placement.
105 Standard_EXPORT gp_Dir Direction() const;
108 //! Returns the Location point (origin) of the axis placement.
109 Standard_EXPORT gp_Pnt Location() const;
114 DEFINE_STANDARD_RTTIEXT(Geom_AxisPlacement,Geom_Geometry)
135 #endif // _Geom_AxisPlacement_HeaderFile