Class used to represent the actual state of the image selected and to perform comparisons on its values. More...
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 |
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.
| 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.
{
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;
}
| 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);
}
}

| void creaImageIO::ImageExtent::Clear | ( | ) | [inline] |
| 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]; }

| 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;
}

| 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; }

int creaImageIO::ImageExtent::mDim [private] |
Definition at line 68 of file creaImageIOGimmickView.cpp.
Referenced by GetDimension(), ImageExtent(), and SetDimension().
int creaImageIO::ImageExtent::mExtent[4] [private] |
Definition at line 67 of file creaImageIOGimmickView.cpp.
Referenced by Add(), Clear(), Get(), and ImageExtent().
1.7.1