Public Member Functions | Static Public Member Functions | Public Attributes | List of all members

A DgnSphereDetail represents an ellipsoid, possibly truncated on two planes parallel to the equator. More...

#include <SolidPrimitive.h>

Public Member Functions

 DgnSphereDetail (DPoint3dCR center, DVec3dCR vectorX, DVec3dCR vectorZ, double radiusXY, double radiusZ, double startLatitude, double latitudeSweep, bool capped)
 Detail consructor with complete field list as parameters ... More...
 
 DgnSphereDetail (DPoint3dCR center, RotMatrixCR axes, double radius)
 Detail consructor for complete true sphere. More...
 
 DgnSphereDetail (DPoint3dCR center, double radius)
 Detail constructor for complete true sphere. More...
 
 DgnSphereDetail ()
 Default value constructor. More...
 
bool GetRange (DRange3dR range) const
 Return range. More...
 
bool GetRange (DRange3dR range, TransformCR transform) const
 Return range when transformed. More...
 
bool TryGetConstructiveFrame (TransformR localToWorld, TransformR worldToLocal) const
 Return coordinate system with 1) XY plane in equatorial plane, origin at sphere center. More...
 
bool IsSameStructure (ISolidPrimitiveCR other) const
 Test for same type and structure (but no coordinate comparison) More...
 
bool IsSameStructureAndGeometry (ISolidPrimitiveCR other, double tolerance) const
 Test for same type, structure and coordinates. More...
 
bool IsClosedVolume () const
 Test if this is a closed volume. More...
 
double ParameterizationSign () const
 Return +1 or -1 that matches the volume sign after integration over the parameter space. More...
 
bool IsTrueSphere (DPoint3dR center, RotMatrixR axes, double &radius) const
 Return true (with supporting data) iff this is a (complete) true sphere. More...
 
bool IsReverseOrientation ()
 Return true if the tracing the parameterization produces reverse (inward facing) orientation. More...
 
bool IsTrueRotationAroundZ (DPoint3dR center, DVec3dR unitX, DVec3dR unitY, DVec3dR unitZ, double &equatorRadius, double &poleRadius) const
 Return true (with supporting local coordinate frame) iff this is a rotation around the Z axis. More...
 
bool GetSweepLimits (double &latitude0, double &latitude1, double &z0, double &z1, bool forceSweepNorth=false) const
 
bool IsRealCap (int select01) const
 Test if caps are active and the indicated cap is not at a pole. More...
 
double LatitudeToVFraction (double latitude) const
 Compute the v fraction of latitude. More...
 
double LongitudeToUFraction (double longitude) const
 Compute the u fraction of longitude. More...
 
double VFractionToLatitude (double v) const
 Compute the latitude at v fraction. More...
 
bool GetTransforms (TransformR localToWorld, TransformR worldToLocal) const
 Return transforms for unit-axis system. More...
 
bool GetNonUniformTransforms (TransformR localToWorld, TransformR worldToLocal) const
 Return (nonuniform) transforms for normalized system where sphere radius is 1. More...
 
bool TryGetRotationAxis (DPoint3dR center, DVec3dR axis, double &sweepRadians) const
 
DEllipse3d UFractionToVSectionDEllipse3d (double fraction) const
 Return the ellipse on the meridian at fractional position. More...
 
DEllipse3d VFractionToUSectionDEllipse3d (double fraction) const
 Return the ellipse on the parallel at fractional position. More...
 
void AddRayIntersections (bvector< SolidLocationDetail > &pickData, DRay3dCR ray, int parentId, double minParameter) const
 Compute intersections with a ray and add to the pickData. More...
 
void AddCurveIntersections (CurveVectorCR curves, bvector< CurveLocationDetail > &curvePoints, bvector< SolidLocationDetail > &solidPoints, MeshAnnotationVector &messages) const
 Compute intersections with curves and add to the data array. More...
 
void AddCurveIntersections (ICurvePrimitiveCR curves, bvector< CurveLocationDetail > &curvePoints, bvector< SolidLocationDetail > &solidPoints, MeshAnnotationVector &messages) const
 Compute intersections with a single curve and add to the data array. More...
 
bool ClosestPoint (DPoint3dCR spacePoint, SolidLocationDetail &pickDetail) const
 
