Commit 14e4b2a2 authored by hrchilds's avatar hrchilds

Update from July 18, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@503 18c085ea-50e0-402c-830e-de6fd14e8384
parent 9648c150
......@@ -4802,6 +4802,9 @@ avtDatabaseMetaData::SetFormatCanDoDomainDecomposition(bool can)
// Added code to make sure num blocks is 1 if
// formatCanDoDomainDecomposition is true
//
// Mark C. Miller, Mon Jul 18 13:41:13 PDT 2005
// Added code to assure topological dimension is zero if its a point
// mesh. VisIt has subtle problems with pipeline if it is not.
//
// ****************************************************************************
......@@ -4814,8 +4817,17 @@ avtDatabaseMetaData::Add(avtMeshMetaData *mmd)
"other than a single block in formats that do their own domain "
"decomposition.");
}
meshes.push_back(mmd);
if (mmd->meshType == AVT_POINT_MESH && mmd->topologicalDimension != 0)
{
// we shouldn't modify the caller's object, so make a copy
avtMeshMetaData tmpmmd(*mmd);
tmpmmd.topologicalDimension = 0;
meshes.push_back(&tmpmmd);
}
else
{
meshes.push_back(mmd);
}
}
......
......@@ -261,6 +261,10 @@ avtFileFormat::SetCache(avtVariableCache *c)
// Hank Childs, Sun Jun 16 19:55:52 PDT 200
// Initialized cell origin.
//
// Mark C. Miller, Mon Jul 18 13:41:13 PDT 2005
// Added code to assure topo is zero if its a point mesh. VisIt has
// subtle problems in the pipeline if it is not.
//
// ****************************************************************************
void
......@@ -268,6 +272,8 @@ avtFileFormat::AddMeshToMetaData(avtDatabaseMetaData *md, string name,
avtMeshType type, const float *extents,
int blocks, int origin, int spatial, int topo)
{
if (type == AVT_POINT_MESH)
topo = 0;
avtMeshMetaData *mesh = new avtMeshMetaData;
mesh->name = name;
mesh->meshType = type;
......
This diff is collapsed.
......@@ -19,6 +19,7 @@ extern "C" {
class avtMaterial;
class vtkDataArray;
class vtkUnstructuredGrid;
class vtkFloatArray;
using std::vector;
......@@ -58,6 +59,9 @@ using std::vector;
// Mark C. Miller, Tue May 17 18:48:38 PDT 2005
// Added timeState arg to PopulateDatabaseMetaData to satisfy new interface
//
// Mark C. Miller, Mon Jul 18 13:41:13 PDT 2005
// Added CanCacheVariable since we handle caching of "param arrays" here
// in the plugin and added data members to handle free nodes mesh
// ****************************************************************************
class avtMiliFileFormat : public avtMTMDFileFormat
......@@ -84,6 +88,8 @@ class avtMiliFileFormat : public avtMTMDFileFormat
virtual void FreeUpResources(void);
virtual bool CanCacheVariable(const char *varname);
protected:
char *famroot;
char *fampath;
......@@ -99,6 +105,10 @@ class avtMiliFileFormat : public avtMTMDFileFormat
vector<bool> readMesh;
int dims;
int *free_nodes;
int free_nodes_ts;
int num_free_nodes;
vector<vector<int> > nnodes;
vector<vector<int> > ncells;
vector<vector<vtkUnstructuredGrid *> > connectivity;
......@@ -110,6 +120,7 @@ class avtMiliFileFormat : public avtMTMDFileFormat
vector<vector< int > > connectivity_offset;
vector<vector< int > > group_mesh_associations;
vector< std::string > known_param_arrays;
vector< std::string > vars;
vector< avtCentering > centering;
vector< vector< vector<bool> > > vars_valid;
......@@ -129,6 +140,8 @@ class avtMiliFileFormat : public avtMTMDFileFormat
int GetVariableIndex(const char *, int mesh_id);
void GetSizeInfoForGroup(const char *, int &, int &, int);
vtkFloatArray *RestrictVarToFreeNodes(vtkFloatArray *, int ts) const;
void DecodeMultiMeshVarname(const std::string &,
std::string &, int &);
......
......@@ -286,6 +286,8 @@ int GetNumDomains()
// Akira Haddox, Fri Jul 25 10:49:57 PDT 2003
// Added variable dimensionality.
//
// Mark C. Miller, Mon Jul 18 13:41:13 PDT 2005
// Added logic to look for data in "param arrays"
// ***************************************************************************
void ReadDomain(int dom, MiliInfo &mi)
......@@ -479,6 +481,56 @@ void ReadDomain(int dom, MiliInfo &mi)
}
}
}
//
// Mili 1.09 defines some "param arrays" that may be read as mesh
// variables. However, the interface to access them isn't as complete
// as the interface for state vars. We don't know which mesh they
// go with and we don't know their centering. Here, we use apriori
// knowledge to specify centering and we just associate them
// with every mesh.
//
static vector<int> paramVarTypes;
static vector<string> paramVarNames;
if (mesh_id == 0)
{
//
// Ok, deal with known named "param arrays"
//
vector<string> knownpas;
knownpas.push_back("Nodal Mass");
knownpas.push_back("Nodal Volume");
for (i = 0; i < knownpas.size(); i++)
{
//
// Alas, Mili doesn't permit us to simply query for existence
// of a param array. We need to actually attempt to read it and
// if successful we will have done problem-sized I/O
//
void *values;
if (mc_read_param_array(dbid, (char*) knownpas[i].c_str(), &values) == OK)
{
free(values);
string paVarName = "params/" + knownpas[i];
paramVarNames.push_back(paVarName);
if (strstr(knownpas[i].c_str(), "Nodal") != 0)
paramVarTypes.push_back(AVT_NODECENT);
else
paramVarTypes.push_back(AVT_ZONECENT);
}
}
}
if (paramVarNames.size() > 0)
{
for (i = 0; i < paramVarNames.size(); i++)
{
mi.varNames[mesh_id].push_back(paramVarNames[i]);
mi.varCentering[mesh_id].push_back(paramVarTypes[i]);
mi.varType[mesh_id].push_back(AVT_SCALAR_VAR);
mi.varDimension[mesh_id].push_back(1);
}
}
}
//
......
......@@ -160,6 +160,9 @@ using std::string;
// Made parent be a pointer, added clients, viewerState, inputConnection,
// clientMethod, clientInformation, clientInformationList.
//
// Hank Childs, Mon Jul 18 16:00:32 PDT 2005
// Initialize qt_argv.
//
// ****************************************************************************
ViewerSubject::ViewerSubject() : xfer(), clients(), viewerRPC(),
......@@ -270,6 +273,7 @@ ViewerSubject::ViewerSubject() : xfer(), clients(), viewerRPC(),
messageBuffer = 0;
messagePipe[0] = -1; messagePipe[1] = -1;
pluginAtts = 0;
qt_argv = NULL;
viewerSubject = this; // FIX_ME Hack, this should be removed.
}
......@@ -294,6 +298,9 @@ ViewerSubject::ViewerSubject() : xfer(), clients(), viewerRPC(),
// Added viewerState, inputConnection, clientMethod, clientInformation
// clientInformationList, and movieAtts.
//
// Hank Childs, Mon Jul 18 16:00:32 PDT 2005
// Free qt_argv.
//
// ****************************************************************************
ViewerSubject::~ViewerSubject()
......@@ -324,6 +331,9 @@ ViewerSubject::~ViewerSubject()
delete viewerState;
delete inputConnection;
if (qt_argv != NULL)
delete [] qt_argv;
}
// ****************************************************************************
......@@ -368,6 +378,12 @@ ViewerSubject::~ViewerSubject()
// Brad Whitlock, Mon May 2 14:04:44 PST 2005
// I made parent be a pointer so we can donate it to another object later.
//
// Hank Childs, Mon Jul 18 16:00:32 PDT 2005
// Instead of creating a temporary argv pointer and freeing it immediately
// after sending it down to Qt, create a more permanent one, since Qt
// does *not* make a copy of the argv that is passed into it. So if we
// free that buffer right away, Qt may have a dangling pointer.
//
// ****************************************************************************
void
......@@ -410,7 +426,11 @@ ViewerSubject::Connect(int *argc, char ***argv)
argv2[*argc+2] = NULL;
mainApp = new QApplication(argc2, argv2, !nowin);
CustomizeAppearance();
delete [] argv2;
qt_argv = argv2;
// Do not delete argv2, since Qt did not make a copy. qt_argv will be
// deleted in the destructor.
//delete [] argv2;
#ifdef Q_WS_MACX
// Prevent the viewer from having anything in its menubar.
......
......@@ -369,6 +369,9 @@ struct avtDefaultPlotMetaData;
// the engine manager to check for interruption. Added movieAtts so they
// can be kept in sync between multiple clients.
//
// Hank Childs, Mon Jul 18 16:00:32 PDT 2005
// Add qt_argv, which cannot be deleted until the program exits.
//
// ****************************************************************************
class VIEWER_API ViewerSubject : public QObject
......@@ -628,6 +631,7 @@ private:
bool noconfig;
bool defaultStereoToOn;
char *configFileName;
char **qt_argv;
ViewerPlotFactory *plotFactory;
ViewerOperatorFactory *operatorFactory;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment