|
||||
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_Axis2Placement_HeaderFile 0018 #define _Geom_Axis2Placement_HeaderFile 0019 0020 #include <Standard.hxx> 0021 0022 #include <Geom_AxisPlacement.hxx> 0023 class gp_Ax2; 0024 class gp_Pnt; 0025 class gp_Trsf; 0026 class Geom_Geometry; 0027 0028 0029 class Geom_Axis2Placement; 0030 DEFINE_STANDARD_HANDLE(Geom_Axis2Placement, Geom_AxisPlacement) 0031 0032 //! Describes a right-handed coordinate system in 3D space. 0033 //! A coordinate system is defined by: 0034 //! - its origin, also termed the "Location point" of the coordinate system, 0035 //! - three orthogonal unit vectors, termed respectively 0036 //! the "X Direction", "Y Direction" and "Direction" (or 0037 //! "main Direction") of the coordinate system. 0038 //! As a Geom_Axis2Placement coordinate system is 0039 //! right-handed, its "Direction" is always equal to the 0040 //! cross product of its "X Direction" and "Y Direction". 0041 //! The "Direction" of a coordinate system is called the 0042 //! "main Direction" because when this unit vector is 0043 //! modified, the "X Direction" and "Y Direction" are 0044 //! recomputed, whereas when the "X Direction" or "Y 0045 //! Direction" is changed, the "main Direction" is 0046 //! retained. The "main Direction" is also the "Z Direction". 0047 //! Note: Geom_Axis2Placement coordinate systems 0048 //! provide the same kind of "geometric" services as 0049 //! gp_Ax2 coordinate systems but have more complex 0050 //! data structures. The geometric objects provided by 0051 //! the Geom package use gp_Ax2 objects to include 0052 //! coordinate systems in their data structures, or to 0053 //! define the geometric transformations, which are applied to them. 0054 //! Geom_Axis2Placement coordinate systems are 0055 //! used in a context where they can be shared by 0056 //! several objects contained inside a common data structure. 0057 class Geom_Axis2Placement : public Geom_AxisPlacement 0058 { 0059 0060 public: 0061 0062 0063 //! Returns a transient copy of A2. 0064 Standard_EXPORT Geom_Axis2Placement(const gp_Ax2& A2); 0065 0066 0067 //! P is the origin of the axis placement, N is the main 0068 //! direction of the axis placement and Vx is the "XDirection". 0069 //! If the two directions N and Vx are not orthogonal the 0070 //! "XDirection" is computed as follow : 0071 //! XDirection = N ^ (Vx ^ N). 0072 //! Raised if N and Vx are parallel. 0073 Standard_EXPORT Geom_Axis2Placement(const gp_Pnt& P, const gp_Dir& N, const gp_Dir& Vx); 0074 0075 //! Assigns the origin and the three unit vectors of A2 to 0076 //! this coordinate system. 0077 Standard_EXPORT void SetAx2 (const gp_Ax2& A2); 0078 0079 0080 //! Changes the main direction of the axis placement. 0081 //! The "Xdirection" is modified : 0082 //! New XDirection = V ^ (Previous_Xdirection ^ V). 0083 //! 0084 //! Raised if V and the previous "XDirection" are parallel 0085 //! because it is impossible to calculate the new "XDirection" 0086 //! and the new "YDirection". 0087 Standard_EXPORT void SetDirection (const gp_Dir& V) Standard_OVERRIDE; 0088 0089 0090 //! Changes the "XDirection" of the axis placement, Vx is the 0091 //! new "XDirection". If Vx is not normal to the main direction 0092 //! then "XDirection" is computed as follow : 0093 //! XDirection = Direction ^ ( Vx ^ Direction). 0094 //! The main direction is not modified. 0095 //! Raised if Vx and "Direction" are parallel. 0096 Standard_EXPORT void SetXDirection (const gp_Dir& Vx); 0097 0098 0099 //! Changes the "YDirection" of the axis placement, Vy is the 0100 //! new "YDirection". If Vy is not normal to the main direction 0101 //! then "YDirection" is computed as follow : 0102 //! YDirection = Direction ^ ( Vy ^ Direction). 0103 //! The main direction is not modified. The "XDirection" is 0104 //! modified. 0105 //! Raised if Vy and the main direction are parallel. 0106 Standard_EXPORT void SetYDirection (const gp_Dir& Vy); 0107 0108 //! Returns a non transient copy of <me>. 0109 Standard_EXPORT gp_Ax2 Ax2() const; 0110 0111 //! Returns the "XDirection". This is a unit vector. 0112 Standard_EXPORT const gp_Dir& XDirection() const; 0113 0114 //! Returns the "YDirection". This is a unit vector. 0115 Standard_EXPORT const gp_Dir& YDirection() const; 0116 0117 0118 //! Transforms an axis placement with a Trsf. 0119 //! The "Location" point, the "XDirection" and the 0120 //! "YDirection" are transformed with T. The resulting 0121 //! main "Direction" of <me> is the cross product between 0122 //! the "XDirection" and the "YDirection" after transformation. 0123 Standard_EXPORT void Transform (const gp_Trsf& T) Standard_OVERRIDE; 0124 0125 //! Creates a new object which is a copy of this coordinate system. 0126 Standard_EXPORT Handle(Geom_Geometry) Copy() const Standard_OVERRIDE; 0127 0128 0129 0130 0131 DEFINE_STANDARD_RTTIEXT(Geom_Axis2Placement,Geom_AxisPlacement) 0132 0133 protected: 0134 0135 0136 0137 0138 private: 0139 0140 0141 Standard_EXPORT Geom_Axis2Placement(const gp_Pnt& P, const gp_Dir& Vz, const gp_Dir& Vx, const gp_Dir& Vy); 0142 0143 gp_Dir vxdir; 0144 gp_Dir vydir; 0145 0146 0147 }; 0148 0149 0150 0151 0152 0153 0154 0155 #endif // _Geom_Axis2Placement_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |