40 : m_dimension(dimension)
51 : m_dimension(startPoint.m_dimension)
55 "LineSegment::LineSegment: Points have different dimensionalities."
67 : m_dimension(l.m_dimension)
99 "LineSegment::operator==: LineSegments have different number of dimensions."
129 return (
sizeof(uint32_t) +
m_dimension *
sizeof(
double) * 2);
135 memcpy(&dimension, ptr,
sizeof(uint32_t));
136 ptr +=
sizeof(uint32_t);
148 *data =
new uint8_t[len];
149 uint8_t* ptr = *data;
152 ptr +=
sizeof(uint32_t);
171 "LineSegment::intersectsShape: Not implemented yet!"
183 "LineSegment::touchesShape: Not implemented yet!"
190 for (uint32_t cDim = 0; cDim <
m_dimension; ++cDim)
210 for (uint32_t cDim = 0; cDim <
m_dimension; ++cDim)
228 const Point* ppt =
dynamic_cast<const Point*
>(&s);
243 "LineSegment::getMinimumDistance: Not implemented yet!"
251 "LineSegment::getMinimumDistance: Use an Interval instead."
256 "LineSegment::getMinimumDistance: Distance for high dimensional spaces not supported!"
272 return std::abs((x2 - x1) * (y1 - y0) - (x1 - x0) * (y2 - y1)) / (std::sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)));
279 "LineSegment::intersectsRegion: only supported for 2 dimensions"
284 "LineSegment::intersectsRegion: LineSegment and Region have different number of dimensions."
294 "LineSegment::intersectsLineSegment: only supported for 2 dimensions"
299 "LineSegment::intersectsLineSegment: LineSegments have different number of dimensions."
303 Point p1, p2, p3, p4;
316 "LineSegment::getRelativeMinimumDistance: Use an Interval instead."
321 "LineSegment::getRelativeMinimumDistance: Distance for high dimensional spaces not supported!"
345 return ((x1 - x0) * (y2 - y1) - (x2 - x1) * (y1 - y0)) / (std::sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)));
352 "LineSegment::getRelativeMaximumDistance: Use an Interval instead."
357 "LineSegment::getRelativeMaximumDistance: Distance for high dimensional spaces not supported!"
374 return std::max(d1, std::max(d2, std::max(d3, d4)));
381 "LineSegment::getAngleOfPerpendicularRay: Use an Interval instead."
386 "LineSegment::getAngleOfPerpendicularRay: Distance for high dimensional spaces not supported!"
401 for (uint32_t cIndex = 0; cIndex <
m_dimension; ++cIndex)
404 m_pEndPoint[cIndex] = std::numeric_limits<double>::max();
428 double *pA, *pB, *pC;
430 return (((pB[0] - pA[0]) * (pC[1] - pA[1])) - ((pC[0] - pA[0]) * (pB[1] - pA[1])));
458 double *pA, *pB, *pC;
460 if ( pA[0] != pB[0] ) {
461 return between(pA[0], pB[0], pC[0]);
463 return between(pA[1], pB[1], pC[1]);
468 return ( ((a <= c) && (c <= b)) || ((a >= c) && (c >= b)) );
487 for (uint32_t cDim = 0; cDim < l.
m_dimension; ++cDim)
double getArea() const override
virtual LineSegment & operator=(const LineSegment &p)
static bool leftOf(const Point &a, const Point &b, const Point &c)
static bool between(const Point &a, const Point &b, const Point &c)
uint32_t getDimension() const override
void getMBR(Region &out) const override
static bool intersects(const Point &a, const Point &b, const Point &c, const Point &d)
void loadFromByteArray(const uint8_t *data) override
bool touchesShape(const IShape &in) const override
double getMinimumDistance(const IShape &in) const override
virtual double getAngleOfPerpendicularRay()
virtual void makeInfinite(uint32_t dimension)
void getCenter(Point &out) const override
virtual double getRelativeMinimumDistance(const Point &p) const
virtual bool operator==(const LineSegment &p) const
virtual bool intersectsLineSegment(const LineSegment &l) const
virtual void makeDimension(uint32_t dimension)
virtual double getRelativeMaximumDistance(const Region &r) const
static bool collinear(const Point &a, const Point &b, const Point &c)
bool intersectsShape(const IShape &in) const override
virtual bool intersectsRegion(const Region &p) const
uint32_t getByteArraySize() override
LineSegment * clone() override
bool containsShape(const IShape &in) const override
static bool intersectsProper(const Point &a, const Point &b, const Point &c, const Point &d)
static double doubleAreaTriangle(const Point &a, const Point &b, const Point &c)
void storeToByteArray(uint8_t **data, uint32_t &length) override
virtual bool intersectsLineSegment(const LineSegment &in) const
SIDX_DLL std::ostream & operator<<(std::ostream &os, const Ball &ball)