Table of Contents

Class QuadTreeCollection

Namespace
CADability.GeoObject
Assembly
CADability.dll

The IQuadTreeInsertableZ item of a composite object (Block, Dimension, Path, Shell, Solid ...) in the quadtree of a ProjectedModel. It keeps the quadtree items of the parts in a quadtree of its own, so that the extent, the hit test and the z position of the composite object are answered by its parts, while ReferencedObject is the composite object itself. Created by GetQuadTreeItem(Projection, ExtentPrecision) of those objects.

public class QuadTreeCollection : IQuadTreeInsertableZ, IQuadTreeInsertable
Inheritance
QuadTreeCollection
Implements
Inherited Members

Constructors

QuadTreeCollection(IGeoObject, Projection)

Creates an empty collection for the given object. The items of the parts are added with Add(IQuadTreeInsertableZ).

public QuadTreeCollection(IGeoObject go, Projection projection)

Parameters

go IGeoObject

The composite object this item stands for, returned as ReferencedObject

projection Projection

The projection of the quadtree; currently not used by the collection itself

Methods

Add(IQuadTreeInsertableZ)

Adds the quadtree item of a part and extends the extent of the collection by its extent.

public void Add(IQuadTreeInsertableZ toAdd)

Parameters

toAdd IQuadTreeInsertableZ

The item of a part, usually obtained by GetQuadTreeItem(Projection, ExtentPrecision)

GetObjectsFromRect(ref BoundingRect)

Returns the items of the parts whose extent overlaps the given rectangle. Nested collections are resolved, so the result only contains items of simple objects.

public IQuadTreeInsertableZ[] GetObjectsFromRect(ref BoundingRect rect)

Parameters

rect BoundingRect

The rectangle in the 2d coordinates of the projection

Returns

IQuadTreeInsertableZ[]

The matching items, an empty array when there are none

SetOwner(IGeoObject)

Replaces the object this item stands for. BlockRef uses it to let the collection that was built for its flattened block refer to the block reference itself.

public void SetOwner(IGeoObject go)

Parameters

go IGeoObject

The object to return as ReferencedObject