Commit 9fe18bfc authored by Quentin Khan's avatar Quentin Khan
Browse files

Uniform tree: add level to FBasicCell

parent 3d944a02
...@@ -35,8 +35,9 @@ ...@@ -35,8 +35,9 @@
* *
*/ */
class FBasicCell : public FAbstractSerializable { class FBasicCell : public FAbstractSerializable {
MortonIndex mortonIndex; //< Morton index (need by most elements) MortonIndex mortonIndex; ///< Morton index (need by most elements)
FTreeCoordinate coordinate; //< The position FTreeCoordinate coordinate; ///< The position
std::size_t level; ///< Level in tree
public: public:
/** Default constructor */ /** Default constructor */
...@@ -45,7 +46,15 @@ public: ...@@ -45,7 +46,15 @@ public:
/** Default destructor */ /** Default destructor */
virtual ~FBasicCell(){ virtual ~FBasicCell(){
} }
std::size_t getLevel() const {
return this->level;
}
void setLevel(std::size_t inLevel) {
this->level = inLevel;
}
/** To get the morton index */ /** To get the morton index */
MortonIndex getMortonIndex() const { MortonIndex getMortonIndex() const {
......
...@@ -101,6 +101,8 @@ protected: ...@@ -101,6 +101,8 @@ protected:
treePosition.getY() >> bottomToTop, treePosition.getY() >> bottomToTop,
treePosition.getZ() >> bottomToTop); treePosition.getZ() >> bottomToTop);
newNode->setLevel(this->subOctreePosition + indexLevel);
this->cells[indexLevel][arrayIndex] = newNode; this->cells[indexLevel][arrayIndex] = newNode;
--indexLevel; --indexLevel;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment