~reducedmodelling/fluidity/ROM_Non-intrusive-ann

« back to all changes in this revision

Viewing changes to include/spatialindex/TimeRegion.h

  • Committer: fangf at ac
  • Date: 2012-11-06 12:21:31 UTC
  • mto: This revision was merged to the branch mainline in revision 3989.
  • Revision ID: fangf@imperial.ac.uk-20121106122131-u2zvt7fxc1r3zeou
updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Spatial Index Library
 
2
//
 
3
// Copyright (C) 2003 Navel Ltd.
 
4
//
 
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.
 
9
//
 
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.
 
14
//
 
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
 
18
//
 
19
//  Email:
 
20
//    mhadji@gmail.com
 
21
 
 
22
#pragma once
 
23
 
 
24
namespace SpatialIndex
 
25
{
 
26
        class SIDX_DLL TimeRegion : public Region, public ITimeShape
 
27
        {
 
28
        public:
 
29
                TimeRegion();
 
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();
 
39
 
 
40
                virtual TimeRegion& operator=(const TimeRegion& r);
 
41
                virtual bool operator==(const TimeRegion&) const;
 
42
 
 
43
                virtual bool intersectsRegionInTime(const TimeRegion& in) const;
 
44
                virtual bool containsRegionInTime(const TimeRegion& in) const;
 
45
                virtual bool touchesRegionInTime(const TimeRegion& in) const;
 
46
 
 
47
                virtual bool containsPointInTime(const TimePoint& in) const;
 
48
                virtual bool touchesPointInTime(const TimePoint& in) const;
 
49
 
 
50
                virtual void combineRegionInTime(const TimeRegion& in);
 
51
                virtual void getCombinedRegionInTime(TimeRegion& out, const TimeRegion& in) const;
 
52
 
 
53
                //
 
54
                // IObject interface
 
55
                //
 
56
                virtual TimeRegion* clone();
 
57
 
 
58
                //
 
59
                // ISerializable interface
 
60
                //
 
61
                virtual uint32_t getByteArraySize();
 
62
                virtual void loadFromByteArray(const byte* data);
 
63
                virtual void storeToByteArray(byte** data, uint32_t& len);
 
64
 
 
65
                //
 
66
                // ITimeShape interface
 
67
                //
 
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;
 
78
 
 
79
                //
 
80
                // IInterval interface
 
81
                //
 
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;
 
90
 
 
91
                virtual void makeInfinite(uint32_t dimension);
 
92
                virtual void makeDimension(uint32_t dimension);
 
93
 
 
94
        public:
 
95
                double m_startTime;
 
96
                double m_endTime;
 
97
 
 
98
                friend SIDX_DLL std::ostream& operator<<(std::ostream& os, const TimeRegion& r);
 
99
        }; // TimeRegion
 
100
 
 
101
        SIDX_DLL std::ostream& operator<<(std::ostream& os, const TimeRegion& r);
 
102
}