Table of Contents

Interface IOctTreeInsertable

Namespace
CADability
Assembly
CADability.dll

Implemented by objects which can be stored in an OctTree<T>: the tree asks the object for its extent and whether it is hit by a cube when it sorts the object into its nodes, and whether it is hit by a projected rectangle or a line when the tree is searched by a pick rectangle or a ray. All GeoObjects implement it (IGeoObject extends it), as do Face, Edge, Vertex and various internal helper objects.

public interface IOctTreeInsertable

Methods

GetExtent(double)

Gets the 3-dimensional extent of an object

BoundingCube GetExtent(double precision)

Parameters

precision double

Precision of the test

Returns

BoundingCube

The minmax cube

HitTest(ref BoundingCube, double)

Tests whether an object is touched by the provided cube

bool HitTest(ref BoundingCube cube, double precision)

Parameters

cube BoundingCube

To test with

precision double

Required precision

Returns

bool

true if the object strikes the cube

HitTest(Projection, BoundingRect, bool)

Tests whether an object is inside or touched by the rectangle when projected with the provided projection

bool HitTest(Projection projection, BoundingRect rect, bool onlyInside)

Parameters

projection Projection

The projection for the test

rect BoundingRect

The rectangle to test the position

onlyInside bool

true: the object must be totaly inside the rectangle, false: the object must be totaly or partially inside the rectangle

Returns

bool

true when the test succeedes, false otherwise

HitTest(PickArea, bool)

Tests whether an object is inside or touched by the provided area

bool HitTest(Projection.PickArea area, bool onlyInside)

Parameters

area Projection.PickArea

The area to check for

onlyInside bool

true: the object must be totaly inside the area, false: the object must be totaly or partially inside the area

Returns

bool

true when the test succeedes, false otherwise

Position(GeoPoint, GeoVector, double)

Returns the smallest parameter value (l) where the provided line hits the object so that the point fromHere + l * direction is on or close to the object. The result may be negative. Return double.MaxValue if there is no such point.

double Position(GeoPoint fromHere, GeoVector direction, double precision)

Parameters

fromHere GeoPoint

Startpoint of the line

direction GeoVector

Direction of the line

precision double

Precision for the test

Returns

double

Position on the line