當前位置: 首頁>>代碼示例>>C#>>正文


C# Cell.GetShape方法代碼示例

本文整理匯總了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);
     }
 }
開發者ID:Cefa68000,項目名稱:lucenenet,代碼行數:20,代碼來源:IntersectsPrefixTreeFilter.cs

示例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);
     }
 }
開發者ID:Cefa68000,項目名稱:lucenenet,代碼行數:15,代碼來源:WithinPrefixTreeFilter.cs

示例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;
 }
開發者ID:Cefa68000,項目名稱:lucenenet,代碼行數:40,代碼來源:WithinPrefixTreeFilter.cs

示例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;
 }
開發者ID:Cefa68000,項目名稱:lucenenet,代碼行數:29,代碼來源:WithinPrefixTreeFilter.cs


注:本文中的Cell.GetShape方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。