DBOptionsAttributes * GetUintahReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; rv->SetBool("Load extra cells", true); return rv; }
DBOptionsAttributes * GetXmdvWriteOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; rv->SetBool("Export coordinates?", true); return rv; }
DBOptionsAttributes * GetPDBReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; rv->SetInt("LEOS try harder level [set to 0, 1 or 2]", 0); return rv; }
DBOptionsAttributes * GetNASTRANReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; rv->SetInt(NASTRAN_RDOPT_MAT_COUNT, 0); // Undef return rv; }
void avtTraceHistoryFilter::OutputTime(avtDataset_p ds, int time) { DBOptionsAttributes *opts = new DBOptionsAttributes(); opts->SetInt("Time", time); opts->SetInt("nTimes", atts.GetNumiter()); avtExtrudedVolWriter *wrtr = new avtExtrudedVolWriter(opts); avtDataObject_p dob; CopyTo(dob, ds); wrtr->SetInput(dob); char filename[1024]; strcpy(filename, atts.GetOutput().c_str()); avtDatabaseMetaData md; avtMeshMetaData mmd; mmd.name = "mesh"; md.AddMeshes(mmd); std::vector<std::string> vars; avtVectorMetaData vmd; vmd.name = atts.GetDisplacement(); vmd.meshName = mmd.name; md.AddVectors(vmd); //vars.push_back(vmd.name); wrtr->Write(filename, &md, vars, false); delete wrtr; delete opts; }
DBOptionsAttributes * GetVTKWriteOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; rv->SetBool("Binary format", false); return rv; }
DBOptionsAttributes * GetExtrudedVolWriteOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; rv->SetInt("Time", 0); rv->SetInt("nTimes", 1); return rv; }
DBOptionsAttributes * GetH5PartReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; rv->SetBool("Use FastBit index", true); rv->SetBool("Disable domain decomposition", false); return rv; }
DBOptionsAttributes * GetVsReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; rv->SetBool("Process Data Selections in the Reader", true); return rv; }
DBOptionsAttributes * GetFLASHReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; rv->SetBool("Show generating processor instead of refinement level", false); rv->SetBool("Use new style curve generation", true); rv->SetBool("Set up patch abutment information", true); return rv; }
DBOptionsAttributes * GetShapefileReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; rv->SetBool("Polygons as lines", false); rv->SetBool("Tessellate polygons", true); rv->SetBool("ESRI Logging", false); rv->SetBool("DBF Logging", false); return rv; }
DBOptionsAttributes * GetTecplotReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; std::vector<std::string> types; types.push_back("Guess from variable names"); types.push_back("Specify explicitly (below)"); rv->SetEnum("Method to determine coordinate axes", 0); rv->SetEnumStrings("Method to determine coordinate axes", types); rv->SetInt("X axis variable index (or -1 for none)", -1); rv->SetInt("Y axis variable index (or -1 for none)", -1); rv->SetInt("Z axis variable index (or -1 for none)", -1); return rv; }
DBOptionsAttributes * GetImageWriteOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; // // Format options // rv->SetEnum("Format", 0); vector<string> formats; formats.push_back("TIFF"); // 0 formats.push_back("PNG"); // 1 formats.push_back("JPEG"); // 2 formats.push_back("BMP"); // 3 formats.push_back("PNM"); // 4 rv->SetEnumStrings("Format", formats); rv->SetBool("Normalize [0,255]", true); rv->SetEnum("TIFF Compression", 0); vector<string> compressions; compressions.push_back("None"); // 0 compressions.push_back("PackBits"); // 1 compressions.push_back("Deflate"); // 2 rv->SetEnumStrings("TIFF Compression", compressions); rv->SetInt("JPEG Quality [0,100]", 100); return rv; }
void FileOpenOptions::SetFromNode(DataNode *parentNode) { if(parentNode == 0) return; DataNode *searchNode = parentNode->GetNode("FileOpenOptions"); if(searchNode == 0) return; DataNode *node; DataNode **children; if((node = searchNode->GetNode("typeNames")) != 0) SetTypeNames(node->AsStringVector()); if((node = searchNode->GetNode("typeIDs")) != 0) SetTypeIDs(node->AsStringVector()); // Clear all the DBOptionsAttributess if we got any. bool clearedOpenOptions = false; // Go through all of the children and construct a new // DBOptionsAttributes for each one of them. children = searchNode->GetChildren(); if(children != 0) { for(int i = 0; i < searchNode->GetNumChildren(); ++i) { if(children[i]->GetKey() == std::string("DBOptionsAttributes")) { if (!clearedOpenOptions) { ClearOpenOptions(); clearedOpenOptions = true; } DBOptionsAttributes temp; temp.SetFromNode(children[i]); AddOpenOptions(temp); } } } if((node = searchNode->GetNode("Enabled")) != 0) SetEnabled(node->AsIntVector()); if((node = searchNode->GetNode("preferredIDs")) != 0) SetPreferredIDs(node->AsStringVector()); }
DBOptionsAttributes * GetM3DC1ReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; // rv->SetInt("Number of poloidal planes", 1); rv->SetEnum("Mesh refinement", 1); vector<string> refinement; refinement.push_back("1"); refinement.push_back("2"); refinement.push_back("3"); refinement.push_back("4"); refinement.push_back("5"); refinement.push_back("6"); refinement.push_back("7"); refinement.push_back("8"); refinement.push_back("9"); refinement.push_back("10"); // refinement.push_back("Variable"); rv->SetEnumStrings("Mesh refinement", refinement); rv->SetEnum("Linear mesh data location", 0); vector<string> centering; centering.push_back("Node"); centering.push_back("Element"); rv->SetEnumStrings("Linear mesh data location", centering); rv->SetBool("Process Data Selections in the Reader", false); return rv; }
DBOptionsAttributes * GetPLOT3DReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; rv->SetBool("3D", true); rv->SetBool("Multi Grid", false); rv->SetString("Solution (Q) File Name", ""); rv->SetEnum("File Format", 1); vector<string> ff; ff.push_back("ASCII"); ff.push_back("C Binary"); ff.push_back("Fortran Binary"); rv->SetEnumStrings("File Format", ff); rv->SetBool("Big Endian", true); rv->SetBool("Double Precision", false); rv->SetBool("IBlanking", false); return rv; }
DBOptionsAttributes * GetNektarPPReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; rv->SetEnum(NEKTARPP_MESH_REFINEMENT, 0); std::vector<std::string> refinement; refinement.push_back("auto"); refinement.push_back("1"); refinement.push_back("2"); refinement.push_back("3"); refinement.push_back("4"); refinement.push_back("5"); refinement.push_back("6"); refinement.push_back("7"); refinement.push_back("8"); refinement.push_back("9"); refinement.push_back("10"); rv->SetEnumStrings(NEKTARPP_MESH_REFINEMENT, refinement); rv->SetBool(NEKTARPP_ASSUME_PLANAR_ELEMENTS, true); return rv; }
DBOptionsAttributes * GetMDSplusReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; rv->SetString("Host", "alcdata.psfc.mit.edu"); //atlas.gat.com"); rv->SetString("Tree", "CMOD"); //"NIMROD"); rv->SetInt ("Shot", 1100817001); //10089); rv->SetString("Signal", "\\ip"); rv->SetString("Mesh", "myMesh"); return rv; }
DBOptionsAttributes * GetSiloReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; vector<string> ignoreOpts; ignoreOpts.push_back("Always"); // 0 ignoreOpts.push_back("Auto"); // 1 ignoreOpts.push_back("Never"); // 2 ignoreOpts.push_back("Undef"); // 3 rv->SetEnum(SILO_RDOPT_IGNORE_SEXTS, 3); // Undef rv->SetEnumStrings(SILO_RDOPT_IGNORE_SEXTS, ignoreOpts); rv->SetEnum(SILO_RDOPT_IGNORE_DEXTS, 3); // Undef rv->SetEnumStrings(SILO_RDOPT_IGNORE_DEXTS, ignoreOpts); rv->SetBool(SILO_RDOPT_FORCE_SINGLE, false); rv->SetBool(SILO_RDOPT_SEARCH_ANNOTINT, false); // Specify obsolete options and their default values rv->SetObsolete(SILO_RDOPT_IGNORE_SEXTS2); rv->SetObsolete(SILO_RDOPT_IGNORE_DEXTS2); return rv; }
DBOptionsAttributes * GetOpenFOAMReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; rv->SetEnum("Case Type", 1); std::vector<std::string> caseType; caseType.push_back("Decomposed"); caseType.push_back("Reconstructed"); rv->SetEnumStrings("Case Type", caseType); rv->SetBool("Convert Cell Data To Point Data", false); rv->SetBool("Read Zones", false); #if 0 rv->SetBool("Positions in 1.3 Format", false); #endif return rv; }
DBOptionsAttributes * GetPlainTextReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; std::vector<std::string> types; types.push_back("1D Columns"); types.push_back("2D Array"); rv->SetEnum("Data layout", 0); rv->SetEnumStrings("Data layout", types); rv->SetInt("Lines to skip at beginning of file", 0); rv->SetBool("First row has variable names", false); rv->SetInt("Column for X coordinate (or -1 for none)", -1); rv->SetInt("Column for Y coordinate (or -1 for none)", -1); rv->SetInt("Column for Z coordinate (or -1 for none)", -1); return rv; }
DBOptionsAttributes * GetSiloWriteOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; // // Driver type options // rv->SetEnum(SILO_WROPT_DRIVER, 0); vector<string> drivers; drivers.push_back("PDB"); // 0 drivers.push_back("HDF5"); // 1 rv->SetEnumStrings(SILO_WROPT_DRIVER, drivers); rv->SetBool(SILO_WROPT_SINGLE_FILE, false); rv->SetBool(SILO_WROPT_CKSUMS, false); rv->SetString(SILO_WROPT_COMPRESSION, ""); return rv; }
DBOptionsAttributes * GetparaDISReadOptions(void) { DBOptionsAttributes *rv = new DBOptionsAttributes; // Allow user to set values by environment variables or by GUI. int useMNType = 0; char *cp = getenv("PARADIS_USE_MN_MATERIALS"); if (cp) { useMNType = atoi(cp); debug1 << "PARADIS_USE_MN_MATERIALS is " << cp << " and useMNType is " << useMNType << endl; }/* else { debug1 << "PARADIS_USE_MN_MATERIALS not found" << endl; } */ if (useMNType < 0) useMNType = 0; if (useMNType > 1) useMNType = 1; rv->SetEnum(PARADIS_MATERIAL_SET_CHOICE, useMNType); vector<string> msetchoices; msetchoices.push_back("Burgers type"); msetchoices.push_back("MN type"); rv->SetEnumStrings(PARADIS_MATERIAL_SET_CHOICE, msetchoices); double threshold = -1.0; cp = getenv("PARADIS_NN_ARM_THRESHOLD"); if (cp) threshold = atof(cp); rv->SetDouble(PARADIS_NN_ARM_THRESHOLD, threshold); int debug=0; cp = getenv("PARADIS_VERBOSITY"); if (cp) debug=atoi(cp); debug1 << "paradis debug set to " << debug << endl; rv->SetInt(PARADIS_VERBOSITY, debug); cp = getenv("PARADIS_DEBUG_FILE"); if (!cp) cp = (char*)"paradis_debug_output.log"; rv->SetString(PARADIS_DEBUG_FILE, cp); debug = 0; cp = getenv("PARADIS_ENABLE_DEBUG_OUTPUT"); if (cp) debug=atoi(cp); rv->SetBool(PARADIS_ENABLE_DEBUG_OUTPUT, debug); return rv; /* EXAMPLE OF OPTIONS rv->SetBool("Binary format", true); rv->SetBool("Big Endian", false); rv->SetEnum("Dimension", 1); vector<string> dims; dims.push_back("0D"); dims.push_back("1D"); dims.push_back("2D"); dims.push_back("3D"); rv->SetEnumStrings("Dimension", dims); rv->SetInt("Number of variables", 5); rv->SetString("Name of auxiliary file", ); rv->SetDouble("Displacement factor", 1.0); // When reading or writing the file, you can get the options out of this object like: rv->GetDouble("Displacement factor"); */ }
void DBPluginInfoAttributes::SetFromNode(DataNode *parentNode) { if(parentNode == 0) return; DataNode *searchNode = parentNode->GetNode("DBPluginInfoAttributes"); if(searchNode == 0) return; DataNode *node; DataNode **children; if((node = searchNode->GetNode("types")) != 0) SetTypes(node->AsStringVector()); if((node = searchNode->GetNode("hasWriter")) != 0) SetHasWriter(node->AsIntVector()); // Clear all the DBOptionsAttributess if we got any. bool clearedDbReadOptions = false; // Go through all of the children and construct a new // DBOptionsAttributes for each one of them. children = searchNode->GetChildren(); if(children != 0) { for(int i = 0; i < searchNode->GetNumChildren(); ++i) { if(children[i]->GetKey() == std::string("DBOptionsAttributes")) { if (!clearedDbReadOptions) { ClearDbReadOptions(); clearedDbReadOptions = true; } DBOptionsAttributes temp; temp.SetFromNode(children[i]); AddDbReadOptions(temp); } } } // Clear all the DBOptionsAttributess if we got any. bool clearedDbWriteOptions = false; // Go through all of the children and construct a new // DBOptionsAttributes for each one of them. children = searchNode->GetChildren(); if(children != 0) { for(int i = 0; i < searchNode->GetNumChildren(); ++i) { if(children[i]->GetKey() == std::string("DBOptionsAttributes")) { if (!clearedDbWriteOptions) { ClearDbWriteOptions(); clearedDbWriteOptions = true; } DBOptionsAttributes temp; temp.SetFromNode(children[i]); AddDbWriteOptions(temp); } } } if((node = searchNode->GetNode("typesFullNames")) != 0) SetTypesFullNames(node->AsStringVector()); if((node = searchNode->GetNode("license")) != 0) SetLicense(node->AsStringVector()); if((node = searchNode->GetNode("host")) != 0) SetHost(node->AsString()); }
void SiloCommonPluginInfo::SetReadOptions(DBOptionsAttributes *opts) { DBOptionsAttributes *defaultReadOptions = GetReadOptions(); for (int i = 0; i < opts->GetNumberOfOptions(); i++) { string optname = opts->GetName(i); // We only care about handling obsolete options here if (!opts->IsObsolete(optname) && !defaultReadOptions->IsObsolete(optname)) continue; if (optname == SILO_RDOPT_IGNORE_SEXTS2) { int enumval = -1; for (int j = 0; j < opts->GetNumberOfOptions(); j++) { if (opts->GetName(j) == SILO_RDOPT_IGNORE_SEXTS) { enumval = opts->GetEnum(SILO_RDOPT_IGNORE_SEXTS); break; } } if (enumval == -1 || enumval == 3) // Undef { debug1 << "Using old option \"" << SILO_RDOPT_IGNORE_SEXTS2 << "\" to set new option \"" << SILO_RDOPT_IGNORE_SEXTS; if (opts->GetBool(SILO_RDOPT_IGNORE_SEXTS2)) { debug1 << "\" to Always" << endl; opts->SetEnum(SILO_RDOPT_IGNORE_SEXTS, 0); // Always } else { debug1 << "\" to Never" << endl; opts->SetEnum(SILO_RDOPT_IGNORE_SEXTS, 2); // Never } opts->SetEnumStrings(SILO_RDOPT_IGNORE_SEXTS, defaultReadOptions->GetEnumStrings(SILO_RDOPT_IGNORE_SEXTS)); } } else if (optname == SILO_RDOPT_IGNORE_DEXTS2) { int enumval = -1; for (int j = 0; j < opts->GetNumberOfOptions(); j++) { if (opts->GetName(j) == SILO_RDOPT_IGNORE_DEXTS) { enumval = opts->GetEnum(SILO_RDOPT_IGNORE_DEXTS); break; } } if (enumval == -1 || enumval == 3) // Undef { debug1 << "Using old option \"" << SILO_RDOPT_IGNORE_DEXTS2 << "\" to set new option \"" << SILO_RDOPT_IGNORE_DEXTS; if (opts->GetBool(SILO_RDOPT_IGNORE_DEXTS2)) { debug1 << "\" to Always" << endl; opts->SetEnum(SILO_RDOPT_IGNORE_DEXTS, 0); // Always } else { debug1 << "\" to Never" << endl; opts->SetEnum(SILO_RDOPT_IGNORE_DEXTS, 2); // Never } opts->SetEnumStrings(SILO_RDOPT_IGNORE_DEXTS, defaultReadOptions->GetEnumStrings(SILO_RDOPT_IGNORE_DEXTS)); } } } delete defaultReadOptions; readOptions = opts; }