The Original CHomP Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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>

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

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 424 of file mwsubdiv.h.

Constructor & Destructor Documentation

◆ mwCorners() [1/2]

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

The only constructor allowed.

Definition at line 464 of file mwsubdiv.h.

465{
466 q. coord (this -> left);
467 for (int i = 0; i < dim; ++ i)
468 {
469 this -> right [i] = left [i] + 2;
470 }
471 this -> rect = tRectangle<coord> (this -> left, this -> right, dim);
472 this -> next = this -> rect. get ();
473 return;
474} /* mwCorners::mwCorners */
tCubeFix< dim, coord > get()
Returns the next available corner or throws an error message if all the corners have already been tak...
Definition: mwsubdiv.h:496
coord left[dim]
The coordinates of the leftmost corner of the iterated area.
Definition: mwsubdiv.h:448
tRectangle< coord > rect
The actual corner iterator.
Definition: mwsubdiv.h:454
coord right[dim]
The coordinates of the rightmost corner of the iterated area.
Definition: mwsubdiv.h:451
const coord * next
The next coordinates to return or 0 if none.
Definition: mwsubdiv.h:457

◆ ~mwCorners()

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

The destructor.

Definition at line 490 of file mwsubdiv.h.

491{
492 return;
493} /* mwCorners::~mwCorners */

◆ mwCorners() [2/2]

template<int dim, class coord >
chomp::multiwork::mwCorners< dim, coord >::mwCorners ( const mwCorners< dim, coord > &  )
inlineprivate

The copy constructor is not allowed.

Definition at line 477 of file mwsubdiv.h.

478{
479 return;
480} /* mwCorners::mwCorners */

Member Function Documentation

◆ available()

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

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

Definition at line 504 of file mwsubdiv.h.

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

◆ get()

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 496 of file mwsubdiv.h.

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

◆ operator=()

template<int dim, class coord >
mwCorners< dim, coord > & chomp::multiwork::mwCorners< dim, coord >::operator= ( const mwCorners< dim, coord > &  )
inlineprivate

The assignment operator is not allowed.

Definition at line 483 of file mwsubdiv.h.

485{
486 return *this;
487} /* mwCorners::operator = */

Member Data Documentation

◆ left

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 448 of file mwsubdiv.h.

◆ next

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

The next coordinates to return or 0 if none.

Definition at line 457 of file mwsubdiv.h.

◆ rect

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

The actual corner iterator.

Definition at line 454 of file mwsubdiv.h.

◆ right

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 451 of file mwsubdiv.h.


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