1
// Spatial Index Library
3
// Copyright (C) 2003 Navel Ltd.
5
// This library is free software; you can redistribute it and/or
6
// modify it under the terms of the GNU Lesser General Public
7
// License as published by the Free Software Foundation; either
8
// version 2.1 of the License, or (at your option) any later version.
10
// This library is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
// Lesser General Public License for more details.
15
// You should have received a copy of the GNU Lesser General Public
16
// License along with this library; if not, write to the Free Software
17
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
namespace SpatialIndex
26
class SIDX_DLL TimeRegion : public Region, public ITimeShape
30
TimeRegion(const double* pLow, const double* pHigh, const Tools::IInterval& ti, uint32_t dimension);
31
TimeRegion(const double* pLow, const double* pHigh, double tStart, double tEnd, uint32_t dimension);
32
TimeRegion(const Point& low, const Point& high, const Tools::IInterval& ti);
33
TimeRegion(const Point& low, const Point& high, double tStart, double tEnd);
34
TimeRegion(const Region& in, const Tools::IInterval& ti);
35
TimeRegion(const Region& in, double tStart, double tEnd);
36
TimeRegion(const TimePoint& low, const TimePoint& high);
37
TimeRegion(const TimeRegion& in);
38
virtual ~TimeRegion();
40
virtual TimeRegion& operator=(const TimeRegion& r);
41
virtual bool operator==(const TimeRegion&) const;
43
virtual bool intersectsRegionInTime(const TimeRegion& in) const;
44
virtual bool containsRegionInTime(const TimeRegion& in) const;
45
virtual bool touchesRegionInTime(const TimeRegion& in) const;
47
virtual bool containsPointInTime(const TimePoint& in) const;
48
virtual bool touchesPointInTime(const TimePoint& in) const;
50
virtual void combineRegionInTime(const TimeRegion& in);
51
virtual void getCombinedRegionInTime(TimeRegion& out, const TimeRegion& in) const;
56
virtual TimeRegion* clone();
59
// ISerializable interface
61
virtual uint32_t getByteArraySize();
62
virtual void loadFromByteArray(const byte* data);
63
virtual void storeToByteArray(byte** data, uint32_t& len);
66
// ITimeShape interface
68
virtual bool intersectsShapeInTime(const ITimeShape& in) const;
69
virtual bool intersectsShapeInTime(const Tools::IInterval& ivI, const ITimeShape& in) const;
70
virtual bool containsShapeInTime(const ITimeShape& in) const;
71
virtual bool containsShapeInTime(const Tools::IInterval& ivI, const ITimeShape& in) const;
72
virtual bool touchesShapeInTime(const ITimeShape& in) const;
73
virtual bool touchesShapeInTime(const Tools::IInterval& ivI, const ITimeShape& in) const;
74
virtual double getAreaInTime() const;
75
virtual double getAreaInTime(const Tools::IInterval& ivI) const;
76
virtual double getIntersectingAreaInTime(const ITimeShape& r) const;
77
virtual double getIntersectingAreaInTime(const Tools::IInterval& ivI, const ITimeShape& r) const;
80
// IInterval interface
82
virtual Tools::IInterval& operator=(const Tools::IInterval&);
83
virtual double getLowerBound() const;
84
virtual double getUpperBound() const;
85
virtual void setBounds(double, double);
86
virtual bool intersectsInterval(const Tools::IInterval& ti) const;
87
virtual bool intersectsInterval(Tools::IntervalType t, const double start, const double end) const;
88
virtual bool containsInterval(const Tools::IInterval& ti) const;
89
virtual Tools::IntervalType getIntervalType() const;
91
virtual void makeInfinite(uint32_t dimension);
92
virtual void makeDimension(uint32_t dimension);
98
friend SIDX_DLL std::ostream& operator<<(std::ostream& os, const TimeRegion& r);
101
SIDX_DLL std::ostream& operator<<(std::ostream& os, const TimeRegion& r);