bool TryUVFractionToXYZ (SolidLocationDetail::FaceIndices const &faceIndices, double uFraction, double vFraction, DPoint3dR xyz, DVec3dR dXdu, DVec3dR dXdv) const
 convert u,v fraction on specified face to xyz and derivatives. More...
 
IGeometryPtr GetFace (SolidLocationDetail::FaceIndices const &indices) const
 Return a single face of the solid primitive. More...
 
void GetFaceIndices (bvector< SolidLocationDetail::FaceIndices > &indices) const
 Fill a list of all possible face indices. More...
 
ICurvePrimitivePtr GetConstantVSection (SolidLocationDetail::FaceIndices const &indices, double fraction) const
 Copy a section curve at constant v of a single face to a single ICurvePrimitive. More...
 
ICurvePrimitivePtr GetConstantUSection (SolidLocationDetail::FaceIndices const &indices, double fraction) const
 Copy a section at constant u of a single face to a single ICurvePrimitive. More...
 
bool TryGetMaxUVLength (SolidLocationDetail::FaceIndices const &indices, DVec2dR uvLength) const
 Compute the lengths of the longest u and v direction sections of a single face of a solid primitive. More...
 
ISolidPrimitivePtr Clone () const
 Copy to a new (allocated) solid primitive. More...
 
bool TransformInPlace (TransformCR transform)
 Transform in place. More...
 
bool ComputeSecondMomentAreaProducts (TransformR localToWorld, DMatrix4dR localProducts) const
 Return the various integrated products for area moment calculations. More...
 
bool ComputeSecondMomentVolumeProducts (TransformR localToWorld, DMatrix4dR localProducts) const
 Return the various integrated products for moment calculations. More...
 
void IntersectBoundedArc (DEllipse3dCR arc, bvector< double > &arcFractions, bvector< DPoint3d > &normalizedConePoints, TransformR localToWorld, TransformR worldToLocal, bool boundedZ) const
 Return all intersection points of an (unbounded) arc with the sphere. More...
 

Static Public Member Functions

static void SetDetailUVFromUnitSphereCoordinates (SolidLocationDetail &detail, DPoint3dCR localuvw, TransformCR localToWorld, double startLatitude, double sweepLatitude)
 set point, uv coordinates, and uv derivatives vectors More...
 

Public Attributes

Transform m_localToWorld
 
double m_startLatitude
 
double m_latitudeSweep
 
bool m_capped
 

Detailed Description

A DgnSphereDetail represents an ellipsoid, possibly truncated on two planes parallel to the equator.

Constructor & Destructor Documentation

DgnSphereDetail ( DPoint3dCR  center,
DVec3dCR  vectorX,
DVec3dCR  vectorZ,
double  radiusXY,
double  radiusZ,
double  startLatitude,
double  latitudeSweep,
bool  capped 
)

Detail consructor with complete field list as parameters ...

Parameters
[in]centerSphere center
[in]vectorXX vector of base plane
[in]vectorZVector towards north pole
[in]radiusXYx and y radius (equator circle)
[in]radiusZnorth pole radius.
[in]startLatitudelatitude for truncation plane parallel to the equator
[in]latitudeSweeplatitude difference from start truncation plane to end truncation plane
[in]cappedcap flag, applicable for partial latitude range
DgnSphereDetail ( DPoint3dCR  center,
RotMatrixCR  axes,
double  radius 
)

Detail consructor for complete true sphere.

Parameters
[in]centerSphere center
[in]axesx,y,z axes
[in]radiusradius
DgnSphereDetail ( DPoint3dCR  center,
double  radius 
)

Detail constructor for complete true sphere.

Parameters
[in]centerSphere center
[in]radiusradius

Default value constructor.

Member Function Documentation

void AddCurveIntersections ( CurveVectorCR  curves,
bvector< CurveLocationDetail > &  curvePoints,
bvector< SolidLocationDetail > &  solidPoints,
MeshAnnotationVector &  messages 
) const

Compute intersections with curves and add to the data array.

Parameters
[in]curves
[in,out]curvePointsgrowing array of curve points.
[in,out]solidPointsgrowing array of solid points.
[in,out]messagesarray of error messages
void AddCurveIntersections ( ICurvePrimitiveCR  curves,
bvector< CurveLocationDetail > &  curvePoints,
bvector< SolidLocationDetail > &  solidPoints,
MeshAnnotationVector &  messages 
) const

