Commit e132a442 authored by berenger-bramas's avatar berenger-bramas
Browse files

Clean the creation of the new node (temp variable).

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@124 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 15e75225
......@@ -79,20 +79,22 @@ protected:
int indexLevel = this->subOctreeHeight - 1;
int bottomToTop = 0;
while(indexLevel >= 0 && !this->cells[indexLevel][arrayIndex]){
this->cells[indexLevel][arrayIndex] = new CellClass();
this->cells[indexLevel][arrayIndex]->setMortonIndex(inLeafCellIndex);
CellClass* const newNode = new CellClass();
newNode->setMortonIndex(inLeafCellIndex);
this->cells[indexLevel][arrayIndex]->setCoordinate(treePosition.getX() >> bottomToTop,
newNode->setCoordinate(treePosition.getX() >> bottomToTop,
treePosition.getY() >> bottomToTop,
treePosition.getZ() >> bottomToTop);
const int realLevel = indexLevel + this->getSubOctreePosition();
const FReal widthAtLevel = inBoxWidthAtLevel[realLevel];
this->cells[indexLevel][arrayIndex]->setPosition(F3DPosition(
newNode->setPosition(F3DPosition(
treePosition.getX() * widthAtLevel + widthAtLevel/2.0,
treePosition.getY() * widthAtLevel + widthAtLevel/2.0,
treePosition.getZ() * widthAtLevel + widthAtLevel/2.0));
this->cells[indexLevel][arrayIndex] = newNode;
--indexLevel;
++bottomToTop;
......
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