Loading src/mesh/vdb/tnlBitmaskArray.h +0 −2 Original line number Diff line number Diff line Loading @@ -9,8 +9,6 @@ class tnlBitmaskArray public: tnlBitmaskArray( unsigned size ); ~tnlBitmaskArray(); private: Loading src/mesh/vdb/tnlIterator2D.h +17 −14 Original line number Diff line number Diff line #ifndef _TNLITERATOR2D_H_INCLUDED_ #define _TNLITERATOR2D_H_INCLUDED_ #include <tnlBitmaskArray.h> #include "tnlBitmaskArray.h" #include "tnlCircle2D.h" class tnlIterator2D { public: tnlIterator2D( unsigned logX, unsigned logY, unsigned parentX = 0, unsigned parentY = 0, unsigned level = 0 ); tnlIterator2D( unsigned cellsX, unsigned cellsY, float stepX, float stepY, float startX, float startY ); void computeBitmaskArray( tnlBitmaskArray bitmaskArray, unsigned size ); void computeBitmaskArray( tnlBitmaskArray &bitmaskArray, tnlCircle2D &circle ); ~tnlIterator2D(){}; private: unsigned level; unsigned parentX; unsigned parentY; unsigned logX; unsigned logY; unsigned cellsX; unsigned cellsY; float stepX; float stepY; float startX; float startY; }; #include <tnlIterator2D_impl.h> #include "tnlIterator2D_impl.h" #endif // _TNLITERATOR2D_H_INCLUDED_ src/mesh/vdb/tnlIterator2D_impl.h +31 −14 Original line number Diff line number Diff line #ifndef _TNLITERATOR2D_IMPL_H_INCLUDED_ #define _TNLITERATOR2D_IMPL_H_INCLUDED_ #include <tnlIterator2D.h> #include "tnlIterator2D.h" #include "tnlBitmaskArray.h" #include "tnlBitmask.h" #include "tnlCircle2D.h" tnlIterator2D::tnlIterator2D( unsigned logX, unsigned logY, unsigned parentX = 0, unsigned parentY = 0, unsigned level = 0 ); tnlIterator2D::tnlIterator2D( unsigned cellsX, unsigned cellsY, float stepX, float stepY, float startX, float startY ); { this->level = level; this->parentX = parentX; this->parentY = parentY; this->logX = logX; this->logY = logY; this->cellsX = cellsX; this->cellsY = cellsY; this->stepX = stepX; this->stepY = stepY; this->startX = startX; this->startY = startY; } void tnlIterator2D::computeBitmaskArray( tnlBitmaskArray bitmaskArray, unsigned size ); void tnlIterator2D::computeBitmaskArray( tnlBitmaskArray &bitmaskArray, tnlCircle2D &circle ) { // TODO // yeah, in matrix, i like to iterate over rows first for( int i = 0; i < this->cellsY; i++ ) for( int j = 0; j < this->cellsX; j++ ) { float x1 = this->startX + j * this->stepX; float x2 = this->startX + ( j + 1 ) * this->stepX; float y1 = this->startY + i * this->stepY; float y2 = this->startY + ( i + 1 ) * this->stepY; bool state = circle->isIntercept( x1, x2, y1, y2 ); bitmaskArray[ i * this->cellsX + j * this->cellsX ] = new tnlBitmask( state, j, i ); } } Loading Loading
src/mesh/vdb/tnlBitmaskArray.h +0 −2 Original line number Diff line number Diff line Loading @@ -9,8 +9,6 @@ class tnlBitmaskArray public: tnlBitmaskArray( unsigned size ); ~tnlBitmaskArray(); private: Loading
src/mesh/vdb/tnlIterator2D.h +17 −14 Original line number Diff line number Diff line #ifndef _TNLITERATOR2D_H_INCLUDED_ #define _TNLITERATOR2D_H_INCLUDED_ #include <tnlBitmaskArray.h> #include "tnlBitmaskArray.h" #include "tnlCircle2D.h" class tnlIterator2D { public: tnlIterator2D( unsigned logX, unsigned logY, unsigned parentX = 0, unsigned parentY = 0, unsigned level = 0 ); tnlIterator2D( unsigned cellsX, unsigned cellsY, float stepX, float stepY, float startX, float startY ); void computeBitmaskArray( tnlBitmaskArray bitmaskArray, unsigned size ); void computeBitmaskArray( tnlBitmaskArray &bitmaskArray, tnlCircle2D &circle ); ~tnlIterator2D(){}; private: unsigned level; unsigned parentX; unsigned parentY; unsigned logX; unsigned logY; unsigned cellsX; unsigned cellsY; float stepX; float stepY; float startX; float startY; }; #include <tnlIterator2D_impl.h> #include "tnlIterator2D_impl.h" #endif // _TNLITERATOR2D_H_INCLUDED_
src/mesh/vdb/tnlIterator2D_impl.h +31 −14 Original line number Diff line number Diff line #ifndef _TNLITERATOR2D_IMPL_H_INCLUDED_ #define _TNLITERATOR2D_IMPL_H_INCLUDED_ #include <tnlIterator2D.h> #include "tnlIterator2D.h" #include "tnlBitmaskArray.h" #include "tnlBitmask.h" #include "tnlCircle2D.h" tnlIterator2D::tnlIterator2D( unsigned logX, unsigned logY, unsigned parentX = 0, unsigned parentY = 0, unsigned level = 0 ); tnlIterator2D::tnlIterator2D( unsigned cellsX, unsigned cellsY, float stepX, float stepY, float startX, float startY ); { this->level = level; this->parentX = parentX; this->parentY = parentY; this->logX = logX; this->logY = logY; this->cellsX = cellsX; this->cellsY = cellsY; this->stepX = stepX; this->stepY = stepY; this->startX = startX; this->startY = startY; } void tnlIterator2D::computeBitmaskArray( tnlBitmaskArray bitmaskArray, unsigned size ); void tnlIterator2D::computeBitmaskArray( tnlBitmaskArray &bitmaskArray, tnlCircle2D &circle ) { // TODO // yeah, in matrix, i like to iterate over rows first for( int i = 0; i < this->cellsY; i++ ) for( int j = 0; j < this->cellsX; j++ ) { float x1 = this->startX + j * this->stepX; float x2 = this->startX + ( j + 1 ) * this->stepX; float y1 = this->startY + i * this->stepY; float y2 = this->startY + ( i + 1 ) * this->stepY; bool state = circle->isIntercept( x1, x2, y1, y2 ); bitmaskArray[ i * this->cellsX + j * this->cellsX ] = new tnlBitmask( state, j, i ); } } Loading