Compute intersections with a single curve and add to the data array.

Parameters
[in]curves
[in,out]curvePointsgrowing array of curve points.
[in,out]solidPointsgrowing array of solid points.
[in,out]messagesarray of error messages
void AddRayIntersections ( bvector< SolidLocationDetail > &  pickData,
DRay3dCR  ray,
int  parentId,
double  minParameter 
) const

Compute intersections with a ray and add to the pickData.

Parameters
[in]rayorigin and direction
[in]minParametersmallest parameter of pick. (e.g. 0 for picking along a positive ray from an eyepoint)
[in,out]pickDatagrowing array of picks.
[in]parentIdcaller's id for this solid. Will be placed in each pickData entry has parentId.
ISolidPrimitivePtr Clone ( ) const

Copy to a new (allocated) solid primitive.

bool ClosestPoint ( DPoint3dCR  spacePoint,
SolidLocationDetail pickDetail 
) const
Parameters
[in]spacePointsearch for point close to here and on the solid surface
[out]pickDetailclosest point data.
Returns
false if not supported.
bool ComputeSecondMomentAreaProducts ( TransformR  localToWorld,
DMatrix4dR  localProducts 
) const

Return the various integrated products for area moment calculations.

The primitive is treated as a thin shell.

Parameters
[out]localToWorldtransform from preferred system where the products are most easily computed to world.
[out]localProductsintegrated [xx xy xz x; xy yy yz y; xz yz zz z; x y z 1] dA
Returns
false if unable to compute.
bool ComputeSecondMomentVolumeProducts ( TransformR  localToWorld,
DMatrix4dR  localProducts 
) const

Return the various integrated products for moment calculations.

The primitive is treated as a volume

Parameters
[out]localToWorldtransform from preferred system where the products are most easily computed to world.
[out]localProductsintegrated [xx xy xz x; xy yy yz y; xz yz zz z; x y z 1] dA
Returns
false if unable to compute.
ICurvePrimitivePtr GetConstantUSection ( SolidLocationDetail::FaceIndices const &  indices,
double  fraction 
) const

Copy a section at constant u of a single face to a single ICurvePrimitive.

Parameters
[in]indicesselects face
[in]fractionu fraction for section curve
ICurvePrimitivePtr GetConstantVSection ( SolidLocationDetail::FaceIndices const &  indices,
double  fraction 
) const

Copy a section curve at constant v of a single face to a single ICurvePrimitive.

Parameters
[in]indicesselects face
[in]fractionv fraction for section curve
IGeometryPtr GetFace ( SolidLocationDetail::FaceIndices const &  indices) const

Return a single face of the solid primitive.

Parameters
indicesinteger selectors for the face.
void GetFaceIndices ( bvector< SolidLocationDetail::FaceIndices > &  indices) const

Fill a list of all possible face indices.

Parameters
[out]indicesarray of selectors for the faces.
bool GetNonUniformTransforms ( TransformR  localToWorld,
TransformR  worldToLocal 
) const

Return (nonuniform) transforms for normalized system where sphere radius is 1.

bool GetRange ( DRange3dR  range) const

Return range.

bool GetRange ( DRange3dR  range,
TransformCR  transform 
) const

Return range when transformed.

bool GetSweepLimits ( double &  latitude0,
double &  latitude1,
double &  z0,
double &  z1,
bool  forceSweepNorth = false 
) const
Parameters
[out]latitude0latitude at start of sweep.
[out]latitude1latitude at end of sweep.
[out]z0z coordinate at start of sweep.
[out]z1z coordinate at end of sweep.
[in]forceSweepNorthtrue to exchange if necessary to make sweep south to north.
Returns
false if no sweep limits (full sphere)
bool GetTransforms ( TransformR  localToWorld,
TransformR  worldToLocal 
) const

Return transforms for unit-axis system.

void IntersectBoundedArc ( DEllipse3dCR  arc,
bvector< double > &  arcFractions,
bvector< DPoint3d > &  normalizedConePoints,
TransformR  localToWorld,
TransformR  worldToLocal,
bool  boundedZ 
) const

