fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / NodeCores / Drawables / Geometry / Util / OSGIntersectKDTreeNode.h
blobe8dd840f318031cd77bf5ec686ad38c4a857cb2c
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2011 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
30 #ifndef _OSGINTERSECTKDTREENODE_H_
31 #define _OSGINTERSECTKDTREENODE_H_
33 #include "OSGConfig.h"
34 #include "OSGDrawableDef.h"
35 #include "OSGBaseTypes.h"
37 OSG_BEGIN_NAMESPACE
39 class OSG_DRAWABLE_DLLMAPPING IntersectKDTreeNode
41 public:
42 enum FlagsE
44 AxisX = 0x00,
45 AxisY = 0x01,
46 AxisZ = 0x02,
47 Leaf = 0x03
50 void setLeaf (UInt32 triCount, UInt32 triOffset );
51 void setInterior(FlagsE axis, UInt32 childOffset, Real32 split);
53 bool isLeaf (void) const;
55 UInt32 getChildOffset(void) const;
56 UInt32 getSplitAxis (void) const;
57 Real32 getSplit (void) const;
59 UInt32 getTriCount (void) const;
60 UInt32 getTriOffset (void) const;
62 private:
64 UInt32 _flags : 2; // both
65 UInt32 _count : 30; // child offset / tri count
67 union
69 UInt32 _triOffset; // leaf, triangle indices start
70 Real32 _split; // interior, split position
74 OSG_DRAWABLE_DLLMAPPING bool
75 operator==(const IntersectKDTreeNode &lhs, const IntersectKDTreeNode &rhs);
77 OSG_END_NAMESPACE
79 #include "OSGIntersectKDTreeNode.inl"
81 #endif /* _OSGINTERSECTKDTREENODE_H_ */