Open CASCADE Technology 7.8.2.dev
gp_Sphere Class Reference

Describes a sphere. A sphere is defined by its radius and positioned in space with a coordinate system (a gp_Ax3 object). The origin of the coordinate system is the center of the sphere. This coordinate system is the "local coordinate system" of the sphere. Note: when a gp_Sphere sphere is converted into a Geom_SphericalSurface sphere, some implicit properties of its local coordinate system are used explicitly: More...

#include <gp_Sphere.hxx>

Public Member Functions

 gp_Sphere ()
 Creates an indefinite sphere.
 
 gp_Sphere (const gp_Ax3 &theA3, const Standard_Real theRadius)
 Constructs a sphere with radius theRadius, centered on the origin of theA3. theA3 is the local coordinate system of the sphere. Warnings : It is not forbidden to create a sphere with null radius. Raises ConstructionError if theRadius < 0.0.
 
void SetLocation (const gp_Pnt &theLoc)
 Changes the center of the sphere.
 
void SetPosition (const gp_Ax3 &theA3)
 Changes the local coordinate system of the sphere.
 
void SetRadius (const Standard_Real theR)
 Assigns theR the radius of the Sphere. Warnings : It is not forbidden to create a sphere with null radius. Raises ConstructionError if theR < 0.0.
 
Standard_Real Area () const
 Computes the area of the sphere.
 
void Coefficients (Standard_Real &theA1, Standard_Real &theA2, Standard_Real &theA3, Standard_Real &theB1, Standard_Real &theB2, Standard_Real &theB3, Standard_Real &theC1, Standard_Real &theC2, Standard_Real &theC3, Standard_Real &theD) const
 Computes the coefficients of the implicit equation of the quadric in the absolute cartesian coordinates system :
 
void UReverse ()
 Reverses the U parametrization of the sphere reversing the YAxis.
 
void VReverse ()
 Reverses the V parametrization of the sphere reversing the ZAxis.
 
Standard_Boolean Direct () const
 Returns true if the local coordinate system of this sphere is right-handed.
 
const gp_PntLocation () const
 — Purpose ; Returns the center of the sphere.
 
const gp_Ax3Position () const
 Returns the local coordinates system of the sphere.
 
Standard_Real Radius () const
 Returns the radius of the sphere.
 
Standard_Real Volume () const
 Computes the volume of the sphere.
 
gp_Ax1 XAxis () const
 Returns the axis X of the sphere.
 
gp_Ax1 YAxis () const
 Returns the axis Y of the sphere.
 
void Mirror (const gp_Pnt &theP)
 
gp_Sphere Mirrored (const gp_Pnt &theP) const
 Performs the symmetrical transformation of a sphere with respect to the point theP which is the center of the symmetry.
 
void Mirror (const gp_Ax1 &theA1)
 
gp_Sphere Mirrored (const gp_Ax1 &theA1) const
 Performs the symmetrical transformation of a sphere with respect to an axis placement which is the axis of the symmetry.
 
void Mirror (const gp_Ax2 &theA2)
 
gp_Sphere Mirrored (const gp_Ax2 &theA2) const
 Performs the symmetrical transformation of a sphere with respect to a plane. The axis placement theA2 locates the plane of the of the symmetry : (Location, XDirection, YDirection).
 
void Rotate (const gp_Ax1 &theA1, const Standard_Real theAng)
 
gp_Sphere Rotated (const gp_Ax1 &theA1, const Standard_Real theAng) const
 Rotates a sphere. theA1 is the axis of the rotation. theAng is the angular value of the rotation in radians.
 
void Scale (const gp_Pnt &theP, const Standard_Real theS)
 
gp_Sphere Scaled (const gp_Pnt &theP, const Standard_Real theS) const
 Scales a sphere. theS is the scaling value. The absolute value of S is used to scale the sphere.
 
void Transform (const gp_Trsf &theT)
 
gp_Sphere Transformed (const gp_Trsf &theT) const
 Transforms a sphere with the transformation theT from class Trsf.
 
void Translate (const gp_Vec &theV)
 
gp_Sphere Translated (const gp_Vec &theV) const
 Translates a sphere in the direction of the vector theV. The magnitude of the translation is the vector's magnitude.
 
void Translate (const gp_Pnt &theP1, const gp_Pnt &theP2)
 
gp_Sphere Translated (const gp_Pnt &theP1, const gp_Pnt &theP2) const
 Translates a sphere from the point theP1 to the point theP2.
 

Detailed Description

Describes a sphere. A sphere is defined by its radius and positioned in space with a coordinate system (a gp_Ax3 object). The origin of the coordinate system is the center of the sphere. This coordinate system is the "local coordinate system" of the sphere. Note: when a gp_Sphere sphere is converted into a Geom_SphericalSurface sphere, some implicit properties of its local coordinate system are used explicitly:

  • its origin, "X Direction", "Y Direction" and "main Direction" are used directly to define the parametric directions on the sphere and the origin of the parameters,
  • its implicit orientation (right-handed or left-handed) gives the orientation (direct, indirect) to the Geom_SphericalSurface sphere. See Also gce_MakeSphere which provides functions for more complex sphere constructions Geom_SphericalSurface which provides additional functions for constructing spheres and works, in particular, with the parametric equations of spheres.

Constructor & Destructor Documentation

◆ gp_Sphere() [1/2]

gp_Sphere::gp_Sphere ( )
inline

Creates an indefinite sphere.

◆ gp_Sphere() [2/2]

gp_Sphere::gp_Sphere ( const gp_Ax3 & theA3,
const Standard_Real theRadius )
inline

