Public Member Functions | Private Member Functions | Private Attributes

chomp::multiwork::mwBoxes< dim, coord > Class Template Reference

This is a helper class for iterating all the boxes which share a given vertex. More...

#include <mwsubdiv.h>

List of all members.

Public Member Functions

 mwBoxes (const tCubeFix< dim, coord > &q)
 The only constructor allowed.
 ~mwBoxes ()
 The destructor.
tCubeFix< dim, coord > get ()
 Returns the next available box or throws an error message if all the boxes have already been taken.
bool available () const
 Returns true iff there is at least one more box available.

Private Member Functions

 mwBoxes (const mwBoxes< dim, coord > &)
 The copy constructor is not allowed.
mwBoxes< dim, coord > & operator= (const mwBoxes< dim, coord > &)
 The assignment operator is not allowed.

Private Attributes

coord left [dim]
 The coordinates of the leftmost corner of the iterated area.
coord right [dim]
 The coordinates of the rightmost corner of the iterated area.
tRectangle< coord > rect
 The actual box iterator.
const coord * next
 The next coordinates to return or 0 if none.

Detailed Description

template<int dim, class coord>
class chomp::multiwork::mwBoxes< dim, coord >

This is a helper class for iterating all the boxes which share a given vertex.

Definition at line 331 of file mwsubdiv.h.


Constructor & Destructor Documentation

template<int dim, class coord >
chomp::multiwork::mwBoxes< dim, coord >::mwBoxes ( const tCubeFix< dim, coord > &  q  )  [inline]

The only constructor allowed.

Definition at line 371 of file mwsubdiv.h.

References chomp::multiwork::mwBoxes< dim, coord >::left, chomp::multiwork::mwBoxes< dim, coord >::next, chomp::multiwork::mwBoxes< dim, coord >::rect, and chomp::multiwork::mwBoxes< dim, coord >::right.

{
        q. coord (this -> left);
        for (int i = 0; i < dim; ++ i)
        {
                this -> right [i] = left [i] + 1;
                -- (this -> left [i]);
        }
        this -> rect = tRectangle<coord> (this -> left, this -> right, dim);
        this -> next = this -> rect. get ();
        return;
} /* mwBoxes::mwBoxes */

template<int dim, class coord >
chomp::multiwork::mwBoxes< dim, coord >::~mwBoxes (  )  [inline]

The destructor.

Definition at line 398 of file mwsubdiv.h.

{
        return;
} /* mwBoxes::~mwBoxes */

template<int dim, class coord >
chomp::multiwork::mwBoxes< dim, coord >::mwBoxes ( const mwBoxes< dim, coord > &   )  [inline, private]

The copy constructor is not allowed.

Definition at line 385 of file mwsubdiv.h.

{
        return;
} /* mwBoxes::mwBoxes */


Member Function Documentation

template<int dim, class coord >
bool chomp::multiwork::mwBoxes< dim, coord >::available (  )  const [inline]

Returns true iff there is at least one more box available.

Definition at line 412 of file mwsubdiv.h.

References chomp::multiwork::mwBoxes< dim, coord >::next.

{
        return !!(this -> next);
} /* mwBoxes::available */

template<int dim, class coord >
tCubeFix< dim, coord > chomp::multiwork::mwBoxes< dim, coord >::get (  )  [inline]

Returns the next available box or throws an error message if all the boxes have already been taken.

Definition at line 404 of file mwsubdiv.h.

References chomp::multiwork::mwBoxes< dim, coord >::next, and chomp::multiwork::mwBoxes< dim, coord >::rect.

{
        const coord *current = this -> next;
        this -> next = this -> rect. get ();
        return tCubeFix<dim,coord> (current, dim);
} /* mwBoxes::get */

template<int dim, class coord >
mwBoxes< dim, coord > & chomp::multiwork::mwBoxes< dim, coord >::operator= ( const mwBoxes< dim, coord > &   )  [inline, private]

The assignment operator is not allowed.

Definition at line 392 of file mwsubdiv.h.

{
        return *this;
} /* mwBoxes::operator = */


Member Data Documentation

template<int dim, class coord>
coord chomp::multiwork::mwBoxes< dim, coord >::left[dim] [private]

The coordinates of the leftmost corner of the iterated area.

Definition at line 355 of file mwsubdiv.h.

Referenced by chomp::multiwork::mwBoxes< dim, coord >::mwBoxes().

template<int dim, class coord>
const coord* chomp::multiwork::mwBoxes< dim, coord >::next [private]
template<int dim, class coord>
tRectangle<coord> chomp::multiwork::mwBoxes< dim, coord >::rect [private]

The actual box iterator.

Definition at line 361 of file mwsubdiv.h.

Referenced by chomp::multiwork::mwBoxes< dim, coord >::get(), and chomp::multiwork::mwBoxes< dim, coord >::mwBoxes().

template<int dim, class coord>
coord chomp::multiwork::mwBoxes< dim, coord >::right[dim] [private]

The coordinates of the rightmost corner of the iterated area.

Definition at line 358 of file mwsubdiv.h.

Referenced by chomp::multiwork::mwBoxes< dim, coord >::mwBoxes().


The documentation for this class was generated from the following file: