Public Member Functions | Static Public Member Functions | List of all members
ConvexClipPlaneSet Struct Reference

! A ConvexClipPlaneSet is an array of planes oriented so the intersection of their inside halfspaces is a convex volume. More...

#include <ClipPlaneSet.h>

Inheritance diagram for ConvexClipPlaneSet:

Public Member Functions

 ConvexClipPlaneSet ()
 Create emplty convex plane set. More...
 
 ConvexClipPlaneSet (size_t n)
 Create convex plane set of specified size. More...
 
 ConvexClipPlaneSet (ClipPlaneCP planes, size_t nPlanes)
 Create convex plane set from planes. More...
 
bool IsPointInside (DPoint3dCR point) const
 Test if point is inside all planes. More...
 
bool IsPointOnOrInside (DPoint3dCR point, double tolerance) const
 Test if point is inside all planes to supplied tolerance. More...
 
bool IsSphereInside (DPoint3dCR point, double tolerance) const
 Test if sphere is inside all planes. More...
 
bool ClipBoundedSegment (DPoint3dCR pointA, DPoint3dCR pointB, double &fraction0, double &fraction1, double planeSign) const
 Clip a (bounded) line segment to this set of planes. More...
 
bool ClipUnBoundedSegment (DPoint3dCR pointA, DPoint3dCR pointB, double &fraction0, double &fraction1, double planeSign) const
 Clip an unbounded line to this set of planes. More...
 
ClipPlaneContainment ClassifyPointContainment (DPoint3dCP points, size_t nPoints, bool onIsOutside=false) const
 return a summary classification More...
 
void TransformInPlace (TransformCR transform)
 Transform plane set. More...
 
bool GetRange (DRange3dR range, TransformCP transform) const
 Get range of this ConvexClipPlaneSet. More...
 
int ReloadSweptConvexPolygon (bvector< DPoint3d > const &points, DVec3dCR sweepDirection, int sideSelect)
 reinitialize to clip to a swept polygon. More...
 
void ConvexPolygonClip (bvector< DPoint3d > const &input, bvector< DPoint3d > &output, bvector< DPoint3d > &work) const
 Return the (polygon) of intersection. More...
 
void ConvexPolygonClipInsideOutside (bvector< DPoint3d > const &input, bvector< DPoint3d > &inside, BVectorCache< DPoint3d > &outside, bvector< DPoint3d > &work1, bvector< DPoint3d > &work2, bool clearOutside=true, double distanceTolerance=0.0) const
 Return the (0 or 1) intersection polygon and (0 or to numClipPlane) outside pieces. More...
 

Static Public Member Functions

static ConvexClipPlaneSet FromXYBox (double x0, double y0, double x1, double y1)
 Create clip plane set from XY box. More...
 
static ConvexClipPlaneSet FromXYPolyLine (bvector< DPoint3d > &points, bvector< bool > &hiddenEdge, bool leftIsInside)
 Create clip plane set from XY polygon. More...
 

Detailed Description

! A ConvexClipPlaneSet is an array of planes oriented so the intersection of their inside halfspaces is a convex volume.

!

Constructor & Destructor Documentation

Create emplty convex plane set.

ConvexClipPlaneSet ( size_t  n)

Create convex plane set of specified size.

ConvexClipPlaneSet ( ClipPlaneCP  planes,
size_t  nPlanes 
)

Create convex plane set from planes.

Member Function Documentation

ClipPlaneContainment ClassifyPointContainment ( DPoint3dCP  points,
size_t  nPoints,
bool  onIsOutside = false 
) const

return a summary classification

  • ClipPlaneContainment_StronglyInside All points are inside the plane set
  • ClipPlaneContainment_Ambiguous
  • ClipPlaneContainment_StronglyOut Strongly out. All points are out, and are all on one side of one of planes, so edges joining pairs of points will always be out also.
bool ClipBoundedSegment ( DPoint3dCR  pointA,
DPoint3dCR  pointB,
double &  fraction0,
double &  fraction1,
double  planeSign 
) const

Clip a (bounded) line segment to this set of planes.

bool ClipUnBoundedSegment ( DPoint3dCR  pointA,
DPoint3dCR  pointB,
double &  fraction0,
double &  fraction1,
double  planeSign 
) const

Clip an unbounded line to this set of planes.

void ConvexPolygonClip ( bvector< DPoint3d > const &  input,
bvector< DPoint3d > &  output,
bvector< DPoint3d > &  work 
) const

Return the (polygon) of intersection.

Parameters
[in]inputpoints of a convex polygon
[out]outputclipped polygon
[in,out]workextra polygon
void ConvexPolygonClipInsideOutside ( bvector< DPoint3d > const &  input,
bvector< DPoint3d > &  inside,
BVectorCache< DPoint3d > &  outside,
bvector< DPoint3d > &  work1,
bvector< DPoint3d > &  work2,
bool  clearOutside = true,
double  distanceTolerance = 0.0 
) const

Return the (0 or 1) intersection polygon and (0 or to numClipPlane) outside pieces.

Parameters
[in]inputpoints of a convex polygon
[out]insideclipped polygon (inside the convex set)
[out]outsideclipped polygons (outside the convex set)
[in,out]work1work vector for efficient reuse over multiple calls
[in,out]work2work vector for efficient reuse over multiple calls
[in]clearOutsidetrue to clear the outside data.
[in]distanceToleranceif nonzero, polygons within this distance of interior planes are classified as entirely "in"
static ConvexClipPlaneSet FromXYBox ( double  x0,
double  y0,
double  x1,
double  y1 
)
static

Create clip plane set from XY box.

static ConvexClipPlaneSet FromXYPolyLine ( bvector< DPoint3d > &  points,
bvector< bool > &  hiddenEdge,
bool  leftIsInside 
)
static

Create clip plane set from XY polygon.

bool GetRange ( DRange3dR  range,
TransformCP  transform 
) const

Get range of this ConvexClipPlaneSet.

bool IsPointInside ( DPoint3dCR  point) const

Test if point is inside all planes.

bool IsPointOnOrInside ( DPoint3dCR  point,
double  tolerance 
) const

Test if point is inside all planes to supplied tolerance.

bool IsSphereInside ( DPoint3dCR  point,
double  tolerance 
) const

Test if sphere is inside all planes.

int ReloadSweptConvexPolygon ( bvector< DPoint3d > const &  points,
DVec3dCR  sweepDirection,
int  sideSelect 
)

reinitialize to clip to a swept polygon.

ul> li> 1 – success, and the sweep vector and polygon area normal have positive dot product li> -1 – success, and the sweep vector and polygon area normal have negative dot product /ul> 0 – failure - polygon normal is perpendicular to sweep.

Parameters
[in]pointspolygon points
[in]sweepDirectiondirection for sweep
[in]sideSelect0 to just clip at polygon sides. Positive to keep only above the polygon plane, negative to keep only below.
void TransformInPlace ( TransformCR  transform)

Transform plane set.


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

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