Return all intersection points of an (unbounded) arc with the sphere.

Returned data is the detailed local coordinates, with additional data to relate it back to world.

Parameters
[in]arcarc to intersect with instance cone.
[out]arcFractionsintersection fractions along the arc.
[out]normalizedConePointsintersection points, in local coordinates
[out]localToWorldlocal to world transformation
[out]worldToLocalworld to local transformation
[in]boundedZif true, skip intersections outside the latitude sweep
bool IsClosedVolume ( ) const

Test if this is a closed volume.

bool IsRealCap ( int  select01) const

Test if caps are active and the indicated cap is not at a pole.

bool IsReverseOrientation ( )

Return true if the tracing the parameterization produces reverse (inward facing) orientation.

bool IsSameStructure ( ISolidPrimitiveCR  other) const

Test for same type and structure (but no coordinate comparison)

bool IsSameStructureAndGeometry ( ISolidPrimitiveCR  other,
double  tolerance 
) const

Test for same type, structure and coordinates.

bool IsTrueRotationAroundZ ( DPoint3dR  center,
DVec3dR  unitX,
DVec3dR  unitY,
DVec3dR  unitZ,
double &  equatorRadius,
double &  poleRadius 
) const

Return true (with supporting local coordinate frame) iff this is a rotation around the Z axis.

bool IsTrueSphere ( DPoint3dR  center,
RotMatrixR  axes,
double &  radius 
) const

Return true (with supporting data) iff this is a (complete) true sphere.

double LatitudeToVFraction ( double  latitude) const

Compute the v fraction of latitude.

double LongitudeToUFraction ( double  longitude) const

Compute the u fraction of longitude.

double ParameterizationSign ( ) const

Return +1 or -1 that matches the volume sign after integration over the parameter space.

static void SetDetailUVFromUnitSphereCoordinates ( SolidLocationDetail detail,
DPoint3dCR  localuvw,
TransformCR  localToWorld,
double  startLatitude,
double  sweepLatitude 
)
static

set point, uv coordinates, and uv derivatives vectors

Parameters
[in,out]detaildetail to update
[in]localuvwcoordinates in local fraction space.
[in]localToWorldtransform to world coordinates
[in]startLatitudereference latitude for normalizing of the uv
[in]sweepLatitudesweep for normalizing the uv.
bool TransformInPlace ( TransformCR  transform)

Transform in place.

bool TryGetConstructiveFrame ( TransformR  localToWorld,
TransformR  worldToLocal 
) const

Return coordinate system with 1) XY plane in equatorial plane, origin at sphere center.

2) Z perpendicular

bool TryGetMaxUVLength ( SolidLocationDetail::FaceIndices const &  indices,
DVec2dR  uvLength 
) const

Compute the lengths of the longest u and v direction sections of a single face of a solid primitive.

Parameters
[in]indicesselects face.
[in]uvLengthsizes in u, v directions.
bool TryGetRotationAxis ( DPoint3dR  center,
DVec3dR  axis,
double &  sweepRadians 
) const
Parameters
centerOUT center of rotation.
axisOUT axis of rotation.
sweepRadiansOUT angle of rotation.
bool TryUVFractionToXYZ ( SolidLocationDetail::FaceIndices const &  faceIndices,
double  uFraction,
double  vFraction,
DPoint3dR  xyz,
DVec3dR  dXdu,
DVec3dR  dXdv 
) const

convert u,v fraction on specified face to xyz and derivatives.

Parameters
[in]faceIndicesface selection indices
[in]uFractionfractional coordinate in u direction.
[in]vFractionfractional coordinate in v direction.
[out]xyzpoint on face.
[out]dXduderivative of face point wrt uFraction.
[out]dXdvderivative of face point wrt vFraction.
DEllipse3d UFractionToVSectionDEllipse3d ( double  fraction) const

Return the ellipse on the meridian at fractional position.

double VFractionToLatitude ( double  v) const

Compute the latitude at v fraction.

DEllipse3d VFractionToUSectionDEllipse3d ( double  fraction) const

Return the ellipse on the parallel at fractional position.

Member Data Documentation

bool m_capped
double m_latitudeSweep
Transform m_localToWorld
double m_startLatitude

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

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.