OpenLexocad
28.0
|
#include <Ax3.h>
Public Member Functions | |
Ax3 () | |
Creates an indefinite coordinate system. More... | |
Ax3 (const Geom::Ax2 &A) | |
Ax3 (const Geom::Pnt &P, const Geom::Dir &N, const Geom::Dir &Vx) | |
Ax3 (const Geom::Pnt &P, const Geom::Dir &V) | |
void | xReverse () |
Reverses the X direction of <me>. More... | |
void | yReverse () |
Reverses the Y direction of <me>. More... | |
void | zReverse () |
Reverses the Z direction of <me>. More... | |
void | setAxis (const Geom::Ax1 &A1) |
void | setDirection (const Geom::Dir &V) |
void | setLocation (const Geom::Pnt &P) |
Changes the "Location" point (origin) of <me>. More... | |
void | setXDirection (const Geom::Dir &Vx) |
void | setYDirection (const Geom::Dir &Vy) |
double | angle (const Ax3 &Other) const |
const Geom::Ax1 & | axis () const |
Geom::Ax2 | axis2 () const |
const Geom::Dir & | direction () const |
Returns the main direction of <me>. More... | |
const Geom::Pnt & | location () const |
Returns the "Location" point (origin) of <me>. More... | |
const Geom::Dir & | xDirection () const |
Returns the "XDirection" of <me>. More... | |
const Geom::Dir & | yDirection () const |
Returns the "YDirection" of <me>. More... | |
bool | direct () const |
bool | isCoplanar (const Ax3 &Other, const double LinearTolerance, const double AngularTolerance) const |
bool | isCoplanar (const Geom::Ax1 &A1, const double LinearTolerance, const double AngularTolerance) const |
void | mirror (const Geom::Pnt &P) |
Ax3 | mirrored (const Geom::Pnt &P) const |
void | mirror (const Geom::Ax1 &A1) |
Ax3 | mirrored (const Geom::Ax1 &A1) const |
void | mirror (const Geom::Ax2 &A2) |
Ax3 | mirrored (const Geom::Ax2 &A2) const |
void | rotate (const Geom::Ax1 &A1, const double Ang) |
Ax3 | rotated (const Geom::Ax1 &A1, const double Ang) const |
void | scale (const Geom::Pnt &P, const double S) |
Ax3 | scaled (const Geom::Pnt &P, const double S) const |
void | transform (const Geom::Trsf &T) |
Ax3 | transformed (const Geom::Trsf &T) const |
void | translate (const Geom::Vec &V) |
Ax3 | translated (const Geom::Vec &V) const |
void | translate (const Geom::Pnt &P1, const Geom::Pnt &P2) |
Ax3 | translated (const Geom::Pnt &P1, const Geom::Pnt &P2) const |
Describes a coordinate system in 3D space. Unlike a
Geom::Ax2 coordinate system, a Ax3 can be
right-handed ("direct sense) or left-handed ("indirect sense").
A coordinate system is defined by:
Geom::Ax3::Ax3 | ( | ) |
Creates an indefinite coordinate system.
Geom::Ax3::Ax3 | ( | const Geom::Ax2 & | A | ) |
Creates a coordinate system from a right-handed
coordinate system.
Creates a right handed axis placement with the
"Location" point P and two directions, N gives the
"Direction" and Vx gives the "XDirection".
Raises ConstructionError if N and Vx are parallel (same or opposite orientation).
Creates an axis placement with the "Location" point
and the normal direction <V>.
double Geom::Ax3::angle | ( | const Ax3 & | Other | ) | const |
Computes the angular value between the main direction of
<me> and the main direction of <Other>. Returns the angle
between 0 and PI in radians.
const Geom::Ax1& Geom::Ax3::axis | ( | ) | const |
Returns the main axis of <me>. It is the "Location" point
and the main "Direction".
Geom::Ax2 Geom::Ax3::axis2 | ( | ) | const |
Computes a right-handed coordinate system with the
same "X Direction" and "Y Direction" as those of this
coordinate system, then recomputes the "main Direction".
If this coordinate system is right-handed, the result
returned is the same coordinate system. If this
coordinate system is left-handed, the result is reversed.
bool Geom::Ax3::direct | ( | ) | const |
Returns True if the coordinate system is right-handed. i.e.
XDirection().Crossed(YDirection()).Dot(Direction()) > 0
const Geom::Dir& Geom::Ax3::direction | ( | ) | const |
Returns the main direction of <me>.
bool Geom::Ax3::isCoplanar | ( | const Ax3 & | Other, |
const double | LinearTolerance, | ||
const double | AngularTolerance | ||
) | const |
Returns True if
. the distance between the "Location" point of <me> and
<Other> is lower or equal to LinearTolerance and
. the distance between the "Location" point of <Other> and
<me> is lower or equal to LinearTolerance and
. the main direction of <me> and the main direction of
<Other> are parallel (same or opposite orientation).
bool Geom::Ax3::isCoplanar | ( | const Geom::Ax1 & | A1, |
const double | LinearTolerance, | ||
const double | AngularTolerance | ||
) | const |
Returns True if
. the distance between <me> and the "Location" point of A1
is lower of equal to LinearTolerance and
. the distance between A1 and the "Location" point of <me>
is lower or equal to LinearTolerance and
. the main direction of <me> and the direction of A1 are normal.
const Geom::Pnt& Geom::Ax3::location | ( | ) | const |
Returns the "Location" point (origin) of <me>.
void Geom::Ax3::mirror | ( | const Geom::Ax1 & | A1 | ) |
void Geom::Ax3::mirror | ( | const Geom::Ax2 & | A2 | ) |
void Geom::Ax3::mirror | ( | const Geom::Pnt & | P | ) |
Performs the symmetrical transformation of an axis
placement with respect to an axis placement which
is the axis of the symmetry.
The transformation is performed on the "Location"
point, on the "XDirection" and "YDirection".
The resulting main "Direction" is the cross product between
the "XDirection" and the "YDirection" after transformation.
Performs the symmetrical transformation of an axis
placement with respect to a plane.
The axis placement <A2> locates the plane of the symmetry :
(Location, XDirection, YDirection).
The transformation is performed on the "Location"
point, on the "XDirection" and "YDirection".
The resulting main "Direction" is the cross product between
the "XDirection" and the "YDirection" after transformation.
Performs the symmetrical transformation of an axis
placement with respect to the point P which is the
center of the symmetry.
Warnings :
The main direction of the axis placement is not changed.
The "XDirection" and the "YDirection" are reversed.
So the axis placement stay right handed.
void Geom::Ax3::rotate | ( | const Geom::Ax1 & | A1, |
const double | Ang | ||
) |
Rotates an axis placement. <A1> is the axis of the
rotation . Ang is the angular value of the rotation
in radians.
void Geom::Ax3::scale | ( | const Geom::Pnt & | P, |
const double | S | ||
) |
Applies a scaling transformation on the axis placement.
The "Location" point of the axisplacement is modified.
Warnings :
If the scale is negative :
. the main direction of the axis placement is not changed.
. The "XDirection" and the "YDirection" are reversed.
So the axis placement stay right handed.
void Geom::Ax3::setAxis | ( | const Geom::Ax1 & | A1 | ) |
Assigns the origin and "main Direction" of the axis A1 to
this coordinate system, then recomputes its "X Direction" and "Y Direction".
Note:
void Geom::Ax3::setDirection | ( | const Geom::Dir & | V | ) |
Changes the main direction of this coordinate system,
then recomputes its "X Direction" and "Y Direction".
Note:
void Geom::Ax3::setLocation | ( | const Geom::Pnt & | P | ) |
Changes the "Location" point (origin) of <me>.
void Geom::Ax3::setXDirection | ( | const Geom::Dir & | Vx | ) |
Changes the "Xdirection" of <me>. The main direction
"Direction" is not modified, the "Ydirection" is modified.
If <Vx> is not normal to the main direction then <XDirection>
is computed as follows XDirection = Direction ^ (Vx ^ Direction).
Raises ConstructionError if <Vx> is parallel (same or opposite
orientation) to the main direction of <me>
void Geom::Ax3::setYDirection | ( | const Geom::Dir & | Vy | ) |
Changes the "Ydirection" of <me>. The main direction is not
modified but the "Xdirection" is changed.
If <Vy> is not normal to the main direction then "YDirection"
is computed as follows
YDirection = Direction ^ (<Vy> ^ Direction).
Raises ConstructionError if <Vy> is parallel to the main direction of <me>
void Geom::Ax3::transform | ( | const Geom::Trsf & | T | ) |
Ax3 Geom::Ax3::transformed | ( | const Geom::Trsf & | T | ) | const |
Transforms an axis placement with a Trsf.
The "Location" point, the "XDirection" and the
"YDirection" are transformed with T. The resulting
main "Direction" of <me> is the cross product between
the "XDirection" and the "YDirection" after transformation.
void Geom::Ax3::translate | ( | const Geom::Vec & | V | ) |
Translates an axis placement from the point <P1> to the
point <P2>.
Translates an axis plaxement in the direction of the vector
<V>. The magnitude of the translation is the vector's magnitude.
const Geom::Dir& Geom::Ax3::xDirection | ( | ) | const |
Returns the "XDirection" of <me>.
void Geom::Ax3::xReverse | ( | ) |
Reverses the X direction of <me>.
const Geom::Dir& Geom::Ax3::yDirection | ( | ) | const |
Returns the "YDirection" of <me>.
void Geom::Ax3::yReverse | ( | ) |
Reverses the Y direction of <me>.
void Geom::Ax3::zReverse | ( | ) |
Reverses the Z direction of <me>.