Public Member Functions | Private Attributes

creaImageIO::ImageExtent Class Reference

Class used to represent the actual state of the image selected and to perform comparisons on its values. More...

List of all members.

Public Member Functions

 ImageExtent (const std::string &x, const std::string &y, const std::string &z, const std::string &t)
void Clear ()
 Clears the extent.
bool IsCompatible (const ImageExtent &)
 Returns true if the two extents are compatible.
void Add (const ImageExtent &)
 Adds the extent passed as a parameter to the current extent.
int Get (int i)
 Returns the ieth position of the extent.
void SetDimension (int dim)
 Returns the dimension of the current image.
int GetDimension ()
 Returns the dimension of the current image.

Private Attributes

int mExtent [4]
int mDim

Detailed Description

Class used to represent the actual state of the image selected and to perform comparisons on its values.

Definition at line 26 of file creaImageIOGimmickView.cpp.


Constructor & Destructor Documentation

creaImageIO::ImageExtent::ImageExtent ( const std::string &  x,
const std::string &  y,
const std::string &  z,
const std::string &  t 
) [inline]

Definition at line 29 of file creaImageIOGimmickView.cpp.

References mDim, and mExtent.

        {
                sscanf(x.c_str(),"%d",&mExtent[0]);
                sscanf(y.c_str(),"%d",&mExtent[1]);
                sscanf(z.c_str(),"%d",&mExtent[2]);
                sscanf(t.c_str(),"%d",&mExtent[3]);
                if(x==""){mExtent[0]=1;}
                if(y==""){mExtent[1]=1;}
                if(z==""){mExtent[2]=1;}
                if(t==""){mExtent[3]=1;}

                if (mExtent[3]>1) mDim=4;
                else if (mExtent[2]>1) mDim=3;
                else if (mExtent[1]>1) mDim=2;
                else if (mExtent[0]>1) mDim=1;
                else mDim=0;
        }


Member Function Documentation

void creaImageIO::ImageExtent::Add ( const ImageExtent ie  ) 

Adds the extent passed as a parameter to the current extent.

Definition at line 183 of file creaImageIOGimmickView.cpp.

References mExtent, and SetDimension().

  {
          ImageExtent * extent= (ImageExtent*)&ie;
          mExtent[2]+=(*extent).Get(2);
          if(mExtent[2]>1)
          {
          SetDimension(3);
          }
  }

Here is the call graph for this function:

void creaImageIO::ImageExtent::Clear (  )  [inline]

Clears the extent.

Definition at line 49 of file creaImageIOGimmickView.cpp.

References mExtent.

{ mExtent[0] = mExtent[1] = mExtent[2] = mExtent[3] = 1; }

int creaImageIO::ImageExtent::Get ( int  i  )  [inline]

Returns the ieth position of the extent.

Definition at line 58 of file creaImageIOGimmickView.cpp.

References mExtent.

Referenced by IsCompatible().

{ return mExtent[i]; }

Here is the caller graph for this function:

int creaImageIO::ImageExtent::GetDimension (  )  [inline]

Returns the dimension of the current image.

Definition at line 64 of file creaImageIOGimmickView.cpp.

References mDim.

{ return mDim; }

bool creaImageIO::ImageExtent::IsCompatible ( const ImageExtent ie  ) 

Returns true if the two extents are compatible.

Definition at line 168 of file creaImageIOGimmickView.cpp.

References Get().

  {
          bool compatible=true;
          ImageExtent * extent= (ImageExtent*)&ie;
          if((*extent).Get(0)!=Get(0)
                 || (*extent).Get(1)!=Get(1))
          {
                  compatible=false;
          }
          return compatible;
  }

Here is the call graph for this function:

void creaImageIO::ImageExtent::SetDimension ( int  dim  )  [inline]

Returns the dimension of the current image.

Definition at line 61 of file creaImageIOGimmickView.cpp.

References mDim.

Referenced by Add().

{ mDim=dim; }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 68 of file creaImageIOGimmickView.cpp.

Referenced by GetDimension(), ImageExtent(), and SetDimension().

Definition at line 67 of file creaImageIOGimmickView.cpp.

Referenced by Add(), Clear(), Get(), and ImageExtent().


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