libspatialindex API Reference  (git-trunk)
SpatialIndex::LineSegment Class Reference

#include <LineSegment.h>

Inheritance diagram for SpatialIndex::LineSegment:
Inheritance graph
Collaboration diagram for SpatialIndex::LineSegment:
Collaboration graph

Public Member Functions

 LineSegment ()
 
 LineSegment (const double *startPoint, const double *endPoint, uint32_t dimension)
 
 LineSegment (const Point &startPoint, const Point &endPoint)
 
 LineSegment (const LineSegment &l)
 
 ~LineSegment () override
 
virtual LineSegmentoperator= (const LineSegment &p)
 
virtual bool operator== (const LineSegment &p) const
 
LineSegmentclone () override
 
uint32_t getByteArraySize () override
 
void loadFromByteArray (const uint8_t *data) override
 
void storeToByteArray (uint8_t **data, uint32_t &length) override
 
bool intersectsShape (const IShape &in) const override
 
bool containsShape (const IShape &in) const override
 
bool touchesShape (const IShape &in) const override
 
void getCenter (Point &out) const override
 
uint32_t getDimension () const override
 
void getMBR (Region &out) const override
 
double getArea () const override
 
double getMinimumDistance (const IShape &in) const override
 
virtual bool intersectsLineSegment (const LineSegment &l) const
 
virtual bool intersectsRegion (const Region &p) const
 
virtual double getMinimumDistance (const Point &p) const
 
virtual double getRelativeMinimumDistance (const Point &p) const
 
virtual double getRelativeMaximumDistance (const Region &r) const
 
virtual double getAngleOfPerpendicularRay ()
 
virtual void makeInfinite (uint32_t dimension)
 
virtual void makeDimension (uint32_t dimension)
 
- Public Member Functions inherited from Tools::IObject
virtual ~IObject ()=default
 
- Public Member Functions inherited from SpatialIndex::IShape
 ~IShape () override=default
 
- Public Member Functions inherited from Tools::ISerializable
virtual ~ISerializable ()=default
 

Public Attributes

uint32_t m_dimension {0}
 
double * m_pStartPoint {nullptr}
 
double * m_pEndPoint {nullptr}
 

Static Protected Member Functions

static double doubleAreaTriangle (const Point &a, const Point &b, const Point &c)
 
static bool leftOf (const Point &a, const Point &b, const Point &c)
 
static bool collinear (const Point &a, const Point &b, const Point &c)
 
static bool between (const Point &a, const Point &b, const Point &c)
 
static bool between (double a, double b, double c)
 
static bool intersectsProper (const Point &a, const Point &b, const Point &c, const Point &d)
 
static bool intersects (const Point &a, const Point &b, const Point &c, const Point &d)
 

Friends

class Region
 
class Point
 
SIDX_DLL std::ostream & operator<< (std::ostream &os, const LineSegment &pt)
 

Detailed Description

Definition at line 32 of file LineSegment.h.

Constructor & Destructor Documentation

◆ LineSegment() [1/4]

LineSegment::LineSegment ( )
default

Referenced by clone().

Here is the caller graph for this function:

◆ LineSegment() [2/4]

LineSegment::LineSegment ( const double *  startPoint,
const double *  endPoint,
uint32_t  dimension 
)

Definition at line 39 of file LineSegment.cc.

References m_dimension, m_pEndPoint, and m_pStartPoint.

◆ LineSegment() [3/4]

LineSegment::LineSegment ( const Point startPoint,
const Point endPoint 
)

◆ LineSegment() [4/4]

LineSegment::LineSegment ( const LineSegment l)

Definition at line 66 of file LineSegment.cc.

References m_dimension, m_pEndPoint, and m_pStartPoint.

◆ ~LineSegment()

LineSegment::~LineSegment ( )
override

Definition at line 77 of file LineSegment.cc.

References m_pEndPoint, and m_pStartPoint.

Member Function Documentation

◆ between() [1/2]

