本文整理汇总了C#中Cell.GetShape方法的典型用法代码示例。如果您正苦于以下问题:C# Cell.GetShape方法的具体用法?C# Cell.GetShape怎么用?C# Cell.GetShape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cell
的用法示例。
在下文中一共展示了Cell.GetShape方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitScanned
/// <exception cref="System.IO.IOException"></exception>
protected internal override void VisitScanned(Cell cell)
{
Shape cShape;
//if this cell represents a point, use the cell center vs the box
// TODO this behavior is debatable; might want to be configurable
// (points never have isLeaf())
if (cell.Level == _enclosing.grid.MaxLevels && !cell.IsLeaf())
{
cShape = cell.GetCenter();
}
else
{
cShape = cell.GetShape();
}
if (_enclosing.queryShape.Relate(cShape).Intersects())
{
CollectDocs(results);
}
}
示例2: VisitLeaf
/// <exception cref="System.IO.IOException"></exception>
protected internal override void VisitLeaf(Cell cell)
{
//visitRelation is declared as a field, populated by visit() so we don't recompute it
Debug.Assert(_enclosing.detailLevel != cell.Level);
Debug.Assert(visitRelation == cell.GetShape().Relate(_enclosing.queryShape));
if (AllCellsIntersectQuery(cell, visitRelation))
{
CollectDocs(inside);
}
else
{
CollectDocs(outside);
}
}
示例3: AllCellsIntersectQuery
/// <summary>
/// Returns true if the provided cell, and all its sub-cells down to
/// detailLevel all intersect the queryShape.
/// </summary>
/// <remarks>
/// Returns true if the provided cell, and all its sub-cells down to
/// detailLevel all intersect the queryShape.
/// </remarks>
private bool AllCellsIntersectQuery(Cell cell, SpatialRelation relate)
{
if (relate == SpatialRelation.NULL_VALUE)
{
relate = cell.GetShape().Relate(_enclosing.queryShape);
}
if (cell.Level == _enclosing.detailLevel)
{
return relate.Intersects();
}
if (relate == SpatialRelation.WITHIN)
{
return true;
}
if (relate == SpatialRelation.DISJOINT)
{
return false;
}
// Note: Generating all these cells just to determine intersection is not ideal.
// It was easy to implement but could be optimized. For example if the docs
// in question are already marked in the 'outside' bitset then it can be avoided.
ICollection<Cell> subCells = cell.GetSubCells(null);
foreach (Cell subCell in subCells)
{
if (!AllCellsIntersectQuery(subCell, SpatialRelation.NULL_VALUE))
{
//recursion
return false;
}
}
return true;
}
示例4: Visit
/// <exception cref="System.IO.IOException"></exception>
protected internal override bool Visit(Cell cell)
{
//cell.relate is based on the bufferedQueryShape; we need to examine what
// the relation is against the queryShape
visitRelation = cell.GetShape().Relate(_enclosing.queryShape);
if (visitRelation == SpatialRelation.WITHIN)
{
CollectDocs(inside);
return false;
}
else
{
if (visitRelation == SpatialRelation.DISJOINT)
{
CollectDocs(outside);
return false;
}
else
{
if (cell.Level == _enclosing.detailLevel)
{
CollectDocs(inside);
return false;
}
}
}
return true;
}