Constructs a sphere with radius theRadius, centered on the origin of theA3. theA3 is the local coordinate system of the sphere. Warnings : It is not forbidden to create a sphere with null radius. Raises ConstructionError if theRadius < 0.0.

Member Function Documentation

◆ Area()

Standard_Real gp_Sphere::Area ( ) const
inline

Computes the area of the sphere.

◆ Coefficients()

void gp_Sphere::Coefficients ( Standard_Real & theA1,
Standard_Real & theA2,
Standard_Real & theA3,
Standard_Real & theB1,
Standard_Real & theB2,
Standard_Real & theB3,
Standard_Real & theC1,
Standard_Real & theC2,
Standard_Real & theC3,
Standard_Real & theD ) const

Computes the coefficients of the implicit equation of the quadric in the absolute cartesian coordinates system :

theA1.X**2 + theA2.Y**2 + theA3.Z**2 + 2.(theB1.X.Y + theB2.X.Z + theB3.Y.Z) +
2.(theC1.X + theC2.Y + theC3.Z) + theD = 0.0

◆ Direct()

Standard_Boolean gp_Sphere::Direct ( ) const
inline

Returns true if the local coordinate system of this sphere is right-handed.

◆ Location()

const gp_Pnt & gp_Sphere::Location ( ) const
inline

— Purpose ; Returns the center of the sphere.

◆ Mirror() [1/3]

void gp_Sphere::Mirror ( const gp_Ax1 & theA1)

◆ Mirror() [2/3]

void gp_Sphere::Mirror ( const gp_Ax2 & theA2)

◆ Mirror() [3/3]

void gp_Sphere::Mirror ( const gp_Pnt & theP)

◆ Mirrored() [1/3]

gp_Sphere gp_Sphere::Mirrored ( const gp_Ax1 & theA1) const

Performs the symmetrical transformation of a sphere with respect to an axis placement which is the axis of the symmetry.

◆ Mirrored() [2/3]

gp_Sphere gp_Sphere::Mirrored ( const gp_Ax2 & theA2) const

Performs the symmetrical transformation of a sphere with respect to a plane. The axis placement theA2 locates the plane of the of the symmetry : (Location, XDirection, YDirection).

◆ Mirrored() [3/3]

gp_Sphere gp_Sphere::Mirrored ( const gp_Pnt & theP) const

Performs the symmetrical transformation of a sphere with respect to the point theP which is the center of the symmetry.

◆ Position()

const gp_Ax3 & gp_Sphere::Position ( ) const
inline

Returns the local coordinates system of the sphere.

◆ Radius()

Standard_Real gp_Sphere::Radius ( ) const
inline

Returns the radius of the sphere.

◆ Rotate()

void gp_Sphere::Rotate ( const gp_Ax1 & theA1,
const Standard_Real theAng )
inline

◆ Rotated()

gp_Sphere gp_Sphere::Rotated ( const gp_Ax1 & theA1,
const Standard_Real theAng ) const
inline

Rotates a sphere. theA1 is the axis of the rotation. theAng is the angular value of the rotation in radians.

◆ Scale()

void gp_Sphere::Scale ( const gp_Pnt & theP,
const Standard_Real theS )
inline

◆ Scaled()

gp_Sphere gp_Sphere::Scaled ( const gp_Pnt & theP,
const Standard_Real theS ) const
inline

Scales a sphere. theS is the scaling value. The absolute value of S is used to scale the sphere.

◆ SetLocation()

void gp_Sphere::SetLocation ( const gp_Pnt & theLoc)
inline

Changes the center of the sphere.

◆ SetPosition()

void gp_Sphere::SetPosition ( const gp_Ax3 & theA3)
inline

Changes the local coordinate system of the sphere.

◆ SetRadius()

void gp_Sphere::SetRadius ( const Standard_Real theR)
inline

Assigns theR the radius of the Sphere. Warnings : It is not forbidden to create a sphere with null radius. Raises ConstructionError if theR < 0.0.

◆ Transform()

void gp_Sphere::Transform ( const gp_Trsf & theT)
inline

◆ Transformed()

gp_Sphere gp_Sphere::Transformed ( const gp_Trsf & theT) const
inline

Transforms a sphere with the transformation theT from class Trsf.

◆ Translate() [1/2]

void gp_Sphere::Translate ( const gp_Pnt & theP1,
const gp_Pnt & theP2 )
inline

◆ Translate() [2/2]

void gp_Sphere::Translate ( const gp_Vec & theV)
inline

◆ Translated() [1/2]

gp_Sphere gp_Sphere::Translated ( const gp_Pnt & theP1,
const gp_Pnt & theP2 ) const
inline

Translates a sphere from the point theP1 to the point theP2.

◆ Translated() [2/2]

gp_Sphere gp_Sphere::Translated ( const gp_Vec & theV) const
inline

Translates a sphere in the direction of the vector theV. The magnitude of the translation is the vector's magnitude.

◆ UReverse()

void gp_Sphere::UReverse ( )
inline

Reverses the U parametrization of the sphere reversing the YAxis.

◆ Volume()

Standard_Real gp_Sphere::Volume ( ) const
inline

Computes the volume of the sphere.

◆ VReverse()

void gp_Sphere::VReverse ( )
inline

Reverses the V parametrization of the sphere reversing the ZAxis.

◆ XAxis()

gp_Ax1 gp_Sphere::XAxis ( ) const
inline

Returns the axis X of the sphere.

◆ YAxis()

gp_Ax1 gp_Sphere::YAxis ( ) const
inline

Returns the axis Y of the sphere.


The documentation for this class was generated from the following file: