Commit 255f644b authored by Libor's avatar Libor
Browse files

Buildable version.

parent 8ecc707a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -12,3 +12,6 @@ echo "Currently most important is to implement math funcs,"
echo "as the original ones are exponentially complex, in 2D"
echo "its complexity is at most 2^2, in 3D its at most 2^3 (!)"
echo "which lightweigth GPU threads won't handle."


Program fails at tnlIterator2D->computeBitmaskArray() last instruction in for loop (check whats happenning in tnlBitmaskArray->setIthMask())
+1 −1
Original line number Diff line number Diff line
g++ -g -std=c++11 tnlInternalNode.h tnlInternalNode_impl.h tnlLeafNode.h tnlLeafNode_impl.h tnlNode.h tnlNode_impl.h tnlVDBMath.h tnlRootNode_test.cpp tnlRootNode.h tnlRootNode_impl.h tnlArea2D.h tnlArea2D_impl.h tnlCircle2D.h tnlCircle2D_impl.h tnlIterator2D.h tnlIterator2D_impl.h tnlBitmaskArray.h tnlBitmaskArray_impl.h tnlBitmask.h tnlBitmask_impl.h -o test
g++ -O1 -g -Wall -std=c++11 tnlInternalNode.h tnlInternalNode_impl.h tnlLeafNode.h tnlLeafNode_impl.h tnlNode.h tnlNode_impl.h tnlVDBMath.h tnlRootNode_test.cpp tnlRootNode.h tnlRootNode_impl.h tnlArea2D.h tnlArea2D_impl.h tnlCircle2D.h tnlCircle2D_impl.h tnlIterator2D.h tnlIterator2D_impl.h tnlBitmaskArray.h tnlBitmaskArray_impl.h tnlBitmask.h tnlBitmask_impl.h -o test
+0 −2
Original line number Diff line number Diff line
@@ -33,8 +33,6 @@ bool tnlCircle2D::isIntercept( float x1,
        std::cout << "Circle is not inside area." << std::endl;

    float R = this->r * this->r;
    float A = this->a * this->a;
    float B = this->b * this->b;

    float aux = x1 - this->a;
    if( R - aux * aux >= 0 &&
+2 −3
Original line number Diff line number Diff line
@@ -4,8 +4,6 @@
#include "tnlNode.h"
#include "tnlArea2D.h"
#include "tnlCircle2D.h"
#include "tnlBitmask.h"
#include "tnlBitmaskArray.h"

//template< int LogX, int LogY >
//class tnlNode;
@@ -17,7 +15,8 @@ class tnlInternalNode : public tnlNode< LogX, LogY >
public:
    tnlInternalNode( tnlArea2D* area,
                     tnlCircle2D* circle,
                     tnlBitmask* coordinates,
                     int X,
                     int Y,
                     int level );

    void setNode( int splitX,
+15 −9
Original line number Diff line number Diff line
@@ -8,17 +8,21 @@
#include "tnlBitmask.h"
#include "tnlVDBMath.h"
#include "tnlIterator2D.h"
#include "tnlBitmaskArray.h"

template< int LogX,
          int LogY >
tnlInternalNode< LogX, LogY >::tnlInternalNode( tnlArea2D* area,
                                                tnlCircle2D* circle,
                                                tnlBitmask* coordinates,
                                                int X,
                                                int Y,
                                                int level )
{
    this->bitmaskArray = new tnlBitmaskArray< LogX * LogY >();
    this->area = area;
    this->circle = circle;
    this->coordinates = coordinates;
    this->X = X;
    this->Y = Y;
    this->level = level;
}

@@ -32,10 +36,10 @@ void tnlInternalNode< LogX, LogY >::setNode( int splitX,
    int depthY = splitY * tnlVDBMath::power( LogY, this->level );
    float stepX = ( float ) this->area->getLengthX() / depthX;
    float stepY = ( float ) this->area->getLengthY() / depthY;
    float startX = this->coordinates->getX() * stepX;
    float endX = ( this->coordinates->getX() + 1 ) * stepX;
    float startY = this->coordinates->getY() * stepY;
    float endY = ( this->coordinates->getY() + 1 ) * stepY;
    float startX = this->X * stepX;
    float endX = ( this->X + 1 ) * stepX;
    float startY = this->Y * stepY;
    float endY = ( this->Y + 1 ) * stepY;
    tnlIterator2D< LogX * LogY, LogX, LogY >* iter = 
                 new tnlIterator2D< LogX * LogY, LogX, LogY >( LogX,
                                                               LogY,
@@ -55,13 +59,14 @@ void tnlInternalNode< LogX, LogY >::setChildren( int splitX,
{
    for( int i = 0; i < LogX * LogY; i++ )
    {
        if( !this->bitmaskArray->getIthMask()->getState() )
        if( !this->bitmaskArray->getIthBitmask( i )->getState() )
            this->children[ i ] = NULL;
        else if( this->level < depth - 1 )
        {
            this->children[ i ] = new tnlInternalNode< LogX, LogY >( this->area,
                                                                     this->circle,
                                                                     this->bitmaskArray->getIthBitmask( i ),
                                                                     this->bitmaskArray->getIthBitmask( i )->getX(),
                                                                     this->bitmaskArray->getIthBitmask( i )->getY(),
                                                                     this->level + 1 );
            this->children[ i ]->setNode( splitX, splitY, depth );
        }
@@ -69,7 +74,8 @@ void tnlInternalNode< LogX, LogY >::setChildren( int splitX,
        {
            this->children[ i ] = new tnlLeafNode< LogX, LogY >( this->area,
                                                                 this->circle,
                                                                 this->bitmaskArray->getIthBitmask( i ),
                                                                 this->bitmaskArray->getIthBitmask( i )->getX(),
                                                                 this->bitmaskArray->getIthBitmask( i )->getY(),
                                                                 this->level + 1 );
            this->children[ i ]->setNode( splitX, splitY, depth );
        }
Loading