bool LineSegment::between ( const Point a,
const Point b,
const Point c 
)
staticprotected

Definition at line 454 of file LineSegment.cc.

References collinear(), and SpatialIndex::Point::m_pCoords.

Referenced by intersects().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ between() [2/2]

bool LineSegment::between ( double  a,
double  b,
double  c 
)
staticprotected

Definition at line 467 of file LineSegment.cc.

◆ clone()

LineSegment * LineSegment::clone ( )
overridevirtual

Implements Tools::IObject.

Definition at line 119 of file LineSegment.cc.

References LineSegment().

Here is the call graph for this function:

◆ collinear()

bool LineSegment::collinear ( const Point a,
const Point b,
const Point c 
)
staticprotected

Definition at line 439 of file LineSegment.cc.

References doubleAreaTriangle().

Referenced by between(), and intersectsProper().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ containsShape()

bool LineSegment::containsShape ( const IShape in) const
overridevirtual

Implements SpatialIndex::IShape.

Definition at line 175 of file LineSegment.cc.

◆ doubleAreaTriangle()

double LineSegment::doubleAreaTriangle ( const Point a,
const Point b,
const Point c 
)
staticprotected

Definition at line 427 of file LineSegment.cc.

References SpatialIndex::Point::m_pCoords.

Referenced by collinear(), and leftOf().

Here is the caller graph for this function:

◆ getAngleOfPerpendicularRay()

double LineSegment::getAngleOfPerpendicularRay ( )
virtual

Definition at line 377 of file LineSegment.cc.

References m_dimension, m_pEndPoint, M_PI_2, and m_pStartPoint.

◆ getArea()

double LineSegment::getArea ( ) const
overridevirtual

Implements SpatialIndex::IShape.

Definition at line 221 of file LineSegment.cc.

◆ getByteArraySize()

uint32_t LineSegment::getByteArraySize ( )
overridevirtual

Implements Tools::ISerializable.

Definition at line 127 of file LineSegment.cc.

References m_dimension.

Referenced by storeToByteArray().

Here is the caller graph for this function:

◆ getCenter()

void LineSegment::getCenter ( Point out) const
overridevirtual

Implements SpatialIndex::IShape.

Definition at line 187 of file LineSegment.cc.

References m_dimension, m_pEndPoint, m_pStartPoint, and Point.

◆ getDimension()

uint32_t LineSegment::getDimension ( ) const
overridevirtual

Implements SpatialIndex::IShape.

Definition at line 201 of file LineSegment.cc.

References m_dimension.

◆ getMBR()

void LineSegment::getMBR ( Region out) const
overridevirtual

Implements SpatialIndex::IShape.

Definition at line 206 of file LineSegment.cc.

References m_dimension, m_pEndPoint, m_pStartPoint, and Region.

◆ getMinimumDistance() [1/2]

double LineSegment::getMinimumDistance ( const IShape in) const
overridevirtual

Implements SpatialIndex::IShape.

Definition at line 226 of file LineSegment.cc.

◆ getMinimumDistance() [2/2]

double LineSegment::getMinimumDistance ( const Point p) const
virtual

◆ getRelativeMaximumDistance()

double LineSegment::getRelativeMaximumDistance ( const Region r) const
virtual

Definition at line 348 of file LineSegment.cc.

References getRelativeMinimumDistance(), m_dimension, SpatialIndex::Region::m_pHigh, SpatialIndex::Region::m_pLow, and Point.

Here is the call graph for this function:

◆ getRelativeMinimumDistance()

double LineSegment::getRelativeMinimumDistance ( const Point p) const
virtual

Definition at line 312 of file LineSegment.cc.

References m_dimension, SpatialIndex::Point::m_pCoords, m_pEndPoint, and m_pStartPoint.

Referenced by getRelativeMaximumDistance().

Here is the caller graph for this function:

◆ intersects()

bool LineSegment::intersects ( const Point a,
const Point b,
const Point c,
const Point d 
)
staticprotected

Definition at line 472 of file LineSegment.cc.

References between(), and intersectsProper().

Referenced by intersectsLineSegment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersectsLineSegment()

bool LineSegment::intersectsLineSegment ( const LineSegment l) const
virtual

Definition at line 290 of file LineSegment.cc.

References intersects(), m_dimension, m_pEndPoint, m_pStartPoint, and Point.

Referenced by intersectsShape().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersectsProper()

bool LineSegment::intersectsProper ( const Point a,
const Point b,
const Point c,
const Point d 
)
staticprotected

Definition at line 444 of file LineSegment.cc.

References collinear(), and leftOf().

Referenced by intersects().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersectsRegion()

bool LineSegment::intersectsRegion ( const Region p) const
virtual

Definition at line 275 of file LineSegment.cc.

References SpatialIndex::Region::intersectsLineSegment(), m_dimension, and SpatialIndex::Region::m_dimension.

Referenced by intersectsShape().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersectsShape()

bool LineSegment::intersectsShape ( const IShape in) const
overridevirtual

Implements SpatialIndex::IShape.

Definition at line 162 of file LineSegment.cc.

References intersectsLineSegment(), and intersectsRegion().

Referenced by SpatialIndex::Region::intersectsLineSegment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ leftOf()

bool LineSegment::leftOf ( const Point a,
const Point b,
const Point c 
)
staticprotected

Definition at line 434 of file LineSegment.cc.

References doubleAreaTriangle().

Referenced by intersectsProper().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadFromByteArray()

void LineSegment::loadFromByteArray ( const uint8_t *  data)
overridevirtual

Implements Tools::ISerializable.

Definition at line 132 of file LineSegment.cc.

References m_dimension, m_pEndPoint, m_pStartPoint, and makeDimension().

Here is the call graph for this function:

◆ makeDimension()

void LineSegment::makeDimension ( uint32_t  dimension)
virtual

Definition at line 408 of file LineSegment.cc.

References m_dimension, m_pEndPoint, and m_pStartPoint.

Referenced by loadFromByteArray(), makeInfinite(), and operator=().

Here is the caller graph for this function:

◆ makeInfinite()

void LineSegment::makeInfinite ( uint32_t  dimension)
virtual

Definition at line 398 of file LineSegment.cc.

References m_dimension, m_pEndPoint, m_pStartPoint, and makeDimension().

Here is the call graph for this function:

◆ operator=()

LineSegment & LineSegment::operator= ( const LineSegment p)
virtual

Definition at line 83 of file LineSegment.cc.

References m_dimension, m_pEndPoint, m_pStartPoint, and makeDimension().

Here is the call graph for this function:

◆ operator==()

bool LineSegment::operator== ( const LineSegment p) const
virtual

Definition at line 95 of file LineSegment.cc.

References m_dimension, m_pEndPoint, and m_pStartPoint.

◆ storeToByteArray()

void LineSegment::storeToByteArray ( uint8_t **  data,
uint32_t &  length 
)
overridevirtual

Implements Tools::ISerializable.

Definition at line 145 of file LineSegment.cc.

References getByteArraySize(), m_dimension, m_pEndPoint, and m_pStartPoint.

Here is the call graph for this function:

◆ touchesShape()

bool LineSegment::touchesShape ( const IShape in) const
overridevirtual

Implements SpatialIndex::IShape.

Definition at line 180 of file LineSegment.cc.

Friends And Related Function Documentation

◆ operator<<

SIDX_DLL std::ostream& operator<< ( std::ostream &  os,
const LineSegment pt 
)
friend

◆ Point

friend class Point
friend

Definition at line 85 of file LineSegment.h.

Referenced by getCenter(), getRelativeMaximumDistance(), and intersectsLineSegment().

◆ Region

friend class Region
friend

Definition at line 84 of file LineSegment.h.

Referenced by getMBR().

Member Data Documentation

◆ m_dimension

◆ m_pEndPoint

◆ m_pStartPoint


The documentation for this class was generated from the following files: