40 : m_dimension(dimension)
55 "LineSegment::LineSegment: Points have different dimensionalities." 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)
197 out =
Point(coords, m_dimension);
210 for (uint32_t cDim = 0; cDim <
m_dimension; ++cDim)
216 out =
Region(low, high, m_dimension);
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)
bool touchesShape(const IShape &in) const override
uint32_t getDimension() const override
static bool collinear(const Point &a, const Point &b, const Point &c)
double getArea() const override
void storeToByteArray(uint8_t **data, uint32_t &length) override
virtual double getRelativeMaximumDistance(const Region &r) const
virtual bool operator==(const LineSegment &p) const
virtual bool intersectsLineSegment(const LineSegment &l) const
static double doubleAreaTriangle(const Point &a, const Point &b, const Point &c)
static bool leftOf(const Point &a, const Point &b, const Point &c)
void getCenter(Point &out) const override
virtual bool intersectsRegion(const Region &p) const
LineSegment * clone() override
virtual void makeInfinite(uint32_t dimension)
bool intersectsShape(const IShape &in) const override
void loadFromByteArray(const uint8_t *data) override
SIDX_DLL std::ostream & operator<<(std::ostream &os, const Ball &ball)
double getMinimumDistance(const IShape &in) const override
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)
void getMBR(Region &out) const override
virtual double getRelativeMinimumDistance(const Point &p) const
virtual void makeDimension(uint32_t dimension)
virtual LineSegment & operator=(const LineSegment &p)
virtual double getAngleOfPerpendicularRay()
bool containsShape(const IShape &in) const override
static bool between(const Point &a, const Point &b, const Point &c)
uint32_t getByteArraySize() override
virtual bool intersectsLineSegment(const LineSegment &in) const