libjbt

compound.h

This is the verbatim text of the compound.h include file.

#ifndef jbt_compound_h
#define jbt_compound_h

#include "object.h"


class jbt_compound : public jbt_object
{
private:

    struct st
    {
        st( jbt_blobtree*, st* );
        ~st();
        jbt_blobtree* o;
        st* n;
    } *f, *l;
    friend class iter;

public:


    void addSubTree( jbt_blobtree* );


    bool removeSubTree( jbt_blobtree* );
    

    jbt_blobtree* removeSubTree( int );


    class iter
    {
    public:

        iter( const jbt_compound* c) { n=c->f; }


        jbt_blobtree* object() { return n ? n->o : 0; }


        operator bool() const { return n!=0; }


        void operator ++() { if(n) n=n->n; }

    private:
        jbt_compound::st* n;
    };

protected:
    jbt_compound();
    ~jbt_compound();    

    void beginQuery( const jVec3& );

    void bracket( const jRay&, jbt_brackets& );

    void seedPoints( jVec3list& ) const;


    virtual bool spanCSG( const jVec3&, const jVec3& );

    void remove( st*, st* );

private:
    friend class iter;
};

#endif

JSP / libjbt v0.1 mtigges@cpsc.ucalgary.ca