QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
TimeRegion.h
Go to the documentation of this file.
1/******************************************************************************
2 * Project: libspatialindex - A C++ library for spatial indexing
3 * Author: Marios Hadjieleftheriou, [email protected]
4 ******************************************************************************
5 * Copyright (c) 2003, Marios Hadjieleftheriou
6 *
7 * All rights reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 * DEALINGS IN THE SOFTWARE.
26******************************************************************************/
27
28#pragma once
29
30namespace SpatialIndex
31{
32 class SIDX_DLL TimeRegion : public Region, public ITimeShape
33 {
34 public:
36 TimeRegion(const double* pLow, const double* pHigh, const Tools::IInterval& ti, uint32_t dimension);
37 TimeRegion(const double* pLow, const double* pHigh, double tStart, double tEnd, uint32_t dimension);
38 TimeRegion(const Point& low, const Point& high, const Tools::IInterval& ti);
39 TimeRegion(const Point& low, const Point& high, double tStart, double tEnd);
40 TimeRegion(const Region& in, const Tools::IInterval& ti);
41 TimeRegion(const Region& in, double tStart, double tEnd);
42 TimeRegion(const TimePoint& low, const TimePoint& high);
44 virtual ~TimeRegion();
45
46 virtual TimeRegion& operator=(const TimeRegion& r);
47 virtual bool operator==(const TimeRegion&) const;
48
49 virtual bool intersectsRegionInTime(const TimeRegion& in) const;
50 virtual bool containsRegionInTime(const TimeRegion& in) const;
51 virtual bool touchesRegionInTime(const TimeRegion& in) const;
52
53 virtual bool containsPointInTime(const TimePoint& in) const;
54 virtual bool touchesPointInTime(const TimePoint& in) const;
55
56 virtual void combineRegionInTime(const TimeRegion& in);
57 virtual void getCombinedRegionInTime(TimeRegion& out, const TimeRegion& in) const;
58
59 //
60 // IObject interface
61 //
62 virtual TimeRegion* clone();
63
64 //
65 // ISerializable interface
66 //
67 virtual uint32_t getByteArraySize();
68 virtual void loadFromByteArray(const byte* data);
69 virtual void storeToByteArray(byte** data, uint32_t& len);
70
71 //
72 // ITimeShape interface
73 //
74 virtual bool intersectsShapeInTime(const ITimeShape& in) const;
75 virtual bool intersectsShapeInTime(const Tools::IInterval& ivI, const ITimeShape& in) const;
76 virtual bool containsShapeInTime(const ITimeShape& in) const;
77 virtual bool containsShapeInTime(const Tools::IInterval& ivI, const ITimeShape& in) const;
78 virtual bool touchesShapeInTime(const ITimeShape& in) const;
79 virtual bool touchesShapeInTime(const Tools::IInterval& ivI, const ITimeShape& in) const;
80 virtual double getAreaInTime() const;
81 virtual double getAreaInTime(const Tools::IInterval& ivI) const;
82 virtual double getIntersectingAreaInTime(const ITimeShape& r) const;
83 virtual double getIntersectingAreaInTime(const Tools::IInterval& ivI, const ITimeShape& r) const;
84
85 //
86 // IInterval interface
87 //
89 virtual double getLowerBound() const;
90 virtual double getUpperBound() const;
91 virtual void setBounds(double, double);
92 virtual bool intersectsInterval(const Tools::IInterval& ti) const;
93 virtual bool intersectsInterval(Tools::IntervalType t, const double start, const double end) const;
94 virtual bool containsInterval(const Tools::IInterval& ti) const;
96
97 virtual void makeInfinite(uint32_t dimension);
98 virtual void makeDimension(uint32_t dimension);
99
100 public:
102 double m_endTime;
103
104 friend SIDX_DLL std::ostream& operator<<(std::ostream& os, const TimeRegion& r);
105 }; // TimeRegion
106
108 SIDX_DLL std::ostream& operator<<(std::ostream& os, const TimeRegion& r);
109}
Definition SpatialIndex.h:82
Definition Point.h:35
Definition Region.h:33
Definition TimePoint.h:33
Definition TimeRegion.h:33
virtual double getAreaInTime(const Tools::IInterval &ivI) const
TimeRegion(const Region &in, double tStart, double tEnd)
virtual bool intersectsInterval(Tools::IntervalType t, const double start, const double end) const
TimeRegion(const Region &in, const Tools::IInterval &ti)
TimeRegion(const TimeRegion &in)
TimeRegion(const double *pLow, const double *pHigh, const Tools::IInterval &ti, uint32_t dimension)
virtual double getIntersectingAreaInTime(const Tools::IInterval &ivI, const ITimeShape &r) const
TimeRegion(const TimePoint &low, const TimePoint &high)
virtual void combineRegionInTime(const TimeRegion &in)
virtual bool containsPointInTime(const TimePoint &in) const
virtual Tools::IInterval & operator=(const Tools::IInterval &)
virtual double getUpperBound() const
virtual bool containsInterval(const Tools::IInterval &ti) const
virtual bool intersectsRegionInTime(const TimeRegion &in) const
TimeRegion(const double *pLow, const double *pHigh, double tStart, double tEnd, uint32_t dimension)
virtual bool touchesRegionInTime(const TimeRegion &in) const
virtual bool intersectsShapeInTime(const ITimeShape &in) const
virtual double getIntersectingAreaInTime(const ITimeShape &r) const
double m_endTime
Definition TimeRegion.h:102
virtual bool touchesShapeInTime(const Tools::IInterval &ivI, const ITimeShape &in) const
TimeRegion(const Point &low, const Point &high, const Tools::IInterval &ti)
virtual bool touchesPointInTime(const TimePoint &in) const
double m_startTime
Definition TimeRegion.h:101
virtual TimeRegion & operator=(const TimeRegion &r)
virtual void setBounds(double, double)
virtual double getAreaInTime() const
virtual void makeInfinite(uint32_t dimension)
virtual bool operator==(const TimeRegion &) const
virtual bool touchesShapeInTime(const ITimeShape &in) const
virtual bool containsRegionInTime(const TimeRegion &in) const
virtual bool containsShapeInTime(const Tools::IInterval &ivI, const ITimeShape &in) const
virtual TimeRegion * clone()
virtual Tools::IntervalType getIntervalType() const
virtual void storeToByteArray(byte **data, uint32_t &len)
virtual void loadFromByteArray(const byte *data)
virtual uint32_t getByteArraySize()
virtual bool intersectsShapeInTime(const Tools::IInterval &ivI, const ITimeShape &in) const
virtual double getLowerBound() const
virtual bool intersectsInterval(const Tools::IInterval &ti) const
virtual bool containsShapeInTime(const ITimeShape &in) const
virtual void makeDimension(uint32_t dimension)
friend SIDX_DLL std::ostream & operator<<(std::ostream &os, const TimeRegion &r)
virtual void getCombinedRegionInTime(TimeRegion &out, const TimeRegion &in) const
TimeRegion(const Point &low, const Point &high, double tStart, double tEnd)
Definition Tools.h:201
Definition PoolPointer.h:37
Definition CustomStorage.h:34
SIDX_DLL std::ostream & operator<<(std::ostream &os, const LineSegment &pt)
Tools::PoolPointer< TimeRegion > TimeRegionPtr
Definition TimeRegion.h:107
IntervalType
Definition Tools.h:87
#define SIDX_DLL
Definition sidx_export.h:41