QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
TimePoint.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) 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
30namespace SpatialIndex
31{
32 class SIDX_DLL TimePoint : public Point, public ITimeShape
33 {
34 public:
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);
41 virtual ~TimePoint();
42
43 virtual TimePoint& operator=(const TimePoint& p);
44 virtual bool operator==(const TimePoint& p) const;
45
46 //
47 // IObject interface
48 //
49 virtual TimePoint* clone();
50
51 //
52 // ISerializable interface
53 //
54 virtual uint32_t getByteArraySize();
55 virtual void loadFromByteArray(const byte* data);
56 virtual void storeToByteArray(byte** data, uint32_t& len);
57
58 //
59 // ITimeShape interface
60 //
61 virtual bool intersectsShapeInTime(const ITimeShape& in) const;
62 virtual bool intersectsShapeInTime(const Tools::IInterval& ivI, const ITimeShape& in) const;
63 virtual bool containsShapeInTime(const ITimeShape& in) const;
64 virtual bool containsShapeInTime(const Tools::IInterval& ivI, const ITimeShape& in) const;
65 virtual bool touchesShapeInTime(const ITimeShape& in) const;
66 virtual bool touchesShapeInTime(const Tools::IInterval& ivI, const ITimeShape& in) const;
67 virtual double getAreaInTime() const;
68 virtual double getAreaInTime(const Tools::IInterval& ivI) const;
69 virtual double getIntersectingAreaInTime(const ITimeShape& r) const;
70 virtual double getIntersectingAreaInTime(const Tools::IInterval& ivI, const ITimeShape& r) const;
71
72 //
73 // IInterval interface
74 //
76 virtual double getLowerBound() const;
77 virtual double getUpperBound() const;
78 virtual void setBounds(double, double);
79 virtual bool intersectsInterval(const Tools::IInterval& ti) const;
80 virtual bool intersectsInterval(Tools::IntervalType t, const double start, const double end) const;
81 virtual bool containsInterval(const Tools::IInterval& ti) const;
83
84 virtual void makeInfinite(uint32_t dimension);
85 virtual void makeDimension(uint32_t dimension);
86
87 public:
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}
Definition SpatialIndex.h:82
Definition Point.h:35
Definition TimePoint.h:33
virtual double getIntersectingAreaInTime(const Tools::IInterval &ivI, const ITimeShape &r) const
virtual bool intersectsInterval(Tools::IntervalType t, const double start, const double end) const
virtual void makeInfinite(uint32_t dimension)
virtual double getIntersectingAreaInTime(const ITimeShape &r) const
double m_endTime
Definition TimePoint.h:89
virtual void loadFromByteArray(const byte *data)
virtual bool operator==(const TimePoint &p) const
virtual void storeToByteArray(byte **data, uint32_t &len)
virtual bool containsShapeInTime(const ITimeShape &in) const
virtual double getAreaInTime() const
virtual TimePoint & operator=(const TimePoint &p)
virtual bool intersectsShapeInTime(const ITimeShape &in) const
virtual bool touchesShapeInTime(const ITimeShape &in) const
virtual bool touchesShapeInTime(const Tools::IInterval &ivI, const ITimeShape &in) const
virtual double getAreaInTime(const Tools::IInterval &ivI) const
double m_startTime
Definition TimePoint.h:88
virtual bool containsInterval(const Tools::IInterval &ti) const
virtual bool intersectsShapeInTime(const Tools::IInterval &ivI, const ITimeShape &in) const
virtual double getLowerBound() const
virtual bool containsShapeInTime(const Tools::IInterval &ivI, const ITimeShape &in) const
TimePoint(const double *pCoords, double tStart, double tEnd, uint32_t dimension)
virtual void setBounds(double, double)
virtual void makeDimension(uint32_t dimension)
virtual Tools::IInterval & operator=(const Tools::IInterval &)
TimePoint(const Point &p, const Tools::IInterval &ti)
friend SIDX_DLL std::ostream & operator<<(std::ostream &os, const TimePoint &pt)
virtual bool intersectsInterval(const Tools::IInterval &ti) const
virtual uint32_t getByteArraySize()
TimePoint(const Point &p, double tStart, double tEnd)
virtual TimePoint * clone()
virtual double getUpperBound() const
virtual Tools::IntervalType getIntervalType() const
TimePoint(const TimePoint &p)
TimePoint(const double *pCoords, const Tools::IInterval &ti, uint32_t dimension)
Definition Tools.h:201
Definition CustomStorage.h:34
SIDX_DLL std::ostream & operator<<(std::ostream &os, const LineSegment &pt)
IntervalType
Definition Tools.h:87
#define SIDX_DLL
Definition sidx_export.h:41