A DgnBoxDetail represents a boxlike surface with two paralell rectangular faces (bottom and top) and ruled side surfaces. More...
#include <SolidPrimitive.h>
Public Member Functions | |
DgnBoxDetail (DPoint3dCR baseOrigin, DPoint3dCR topOrigin, DVec3dCR vectorX, DVec3dCR vectorY, double baseX, double baseY, double topX, double topY, bool capped) | |
Detail constructor with complete field list as parameters ... More... | |
DgnBoxDetail () | |
Default value constructor. More... | |
void | GetNonUniformTransform (TransformR localToWorld, double &ax, double &ay, double &bx, double &by) const |
Return (nonuniform) placement and rectangle sizes. (ax,ay) rectangle is on z=0. (bx,by) is on z=1;. 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 in box base plane, origin at nominal lower left. 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... | |
void | GetCorners (bvector< DPoint3d > &corners) const |
Return 8 corners of the box. More... | |
void | GetCorners (DPoint3dP corners) const |
Return 8 corners of the box. More... | |
void | IsCenteredBox (Transform centeredFrame, DVec3dR diagonal) const |
Test if the box is an orthogonal box. 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... | |
bool | IsBlock (DPoint3dR origin, RotMatrixR unitAxes, DVec3dR localDiagonal, double originXFraction, double originYFraction, double originZFraction) const |
Test if the DgnBox is really a box (aka slab). More... | |
Static Public Member Functions | |
static DgnBoxDetail | InitFromCenters (DPoint3dCR baseCenter, DPoint3dCR topCenter, DVec3dCR vectorX, DVec3dCR vectorY, double baseX, double baseY, double topX, double topY, bool capped) |
Initialize box detail fields specifying top/base centers instead of origins... More... | |
static DgnBoxDetail | InitFromCenterAndSize (DPoint3dCR center, DPoint3dCR size, bool capped) |
Initialize box detail fields from center and size. More... | |
Public Attributes | |
DPoint3d | m_baseOrigin |
DPoint3d | m_topOrigin |
DVec3d | m_vectorX |
DVec3d | m_vectorY |
double | m_baseX |
double | m_baseY |
double | m_topX |
double | m_topY |
bool | m_capped |
A DgnBoxDetail represents a boxlike surface with two paralell rectangular faces (bottom and top) and ruled side surfaces.
DgnBoxDetail | ( | DPoint3dCR | baseOrigin, |
DPoint3dCR | topOrigin, | ||
DVec3dCR | vectorX, | ||
DVec3dCR | vectorY, | ||
double | baseX, | ||
double | baseY, | ||
double | topX, | ||
double | topY, | ||
bool | capped | ||
) |
Detail constructor with complete field list as parameters ...
[in] | baseOrigin | origin of base rectangle |
[in] | topOrigin | origin of Top rectangle |
[in] | vectorX | X vector of base plane |
[in] | vectorY | Y vector of base plane |
[in] | baseX | x size at base |
[in] | baseY | y size at base |
[in] | topX | X size at top |
[in] | topY | y size at top |
[in] | capped | true if closed top and bottom. |
DgnBoxDetail | ( | ) |
Default value constructor.
void AddCurveIntersections | ( | CurveVectorCR | curves, |
bvector< CurveLocationDetail > & | curvePoints, | ||
bvector< SolidLocationDetail > & | solidPoints, | ||
MeshAnnotationVector & | messages | ||
) | const |
Compute intersections with curves and add to the data array.
[in] | curves | |
[in,out] | curvePoints | growing array of curve points. |
[in,out] | solidPoints | growing array of solid points. |
[in,out] | messages | array 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.
[in] | curves | |
[in,out] | curvePoints | growing array of curve points. |
[in,out] | solidPoints | growing array of solid points. |
[in,out] | messages | array 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.
[in] | ray | origin and direction |
[in] | minParameter | smallest parameter of pick. (e.g. 0 for picking along a positive ray from an eyepoint) |
[in,out] | pickData | growing array of picks. |
[in] | parentId | caller'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 |
[in] | spacePoint | search for point close to here and on the solid surface |
[out] | pickDetail | closest point data. |
bool ComputeSecondMomentAreaProducts | ( | TransformR | localToWorld, |
DMatrix4dR | localProducts | ||
) | const |
Return the various integrated products for area moment calculations.
The primitive is treated as a thin shell.
[out] | localToWorld | transform from preferred system where the products are most easily computed to world. |
[out] | localProducts | integrated [xx xy xz x; xy yy yz y; xz yz zz z; x y z 1] dA |
bool ComputeSecondMomentVolumeProducts | ( | TransformR | localToWorld, |
DMatrix4dR | localProducts | ||
) | const |
Return the various integrated products for moment calculations.
The primitive is treated as a volume
[out] | localToWorld | transform from preferred system where the products are most easily computed to world. |
[out] | localProducts | integrated [xx xy xz x; xy yy yz y; xz yz zz z; x y z 1] dA |
ICurvePrimitivePtr GetConstantUSection | ( | SolidLocationDetail::FaceIndices const & | indices, |
double | fraction | ||
) | const |
Copy a section at constant u of a single face to a single ICurvePrimitive.
[in] | indices | selects face |
[in] | fraction | u 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.
[in] | indices | selects face |
[in] | fraction | v fraction for section curve |
void GetCorners | ( | bvector< DPoint3d > & | corners | ) | const |
Return 8 corners of the box.
x varies fastest, then y then z.
[out] | corners | 8 corner coordinates. |
void GetCorners | ( | DPoint3dP | corners | ) | const |
Return 8 corners of the box.
x varies fastest, then y then z.
[out] | corners | 8 corner coordinates. Caller must allocate to size 8 or mre. |
IGeometryPtr GetFace | ( | SolidLocationDetail::FaceIndices const & | indices | ) | const |
Return a single face of the solid primitive.
indices | integer selectors for the face. |
void GetFaceIndices | ( | bvector< SolidLocationDetail::FaceIndices > & | indices | ) | const |
Fill a list of all possible face indices.
[out] | indices | array of selectors for the faces. |
void GetNonUniformTransform | ( | TransformR | localToWorld, |
double & | ax, | ||
double & | ay, | ||
double & | bx, | ||
double & | by | ||
) | const |
Return (nonuniform) placement and rectangle sizes. (ax,ay) rectangle is on z=0. (bx,by) is on z=1;.
bool GetRange | ( | DRange3dR | range | ) | const |
Return range.
bool GetRange | ( | DRange3dR | range, |
TransformCR | transform | ||
) | const |
Return range when transformed.
|
static |
Initialize box detail fields from center and size.
[in] | center | center of box in XYZ |
[in] | size | total range in XYZ |
[in] | capped | true if closed top and bottom. |
|
static |
Initialize box detail fields specifying top/base centers instead of origins...
[in] | baseCenter | center of base rectangle |
[in] | topCenter | center of Top rectangle |
[in] | vectorX | X vector of base plane |
[in] | vectorY | Y vector of base plane |
[in] | baseX | x size at base |
[in] | baseY | y size at base |
[in] | topX | X size at top |
[in] | topY | y size at top |
[in] | capped | true if closed top and bottom. |
bool IsBlock | ( | DPoint3dR | origin, |
RotMatrixR | unitAxes, | ||
DVec3dR | localDiagonal, | ||
double | originXFraction, | ||
double | originYFraction, | ||
double | originZFraction | ||
) | const |
Test if the DgnBox is really a box (aka slab).
Return orientation and size data, using caller-specifed fractional coordinates to indicate position of origin in reference system.
[out] | origin | local coordinates origin |
[out] | unitAxes | transform (with orthogonal axes) |
[out] | localDiagonal | the box edge lengths. |
[in] | originXFraction | fractional position of the unitAxes origin along the x edge. |
[in] | originYFraction | fractional position of the unitAxes origin along the y edge. |
[in] | originZFraction | fractional position of the unitAxes origin along the z edge. |
void IsCenteredBox | ( | Transform | centeredFrame, |
DVec3dR | diagonal | ||
) | const |
Test if the box is an orthogonal box.
[out] | centeredFrame | coordinate axes (normalized) at the center of the box. |
[out] | diagonal | diagonal vector. |
bool IsClosedVolume | ( | ) | const |
Test if this is a closed volume.
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.
double ParameterizationSign | ( | ) | const |
Return +1 or -1 that matches the volume sign after integration over the parameter space.
bool TransformInPlace | ( | TransformCR | transform | ) |
Transform in place.
bool TryGetConstructiveFrame | ( | TransformR | localToWorld, |
TransformR | worldToLocal | ||
) | const |
Return coordinate system with 1) XY in box base plane, origin at nominal lower left.
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.
[in] | indices | selects face. |
[in] | uvLength | sizes in u, v directions. |
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.
[in] | faceIndices | face selection indices |
[in] | uFraction | fractional coordinate in u direction. |
[in] | vFraction | fractional coordinate in v direction. |
[out] | xyz | point on face. |
[out] | dXdu | derivative of face point wrt uFraction. |
[out] | dXdv | derivative of face point wrt vFraction. |
DPoint3d m_baseOrigin |
double m_baseX |
double m_baseY |
bool m_capped |
DPoint3d m_topOrigin |
double m_topX |
double m_topY |
DVec3d m_vectorX |
DVec3d m_vectorY |