Public Member Functions | Private Member Functions | Private Attributes

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

This is a helper class for iterating all the corners of a given box. More...

#include <mwsubdiv.h>

List of all members.

Public Member Functions

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

Private Member Functions

 mwCorners (const mwCorners< dim, coord > &)
 The copy constructor is not allowed.
mwCorners< dim, coord > & operator= (const mwCorners< 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 corner iterator.
const coord * next
 The next coordinates to return or 0 if none.

Detailed Description

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

This is a helper class for iterating all the corners of a given box.

Definition at line 425 of file mwsubdiv.h.


Constructor & Destructor Documentation

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

The only constructor allowed.

Definition at line 465 of file mwsubdiv.h.

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

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

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

The destructor.

Definition at line 491 of file mwsubdiv.h.

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

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

The copy constructor is not allowed.

Definition at line 478 of file mwsubdiv.h.

{
        return;
} /* mwCorners::mwCorners */


Member Function Documentation

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

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

Definition at line 505 of file mwsubdiv.h.

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

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

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

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

Definition at line 497 of file mwsubdiv.h.

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

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

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

The assignment operator is not allowed.

Definition at line 485 of file mwsubdiv.h.

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


Member Data Documentation

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

The coordinates of the leftmost corner of the iterated area.

Definition at line 449 of file mwsubdiv.h.

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

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

The actual corner iterator.

Definition at line 455 of file mwsubdiv.h.

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

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

The coordinates of the rightmost corner of the iterated area.

Definition at line 452 of file mwsubdiv.h.

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


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