Index

NAME

IndexSetBox - box shaped index set in 1D, 2D, 3D and MD.


INCLUDE

include "IndexSetBox.h"

SYNTAX

 //-----------------------------------------------------------------------------
 class IndexSetBox : public IndexSet
 //-----------------------------------------------------------------------------
 {
 protected :

   Ptv(int) steps;

   int getNoLines (int i) const;
   virtual int  getLineNumber (const Ptv(int)& pt) const;

   virtual void computeNoIndices();

   virtual void specialStartIterator();
   virtual void specialReverseStartIterator();

 public :

   IndexSetBox () {}
   IndexSetBox (int nsd);
   IndexSetBox (const Ptv(int)& min_ind_, const Ptv(int)& max_ind_);
   IndexSetBox (const IndexSetBox& b);
   IndexSetBox (const IndexSet_prm& pm);
   virtual ~IndexSetBox () {}

   IndexSetBox& operator=(const IndexSetBox& b);

   virtual bool redim (const Ptv(int)& min_ind_,const Ptv(int)& max_ind_);
   virtual void getIndexIterator (Handle(IndexSet)& I) const;

   // get a new index line:
   virtual void specialIterate();
   virtual void specialReverseIterate();

   void setSteps(const Ptv(int)& newsteps);
   Ptv(int) getSteps() const;

   virtual void scan(Is is);
   virtual void print(Os os) const;

   CLASS_INFO

   VIRTUAL_CAST(IndexSetBox)


 };



KEYWORDS

index set, box shape



DESCRIPTION

The  class  implements a box shaped index set. It is derived from
the base class IndexSet.



CONSTRUCTORS AND INITIALIZATION

The specialized constructor takes two Ptv(int) objects,  specify­
ing the lower and upper index of the set.

Note that the scan function can be used to initalize an object.


MEMBER FUNCTIONS

Please  note  that  the inherited member functions from the class
IndexSet are described  within the documentation of IndexSet.



bool redim - redimensions the index set, specifying the lower and
upper index of the set.

void  getIndexIterator  - rebinds a new object similar to this to
the argument.

operator= - puts a IndexSetBox object equal to another.

specialIterate - will push the next index line of the set to  the
base class IndexSet.

specialReverseIterate  - same as specialIterate but the iteration
order is in reverse.

scan - reads two Ptv(int) objects base and  top  by  calling  the
Ptv(int)  objects  own  scan function, the current object is ini­
tialized by redim(base,top).  There are three formats which  scan
understand,  depending  on  the first character that is read. See
the example below.


print - print information about the index set.





EXAMPLE

#include <IndexSetBox.h>

void main()
{
  Ptv(int) b(1,1,1) , t(3,3,3);
  IndexSetBox box(b,t);
  Ptv(int) index(3);
  box.startIterator(index);        // index is  not  set  to  the
first index
  while ( box.iterate() )          // index is iterated
   {s_o<<" < "<< index <<" > "; }

  s_o << "SIZE :" << box.size() << "0;  // the total size


  box.scan("(1,1,1) (4,4,4)");      //  box :
                                    // [1,1,1]x[4,4,4]
  box.scan("2(1,1) (2,2)");

  // this format must be used if the class IndexSet_prm
  // is used to collect the parameters of the index set
  box.scan(">index_set_storage = IndexSetBox >nsd = 2 "

           ">index_set_string = (1,1)X(2,2)" );





SEE ALSO

class IndexSet, class IndexSetBoxObstacles,  class  IndexSetBoxI­
tOrder.


DEVELOPED BY

Numerical Objects AS


AUTHOR

Are Magnus Bruaset, Numerical Objects AS