index

package
v0.0.0-...-ae1d368 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RTreeIndex

type RTreeIndex struct {
	// contains filtered or unexported fields
}

func NewRTreeIndex

func NewRTreeIndex() *RTreeIndex

func NewRTreeIndexFromModel

func NewRTreeIndexFromModel(shapeModels []model.Shape) *RTreeIndex

func (*RTreeIndex) AddShape

func (store *RTreeIndex) AddShape(shape geometry.Shape)

func (*RTreeIndex) AddShapes

func (store *RTreeIndex) AddShapes(shapes []geometry.Shape)

AddShapes ...

func (*RTreeIndex) FindShapesWhichContainsPoint

func (store *RTreeIndex) FindShapesWhichContainsPoint(point geometry.Point) []geometry.Shape

FindShapesWhichContainsPoint ...

func (*RTreeIndex) FindShapesWhichContainsShape

func (store *RTreeIndex) FindShapesWhichContainsShape(shape geometry.Shape) []geometry.Shape

FindShapesWhichContainsShape ...

func (*RTreeIndex) GetShapeByName

func (store *RTreeIndex) GetShapeByName(shapeName string) (geometry.Shape, error)

GetShapeByName ...

func (*RTreeIndex) RemoveShapeByName

func (store *RTreeIndex) RemoveShapeByName(shapeName string) (geometry.Shape, error)

RemoveShapeByName ...

type SimpleIndex

type SimpleIndex struct {
	Shapes []geometry.Shape
	// contains filtered or unexported fields
}

SimpleIndex is a simple store with no optmizations and implements Store from Tria

func NewSimpleIndex

func NewSimpleIndex() *SimpleIndex

NewSimpleIndex returns an initialized SimpleIndex

func NewSimpleIndexFromModel

func NewSimpleIndexFromModel(shapeModels []model.Shape) *SimpleIndex

NewSimpleIndexFromModel returns an initialized SimpleIndex with index populated from a list of shapes

func (*SimpleIndex) AddShape

func (store *SimpleIndex) AddShape(shape geometry.Shape)

AddShape ...

func (*SimpleIndex) AddShapes

func (store *SimpleIndex) AddShapes(shapes []geometry.Shape)

AddShapes ...

func (*SimpleIndex) FindShapesWhichContainsPoint

func (store *SimpleIndex) FindShapesWhichContainsPoint(point geometry.Point) []geometry.Shape

FindShapesWhichContainsPoint ...

func (*SimpleIndex) FindShapesWhichContainsShape

func (store *SimpleIndex) FindShapesWhichContainsShape(shape geometry.Shape) []geometry.Shape

FindShapesWhichContainsShape ...

func (*SimpleIndex) GetShapeByName

func (store *SimpleIndex) GetShapeByName(shapeName string) (geometry.Shape, error)

GetShapeByName ...

func (*SimpleIndex) RemoveShapeByName

func (store *SimpleIndex) RemoveShapeByName(shapeName string) (geometry.Shape, error)

RemoveShapeByName ...

type TriaIndex

type TriaIndex interface {
	// AddShape adds a shape to the current TriaIndex
	AddShape(geometry.Shape)
	// AddShapes add multiple shapes to the current TriaIndex
	AddShapes([]geometry.Shape)
	// GetShapeByName returns a shape by name if found, otherwise error
	GetShapeByName(string) (geometry.Shape, error)
	// RemoveShapeByName removes a shape by name if found and returns it, otherwise error
	RemoveShapeByName(string) (geometry.Shape, error)

	// FindShapesWhichContains checks the store shapes if it contains with given point
	FindShapesWhichContainsPoint(geometry.Point) []geometry.Shape
	// FindShapesWhichContainsShape checks the store shapes if it contains with given shape
	FindShapesWhichContainsShape(geometry.Shape) []geometry.Shape
}

TriaIndex is a interface for handling searching and storing of shapes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL