Public Member Functions | List of all members
ClipPlane Struct Reference

A single plane described by normal and distance from origin. More...

#include <ClipPlane.h>

Public Member Functions

 ClipPlane ()
 Default constructor – z vector, everything else zero. More...
 
 ClipPlane (DVec3dCR normal, double distance, bool invisible=false, bool interior=false)
 Construct plane with given normal and distance from origin. More...
 
 ClipPlane (DVec3dCR normal, DPoint3dCR point, bool invisible=false, bool interior=false)
 Construct plane with given normal and point on plane. More...
 
 ClipPlane (DPlane3dCR plane, bool invisible=false, bool interior=false)
 Construct plane from DPlane3d. More...
 
bool GetIsInterior () const
 Return the interior flag. More...
 
bool GetIsInvisible () const
 Return the interior flag. More...
 
bool IsVisible () const
 Return whether cut for this flag should be displayed (!invisible && !isInterior);. More...
 
void SetInvisible (bool invisible)
 Get invisible. More...
 
uint32_t GetFlags () const
 Get flags. More...
 
void SetFlags (uint32_t flags)
 Set flags. More...
 
void SetFlags (bool invisible, bool interior)
 Set flags. More...
 
double GetDistance () const
 Return the plane distance. More...
 
DVec3dCR GetNormal () const
 Return the plane normal. More...
 
double EvaluatePoint (DPoint3dCR point) const
 Evaluate the plane equation at {point}. More...
 
double DotProduct (DVec3dCR normal) const
 Evaluate Dot Product with plane normal. More...
 
double DotProduct (DPoint3dCR point) const
 Evaluate Dot Product with plane normal. More...
 
bool IsPointOnOrInside (DPoint3dCR point) const
 Return if the point is on or inside plane. More...
 
bool IsPointOnOrInside (DPoint3dCR point, double tolerance) const
 Return if the point is on or inside plane to tolerance. More...
 
DPlane3d GetDPlane3d () const
 Return the plane as origin and normal. More...
 
bool BoundedSegmentHasSimpleIntersection (DPoint3dCR pointA, DPoint3dCR pointB, double &fraction) const
 Return true if the through {pointA} and {pointB} crosses the plane at a fractional coordinate between 0 and 1. More...
 
void TransformInPlace (TransformCR transform)
 Transform plane. More...
 
bool GetRange (DRange3dR range, TransformCP transform) const
 GetRange. More...
 
void Negate ()
 Flip the normal direction. More...
 
void ConvexPolygonClipInPlace (bvector< DPoint3d > &xyz, bvector< DPoint3d > &work) const
 Clip a convex polygon. More...
 
void ConvexPolygonSplitInsideOutside (bvector< DPoint3d > const &xyz, bvector< DPoint3d > &xyzIn, bvector< DPoint3d > &xyzOut, DRange1d &altitudeRange) const
 
void OffsetDistance (double distance)
 Apply offset to plane. More...
 

Detailed Description

A single plane described by normal and distance from origin.

Space point x,y,z is in the outer half space, plane, or inner half space the plane according to the sign of {x * normal.x + y * normal.y + z * normal.z - distance} (i.e. the normal is INWARD) (In customary use where the normal vector is unit length, the distance is true spatial distance from the origin to the closest point on the plane.

Constructor & Destructor Documentation

ClipPlane ( )

Default constructor – z vector, everything else zero.

ClipPlane ( DVec3dCR  normal,
double  distance,
bool  invisible = false,
bool  interior = false 
)

Construct plane with given normal and distance from origin.

ClipPlane ( DVec3dCR  normal,
DPoint3dCR  point,
bool  invisible = false,
bool  interior = false 
)

Construct plane with given normal and point on plane.

ClipPlane ( DPlane3dCR  plane,
bool  invisible = false,
bool  interior = false 
)

Construct plane from DPlane3d.

Member Function Documentation

bool BoundedSegmentHasSimpleIntersection ( DPoint3dCR  pointA,
DPoint3dCR  pointB,
double &  fraction 
) const

Return true if the through {pointA} and {pointB} crosses the plane at a fractional coordinate between 0 and 1.

Note that if both points are ON the plane the return value is false – the "on" case is not a simple intersection.

void ConvexPolygonClipInPlace ( bvector< DPoint3d > &  xyz,
bvector< DPoint3d > &  work 
) const

Clip a convex polygon.

caller supplies work and altitude arrays as works space. result is written inplace to xyz.

void ConvexPolygonSplitInsideOutside ( bvector< DPoint3d > const &  xyz,
bvector< DPoint3d > &  xyzIn,
bvector< DPoint3d > &  xyzOut,
DRange1d altitudeRange 
) const
Parameters
[in]xyzoriginal polygon
[out]xyzIninside part
[out]xyzOutoutside part
[out]altitudeRangemin and max altitude values.
double DotProduct ( DVec3dCR  normal) const

Evaluate Dot Product with plane normal.

double DotProduct ( DPoint3dCR  point) const

Evaluate Dot Product with plane normal.

double EvaluatePoint ( DPoint3dCR  point) const

Evaluate the plane equation at {point}.

double GetDistance ( ) const

Return the plane distance.

DPlane3d GetDPlane3d ( ) const

Return the plane as origin and normal.

uint32_t GetFlags ( ) const

Get flags.

bool GetIsInterior ( ) const

Return the interior flag.

bool GetIsInvisible ( ) const

Return the interior flag.

DVec3dCR GetNormal ( ) const

Return the plane normal.

bool GetRange ( DRange3dR  range,
TransformCP  transform 
) const

GetRange.

bool IsPointOnOrInside ( DPoint3dCR  point) const

Return if the point is on or inside plane.

bool IsPointOnOrInside ( DPoint3dCR  point,
double  tolerance 
) const

Return if the point is on or inside plane to tolerance.

bool IsVisible ( ) const

Return whether cut for this flag should be displayed (!invisible && !isInterior);.

void Negate ( )

Flip the normal direction.

void OffsetDistance ( double  distance)

Apply offset to plane.

void SetFlags ( uint32_t  flags)

Set flags.

void SetFlags ( bool  invisible,
bool  interior 
)

Set flags.

void SetInvisible ( bool  invisible)

Get invisible.

void TransformInPlace ( TransformCR  transform)

Transform plane.


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

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