QUAOAR STUDIO // Mobius API
poly_Quadtree.h
1 //-----------------------------------------------------------------------------
2 // Created on: 25 June 2021
3 //-----------------------------------------------------------------------------
4 // Copyright (c) 2021-present, Sergey Slyadnev
5 // All rights reserved.
6 //
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions are met:
9 //
10 // * Redistributions of source code must retain the above copyright
11 // notice, this list of conditions and the following disclaimer.
12 // * Redistributions in binary form must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
15 // * Neither the name of Sergey Slyadnev nor the
16 // names of all contributors may be used to endorse or promote products
17 // derived from this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 // DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY
23 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //-----------------------------------------------------------------------------
30 
31 #ifndef poly_SVO_HeaderFile
32 #define poly_SVO_HeaderFile
33 
34 // Poly includes
35 #include <mobius/poly.h>
36 
37 // Core includes
38 #include <mobius/core_UV.h>
39 
40 namespace mobius {
41 
46 {
47 public:
48 
52  mobiusPoly_EXPORT static bool
53  IsValidCornerId(const size_t id);
54 
84  mobiusPoly_EXPORT static size_t
85  GetCornerID(const size_t nx,
86  const size_t ny);
87 
115  mobiusPoly_EXPORT static void
116  GetCornerLocation(const size_t id,
117  size_t& nx,
118  size_t& ny);
119 
120 public:
121 
123  mobiusPoly_EXPORT
125 
129  mobiusPoly_EXPORT
130  poly_QuadtreeNode(const t_uv& cornerMin,
131  const t_uv& cornerMax);
132 
134  mobiusPoly_EXPORT
136 
137 public:
138 
141  //mobiusPoly_EXPORT void
142  // Release();
143 
146  //mobiusPoly_EXPORT bool
147  // IsLeaf() const;
148 
151  //mobiusPoly_EXPORT bool
152  // Split();
153 
160  //mobiusPoly_EXPORT void
161  // SetChild(const size_t id, poly_SVO* pChild);
162 
167  //mobiusPoly_EXPORT poly_SVO*
168  // GetChild(const size_t id) const;
169 
175  //mobiusPoly_EXPORT poly_SVO*
176  // FindChild(const std::vector<size_t>& path) const;
177 
182  //mobiusPoly_EXPORT unsigned
183  // GetDepth0() const;
184 
195  //mobiusPoly_EXPORT double
196  // Eval(const t_xyz& P,
197  // const bool bndOnly = false) const;
198 
203  //mobiusPoly_EXPORT unsigned long long
204  // GetMemoryInBytes(int& numNodes) const;
205 
206 public:
207 
209  //const t_xyz& GetCornerMin() const
210  //{
211  // return m_cornerMin;
212  //}
213 
215  //void SetCornerMin(const t_xyz& P)
216  //{
217  // m_cornerMin = P;
218  //}
219 
221  //const t_xyz& GetCornerMax() const
222  //{
223  // return m_cornerMax;
224  //}
225 
227  //void SetCornerMax(const t_xyz& P)
228  //{
229  // m_cornerMax = P;
230  //}
231 
233  //const t_xyz& GetP0() const
234  //{
235  // return m_cornerMin;
236  //}
237 
239  //t_xyz GetP1() const
240  //{
241  // return t_xyz( m_cornerMax.X(), m_cornerMin.Y(), m_cornerMin.Z() );
242  //}
243 
245  //t_xyz GetP2() const
246  //{
247  // return t_xyz( m_cornerMin.X(), m_cornerMax.Y(), m_cornerMin.Z() );
248  //}
249 
251  //t_xyz GetP3() const
252  //{
253  // return t_xyz( m_cornerMax.X(), m_cornerMax.Y(), m_cornerMin.Z() );
254  //}
255 
257  //t_xyz GetP4() const
258  //{
259  // return t_xyz( m_cornerMin.X(), m_cornerMin.Y(), m_cornerMax.Z() );
260  //}
261 
263  //t_xyz GetP5() const
264  //{
265  // return t_xyz( m_cornerMax.X(), m_cornerMin.Y(), m_cornerMax.Z() );
266  //}
267 
269  //t_xyz GetP6() const
270  //{
271  // return t_xyz( m_cornerMin.X(), m_cornerMax.Y(), m_cornerMax.Z() );
272  //}
273 
275  //const t_xyz& GetP7() const
276  //{
277  // return m_cornerMax;
278  //}
279 
281  //double GetCellSize() const
282  //{
283  // return (m_cornerMax - m_cornerMin).Modulus();
284  //}
285 
286 protected:
287 
293  /*mobiusPoly_EXPORT void
294  getLeaves(const poly_SVO* pNode,
295  const int sm,
296  std::vector<const poly_SVO*>& leaves) const;*/
297 
298 protected:
299 
300  //poly_SVO** m_pChildren; //!< Child octree nodes (8 bytes).
301  //double m_scalars[8]; //!< Stored scalar values (64 bytes).
302 
304  // NOTICE: we store the corner points of each cell for convenience. It is
305  // not really necessary to have them here as the corners can be deduced
306  // from the root node if we know its dimensions. At the same time,
307  // we have found that the convenience of having the explicit corner
308  // points as a part of cell definition outweights the memory overheads.
309  //*/
310 
312  //t_xyz m_cornerMin; //!< Min corner of the SVO box.
313  //t_xyz m_cornerMax; //!< Max corner of the SVO box.
314 
315 };
316 
317 }
318 
319 #endif
mobius::poly_QuadtreeNode::~poly_QuadtreeNode
mobiusPoly_EXPORT ~poly_QuadtreeNode()
Dtor. It is not virtual to save 8 bytes of memory.
mobius
Defines an exception class C1 that inherits an exception class C2.
Definition: bspl_Decompose.h:41
mobius::poly_QuadtreeNode::IsValidCornerId
static mobiusPoly_EXPORT bool IsValidCornerId(const size_t id)
mobius::poly_QuadtreeNode::GetCornerLocation
static mobiusPoly_EXPORT void GetCornerLocation(const size_t id, size_t &nx, size_t &ny)
mobius::poly_QuadtreeNode::poly_QuadtreeNode
mobiusPoly_EXPORT poly_QuadtreeNode()
Default ctor.
mobius::poly_QuadtreeNode::GetCornerID
static mobiusPoly_EXPORT size_t GetCornerID(const size_t nx, const size_t ny)
mobius::core_UV
Definition: core_UV.h:42
mobius::poly_QuadtreeNode
Definition: poly_Quadtree.h:45