Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

void Impala::Application::Im::DoDump (  ) 

Definition at line 38 of file mainIm.cpp.

References Impala::Core::Array::ARRAY2DSCALARREAL64, Impala::Core::Array::ARRAY2DSCALARUINT8, Impala::Core::Array::ARRAY2DVEC2REAL64, Impala::Core::Array::ARRAY2DVEC3UINT8, Impala::CmdOptions::GetArg(), Impala::Util::Database::GetInstance(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetNrArg(), ILOG_ERROR, ILOG_VAR, Impala::Core::Array::PrintData(), Impala::Core::Array::ReadRaw(), Impala::Core::Array::ReadRawArrayType(), Impala::Core::Array::Set(), and Impala::Core::Array::WriteRaw().

Referenced by mainIm().

00039 {
00040     ILOG_VAR(Impala.Application.Im.DoDump);
00041     CmdOptions& options = CmdOptions::GetInstance();
00042     if (options.GetNrArg() < 2)
00043     {
00044         ILOG_ERROR("Need more arguments");
00045         return;
00046     }
00047     Util::Database* db = &Util::Database::GetInstance();
00048 
00049     String fileName = options.GetArg(1);
00050     bool doGenesis = false;
00051     if (options.GetNrArg() >= 3)
00052         doGenesis = true;
00053 
00054     // todo : -rect arg
00055 
00056     ArrayType aType = ReadRawArrayType(fileName, db);
00057     switch (aType)
00058     {
00059         case ARRAY2DSCALARUINT8: {
00060             Array2dScalarUInt8* a = 0;
00061             ReadRaw(a, fileName, db);
00062             PrintData(a, false, 0, 0, 10, 10);
00063             delete a;
00064             break;
00065         }
00066         case ARRAY2DSCALARREAL64: {
00067             Array2dScalarReal64* a = 0;
00068             ReadRaw(a, fileName, db);
00069             PrintData(a, false);
00070             if (doGenesis)
00071                 WriteRaw(a, "real64_b.raw", db, 1);
00072             //
00073             Array2dScalarInt32* b = 0;
00074             Set(b, a);
00075             PrintData(b, false);
00076             if (doGenesis)
00077                 WriteRaw(b, "int32.raw", db, 0);
00078 
00079             Array2dVec3UInt8* c = 0;
00080             Set(c, b);
00081             PrintData(c, false);
00082             if (doGenesis)
00083                 WriteRaw(c, "vec3uint8.raw", db, 0);
00084 
00085             Array2dComplex64* d = 0;
00086             Set(d, a);
00087             PrintData(d, false);
00088             if (doGenesis)
00089                 WriteRaw(d, "complex64.raw", db, 0);
00090             //
00091             delete a;
00092             break;
00093         }
00094         case ARRAY2DVEC3UINT8: {
00095             Array2dVec3UInt8* a = 0;
00096             ReadRaw(a, fileName, db);
00097             PrintData(a, false);
00098             if (doGenesis)
00099                 WriteRaw(a, "vec3uint8_b.raw", db, 1);
00100             delete a;
00101             break;
00102         }
00103         case ARRAY2DVEC2REAL64: { // we assume this to be complex
00104             Array2dComplex64* a = 0;
00105             ReadRaw(a, fileName, db);
00106             PrintData(a, false);
00107             if (doGenesis)
00108                 WriteRaw(a, "complex64_b.raw", db, 1);
00109             delete a;
00110             break;
00111         }
00112         default:
00113             ILOG_ERROR("Unknown ArrayType");
00114     }
00115 }

Here is the call graph for this function:


Generated on Thu Jan 13 09:15:12 2011 for ImpalaSrc by  doxygen 1.5.1