Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
LArXOverlap.h
Go to the documentation of this file.
1
8#ifndef LAR_X_OVERLAP_H
9#define LAR_X_OVERLAP_H 1
10
11namespace lar_content
12{
13
18{
19public:
31 XOverlap(const float uMinX, const float uMaxX, const float vMinX, const float vMaxX, const float wMinX, const float wMaxX, const float xOverlapSpan);
32
38 float GetUMinX() const;
39
45 float GetUMaxX() const;
46
52 float GetVMinX() const;
53
59 float GetVMaxX() const;
60
66 float GetWMinX() const;
67
73 float GetWMaxX() const;
74
80 float GetXSpanU() const;
81
87 float GetXSpanV() const;
88
94 float GetXSpanW() const;
95
101 float GetXOverlapSpan() const;
102
103private:
104 float m_uMinX;
105 float m_uMaxX;
106 float m_vMinX;
107 float m_vMaxX;
108 float m_wMinX;
109 float m_wMaxX;
111};
112
119XOverlap operator+(const XOverlap &lhs, const XOverlap &rhs);
120
121//------------------------------------------------------------------------------------------------------------------------------------------
122
123inline XOverlap::XOverlap(const float uMinX, const float uMaxX, const float vMinX, const float vMaxX, const float wMinX, const float wMaxX,
124 const float xOverlapSpan) :
125 m_uMinX(uMinX),
126 m_uMaxX(uMaxX),
127 m_vMinX(vMinX),
128 m_vMaxX(vMaxX),
129 m_wMinX(wMinX),
130 m_wMaxX(wMaxX),
131 m_xOverlapSpan(xOverlapSpan)
132{
133}
134
135//------------------------------------------------------------------------------------------------------------------------------------------
136
137inline float XOverlap::GetUMinX() const
138{
139 return m_uMinX;
140}
141
142//------------------------------------------------------------------------------------------------------------------------------------------
143
144inline float XOverlap::GetUMaxX() const
145{
146 return m_uMaxX;
147}
148
149//------------------------------------------------------------------------------------------------------------------------------------------
150
151inline float XOverlap::GetVMinX() const
152{
153 return m_vMinX;
154}
155
156//------------------------------------------------------------------------------------------------------------------------------------------
157
158inline float XOverlap::GetVMaxX() const
159{
160 return m_vMaxX;
161}
162
163//------------------------------------------------------------------------------------------------------------------------------------------
164
165inline float XOverlap::GetWMinX() const
166{
167 return m_wMinX;
168}
169
170//------------------------------------------------------------------------------------------------------------------------------------------
171
172inline float XOverlap::GetWMaxX() const
173{
174 return m_wMaxX;
175}
176
177//------------------------------------------------------------------------------------------------------------------------------------------
178
179inline float XOverlap::GetXSpanU() const
180{
181 return std::fabs(m_uMaxX - m_uMinX);
182}
183
184//------------------------------------------------------------------------------------------------------------------------------------------
185
186inline float XOverlap::GetXSpanV() const
187{
188 return std::fabs(m_vMaxX - m_vMinX);
189}
190
191//------------------------------------------------------------------------------------------------------------------------------------------
192
193inline float XOverlap::GetXSpanW() const
194{
195 return std::fabs(m_wMaxX - m_wMinX);
196}
197
198//------------------------------------------------------------------------------------------------------------------------------------------
199
200inline float XOverlap::GetXOverlapSpan() const
201{
202 return m_xOverlapSpan;
203}
204
205//------------------------------------------------------------------------------------------------------------------------------------------
206
207inline XOverlap operator+(const XOverlap &lhs, const XOverlap &rhs)
208{
209 const float uMinX(std::min(lhs.GetUMinX(), rhs.GetUMinX()));
210 const float uMaxX(std::max(lhs.GetUMaxX(), rhs.GetUMaxX()));
211 const float vMinX(std::min(lhs.GetVMinX(), rhs.GetVMinX()));
212 const float vMaxX(std::max(lhs.GetVMaxX(), rhs.GetVMaxX()));
213 const float wMinX(std::min(lhs.GetWMinX(), rhs.GetWMinX()));
214 const float wMaxX(std::max(lhs.GetWMaxX(), rhs.GetWMaxX()));
215 const float minX(std::max(uMinX, std::max(vMinX, wMinX)));
216 const float maxX(std::min(uMaxX, std::min(vMaxX, wMaxX)));
217 const float xOverlapSpan(maxX - minX);
218
219 return XOverlap(uMinX, uMaxX, vMinX, vMaxX, wMinX, wMaxX, xOverlapSpan);
220}
221
222} // namespace lar_content
223
224#endif // #ifndef LAR_X_OVERLAP_H
XOverlap class.
Definition LArXOverlap.h:18
float GetUMinX() const
Get the min x value in the u view.
float GetXSpanV() const
Get the x span in the v view.
float m_vMaxX
The max x value in the v view.
float GetWMaxX() const
Get the max x value in the w view.
float GetXOverlapSpan() const
Get the x overlap span.
float m_xOverlapSpan
The x overlap span.
float m_wMaxX
The max x value in the w view.
float GetWMinX() const
Get the min x value in the w view.
float GetVMinX() const
Get the min x value in the v view.
float GetXSpanW() const
Get the x span in the w view.
float GetUMaxX() const
Get the max x value in the u view.
float GetVMaxX() const
Get the max x value in the v view.
float m_wMinX
The min x value in the w view.
float m_uMinX
The min x value in the u view.
float GetXSpanU() const
Get the x span in the u view.
float m_vMinX
The min x value in the v view.
XOverlap(const float uMinX, const float uMaxX, const float vMinX, const float vMaxX, const float wMinX, const float wMaxX, const float xOverlapSpan)
Constructor.
float m_uMaxX
The max x value in the u view.
TransverseOverlapResult operator+(const TransverseOverlapResult &lhs, const TransverseOverlapResult &rhs)
Transverse overlap result + operator.