libspatialindex API Reference  (git-trunk)
TimePoint.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Project: libspatialindex - A C++ library for spatial indexing
3  * Author: Marios Hadjieleftheriou, mhadji@gmail.com
4  ******************************************************************************
5  * Copyright (c) 2004, 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 
30 namespace SpatialIndex
31 {
32  class SIDX_DLL TimePoint : public Point, public ITimeShape
33  {
34  public:
35  TimePoint();
36  TimePoint(const double* pCoords, const Tools::IInterval& ti, uint32_t dimension);
37  TimePoint(const double* pCoords, double tStart, double tEnd, uint32_t dimension);
38  TimePoint(const Point& p, const Tools::IInterval& ti);
39  TimePoint(const Point& p, double tStart, double tEnd);
40  TimePoint(const TimePoint& p);
41  ~TimePoint() override;
42 
43  virtual TimePoint& operator=(const TimePoint& p);
44  virtual bool operator==(const TimePoint& p) const;
45 
46  //
47  // IObject interface
48  //
49  TimePoint* clone() override;
50 
51  //
52  // ISerializable interface
53  //
54  uint32_t getByteArraySize() override;
55  void loadFromByteArray(const uint8_t* data) override;
56  void storeToByteArray(uint8_t** data, uint32_t& len) override;
57 
58  //
59  // ITimeShape interface
60  //
61  bool intersectsShapeInTime(const ITimeShape& in) const override;
62  bool intersectsShapeInTime(const Tools::IInterval& ivI, const ITimeShape& in) const override;
63  bool containsShapeInTime(const ITimeShape& in) const override;
64  bool containsShapeInTime(const Tools::IInterval& ivI, const ITimeShape& in) const override;
65  bool touchesShapeInTime(const ITimeShape& in) const override;
66  bool touchesShapeInTime(const Tools::IInterval& ivI, const ITimeShape& in) const override;
67  double getAreaInTime() const override;
68  double getAreaInTime(const Tools::IInterval& ivI) const override;
69  double getIntersectingAreaInTime(const ITimeShape& r) const override;
70  double getIntersectingAreaInTime(const Tools::IInterval& ivI, const ITimeShape& r) const override;
71 
72  //
73  // IInterval interface
74  //
75  virtual Tools::IInterval& operator=(const Tools::IInterval&);
76  double getLowerBound() const override;
77  double getUpperBound() const override;
78  void setBounds(double, double) override;
79  bool intersectsInterval(const Tools::IInterval& ti) const override;
80  bool intersectsInterval(Tools::IntervalType t, const double start, const double end) const override;
81  bool containsInterval(const Tools::IInterval& ti) const override;
82  Tools::IntervalType getIntervalType() const override;
83 
84  void makeInfinite(uint32_t dimension) override;
85  void makeDimension(uint32_t dimension) override;
86 
87  public:
88  double m_startTime;
89  double m_endTime;
90 
91  friend SIDX_DLL std::ostream& operator<<(std::ostream& os, const TimePoint& pt);
92  }; // TimePoint
93 
94  SIDX_DLL std::ostream& operator<<(std::ostream& os, const TimePoint& pt);
95 }
bool containsShapeInTime(const Tools::IInterval &ivI, const ITimeShape &in) const override
double getIntersectingAreaInTime(const Tools::IInterval &ivI, const ITimeShape &r) const override
bool touchesShapeInTime(const Tools::IInterval &ivI, const ITimeShape &in) const override
bool intersectsInterval(const Tools::IInterval &ti) const override
bool intersectsShapeInTime(const Tools::IInterval &ivI, const ITimeShape &in) const override
double getAreaInTime(const Tools::IInterval &ivI) const override
TimePoint(const Point &p, const Tools::IInterval &ti)
friend SIDX_DLL std::ostream & operator<<(std::ostream &os, const TimePoint &pt)
TimePoint(const double *pCoords, const Tools::IInterval &ti, uint32_t dimension)
SIDX_DLL std::ostream & operator<<(std::ostream &os, const Ball &ball)
Definition: Ball.cc:215
IntervalType
Definition: Tools.h:81
#define SIDX_DLL
Definition: sidx_export.h:41