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

Public Member Functions

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

Private Member Functions

 mwBoxes (const mwBoxes< dim, coord > &)
 The copy constructor is not allowed. More...
 
mwBoxes< dim, coord > & operator= (const mwBoxes< 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 box 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::mwBoxes< dim, coord >

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

Definition at line 330 of file mwsubdiv.h.

Constructor & Destructor Documentation

◆ mwBoxes() [1/2]

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

The only constructor allowed.

Definition at line 370 of file mwsubdiv.h.

371{
372 q. coord (this -> left);
373 for (int i = 0; i < dim; ++ i)
374 {
375 this -> right [i] = left [i] + 1;
376 -- (this -> left [i]);
377 }
378 this -> rect = tRectangle<coord> (this -> left, this -> right, dim);
379 this -> next = this -> rect. get ();
380 return;
381} /* mwBoxes::mwBoxes */
tRectangle< coord > rect
The actual box iterator.
Definition: mwsubdiv.h:360
coord left[dim]
The coordinates of the leftmost corner of the iterated area.
Definition: mwsubdiv.h:354
const coord * next
The next coordinates to return or 0 if none.
Definition: mwsubdiv.h:363
tCubeFix< dim, coord > get()
Returns the next available box or throws an error message if all the boxes have already been taken.
Definition: mwsubdiv.h:403
coord right[dim]
The coordinates of the rightmost corner of the iterated area.
Definition: mwsubdiv.h:357

◆ ~mwBoxes()

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

The destructor.

Definition at line 397 of file mwsubdiv.h.

398{
399 return;
400} /* mwBoxes::~mwBoxes */

◆ mwBoxes() [2/2]

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

The copy constructor is not allowed.

Definition at line 384 of file mwsubdiv.h.

385{
386 return;
387} /* mwBoxes::mwBoxes */

Member Function Documentation

◆ available()

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

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

Definition at line 411 of file mwsubdiv.h.

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

◆ get()

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

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

◆ operator=()

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

The assignment operator is not allowed.

Definition at line 390 of file mwsubdiv.h.

392{
393 return *this;
394} /* mwBoxes::operator = */

Member Data Documentation

◆ left

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

◆ next

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

The next coordinates to return or 0 if none.

Definition at line 363 of file mwsubdiv.h.

◆ rect

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

The actual box iterator.

Definition at line 360 of file mwsubdiv.h.

◆ right

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


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