An update will be applied December 9th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit f291de49 authored by whitlocb's avatar whitlocb
Browse files

turn off curve name filtering except for netcdf reader.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@11345 18c085ea-50e0-402c-830e-de6fd14e8384
parent e40e637b
This diff is collapsed.
......@@ -432,6 +432,9 @@ Definition:
// Dave Pugmire, Thu Mar 4 10:27:17 EST 2010
// Added support for curves.
//
// Brad Whitlock, Tue May 11 14:50:46 PDT 2010
// Check replacementMask before doing character replacement.
//
// ****************************************************************************
static bool IsForbidden(std::string &origName, std::string &newName,
......@@ -475,7 +478,6 @@ static bool IsForbidden(std::string &origName, std::string &newName,
return shouldReplace;
}
void
avtDatabaseMetaData::ReplaceForbiddenCharacters(std::vector<char> &badChars,
stringVector &replacementStr)
......@@ -484,182 +486,218 @@ avtDatabaseMetaData::ReplaceForbiddenCharacters(std::vector<char> &badChars,
std::string replacementName;
for (i = 0 ; i < GetNumMeshes() ; i++)
if((replacementMask & VAR_CATEGORY_MESH) > 0)
{
if (GetMeshes(i).originalName == "")
GetMeshes(i).originalName = GetMeshes(i).name;
if (IsForbidden(GetMeshes(i).originalName, replacementName, badChars,
replacementStr))
for (i = 0 ; i < GetNumMeshes() ; i++)
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetMeshes(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetMeshes(i).name = replacementName;
if (GetMeshes(i).originalName == "")
GetMeshes(i).originalName = GetMeshes(i).name;
if (IsForbidden(GetMeshes(i).originalName, replacementName, badChars,
replacementStr))
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetMeshes(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetMeshes(i).name = replacementName;
}
}
}
for (i = 0 ; i < GetNumScalars() ; i++)
if((replacementMask & VAR_CATEGORY_SCALAR) > 0)
{
if (GetScalars(i).originalName == "")
GetScalars(i).originalName = GetScalars(i).name;
if (IsForbidden(GetScalars(i).originalName, replacementName, badChars,
replacementStr))
for (i = 0 ; i < GetNumScalars() ; i++)
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetScalars(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetScalars(i).name = replacementName;
if (GetScalars(i).originalName == "")
GetScalars(i).originalName = GetScalars(i).name;
if (IsForbidden(GetScalars(i).originalName, replacementName, badChars,
replacementStr))
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetScalars(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetScalars(i).name = replacementName;
}
if (IsForbidden(GetScalars(i).meshName, replacementName, badChars,
replacementStr))
GetScalars(i).meshName = replacementName;
}
if (IsForbidden(GetScalars(i).meshName, replacementName, badChars,
replacementStr))
GetScalars(i).meshName = replacementName;
}
for (i = 0 ; i < GetNumVectors() ; i++)
if((replacementMask & VAR_CATEGORY_VECTOR) > 0)
{
if (GetVectors(i).originalName == "")
GetVectors(i).originalName = GetVectors(i).name;
if (IsForbidden(GetVectors(i).originalName, replacementName, badChars,
replacementStr))
for (i = 0 ; i < GetNumVectors() ; i++)
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetVectors(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetVectors(i).name = replacementName;
if (GetVectors(i).originalName == "")
GetVectors(i).originalName = GetVectors(i).name;
if (IsForbidden(GetVectors(i).originalName, replacementName, badChars,
replacementStr))
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetVectors(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetVectors(i).name = replacementName;
}
if (IsForbidden(GetVectors(i).meshName, replacementName, badChars,
replacementStr))
GetVectors(i).meshName = replacementName;
}
if (IsForbidden(GetVectors(i).meshName, replacementName, badChars,
replacementStr))
GetVectors(i).meshName = replacementName;
}
for (i = 0 ; i < GetNumTensors() ; i++)
if((replacementMask & VAR_CATEGORY_TENSOR) > 0)
{
if (GetTensors(i).originalName == "")
GetTensors(i).originalName = GetTensors(i).name;
if (IsForbidden(GetTensors(i).originalName, replacementName, badChars,
replacementStr))
for (i = 0 ; i < GetNumTensors() ; i++)
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetTensors(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetTensors(i).name = replacementName;
if (GetTensors(i).originalName == "")
GetTensors(i).originalName = GetTensors(i).name;
if (IsForbidden(GetTensors(i).originalName, replacementName, badChars,
replacementStr))
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetTensors(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetTensors(i).name = replacementName;
}
if (IsForbidden(GetTensors(i).meshName, replacementName, badChars,
replacementStr))
GetTensors(i).meshName = replacementName;
}
if (IsForbidden(GetTensors(i).meshName, replacementName, badChars,
replacementStr))
GetTensors(i).meshName = replacementName;
}
for (i = 0 ; i < GetNumSymmTensors() ; i++)
if((replacementMask & VAR_CATEGORY_SYMMETRIC_TENSOR) > 0)
{
if (GetSymmTensors(i).originalName == "")
GetSymmTensors(i).originalName = GetSymmTensors(i).name;
if (IsForbidden(GetSymmTensors(i).originalName, replacementName,
badChars, replacementStr))
for (i = 0 ; i < GetNumSymmTensors() ; i++)
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetSymmTensors(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetSymmTensors(i).name = replacementName;
if (GetSymmTensors(i).originalName == "")
GetSymmTensors(i).originalName = GetSymmTensors(i).name;
if (IsForbidden(GetSymmTensors(i).originalName, replacementName,
badChars, replacementStr))
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetSymmTensors(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetSymmTensors(i).name = replacementName;
}
if (IsForbidden(GetSymmTensors(i).meshName, replacementName, badChars,
replacementStr))
GetSymmTensors(i).meshName = replacementName;
}
if (IsForbidden(GetSymmTensors(i).meshName, replacementName, badChars,
replacementStr))
GetSymmTensors(i).meshName = replacementName;
}
for (i = 0 ; i < GetNumArrays() ; i++)
if((replacementMask & VAR_CATEGORY_ARRAY) > 0)
{
if (GetArrays(i).originalName == "")
GetArrays(i).originalName = GetArrays(i).name;
if (IsForbidden(GetArrays(i).originalName, replacementName, badChars,
replacementStr))
for (i = 0 ; i < GetNumArrays() ; i++)
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetArrays(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetArrays(i).name = replacementName;
if (GetArrays(i).originalName == "")
GetArrays(i).originalName = GetArrays(i).name;
if (IsForbidden(GetArrays(i).originalName, replacementName, badChars,
replacementStr))
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetArrays(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetArrays(i).name = replacementName;
}
if (IsForbidden(GetArrays(i).meshName, replacementName, badChars,
replacementStr))
GetArrays(i).meshName = replacementName;
}
if (IsForbidden(GetArrays(i).meshName, replacementName, badChars,
replacementStr))
GetArrays(i).meshName = replacementName;
}
for (i = 0 ; i < GetNumMaterials() ; i++)
if((replacementMask & VAR_CATEGORY_MATERIAL) > 0)
{
if (GetMaterials(i).originalName == "")
GetMaterials(i).originalName = GetMaterials(i).name;
if (IsForbidden(GetMaterials(i).originalName, replacementName, badChars,
replacementStr))
for (i = 0 ; i < GetNumMaterials() ; i++)
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetMaterials(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetMaterials(i).name = replacementName;
if (GetMaterials(i).originalName == "")
GetMaterials(i).originalName = GetMaterials(i).name;
if (IsForbidden(GetMaterials(i).originalName, replacementName, badChars,
replacementStr))
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetMaterials(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetMaterials(i).name = replacementName;
}
if (IsForbidden(GetMaterials(i).meshName, replacementName, badChars,
replacementStr))
GetMaterials(i).meshName = replacementName;
}
if (IsForbidden(GetMaterials(i).meshName, replacementName, badChars,
replacementStr))
GetMaterials(i).meshName = replacementName;
}
for (i = 0; i < GetNumCurves(); i++)
if((replacementMask & VAR_CATEGORY_CURVE) > 0)
{
if (GetCurves(i).originalName == "")
GetCurves(i).originalName = GetCurves(i).name;
if (IsForbidden(GetCurves(i).originalName, replacementName, badChars,
replacementStr))
for (i = 0; i < GetNumCurves(); i++)
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetCurves(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetCurves(i).name = replacementName;
if (GetCurves(i).originalName == "")
GetCurves(i).originalName = GetCurves(i).name;
if (IsForbidden(GetCurves(i).originalName, replacementName, badChars,
replacementStr))
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetCurves(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetCurves(i).name = replacementName;
}
}
}
for (i = 0 ; i < GetNumLabels() ; i++)
if((replacementMask & VAR_CATEGORY_LABEL) > 0)
{
if (GetLabels(i).originalName == "")
GetLabels(i).originalName = GetLabels(i).name;
if (IsForbidden(GetLabels(i).originalName, replacementName, badChars,
replacementStr))
for (i = 0 ; i < GetNumLabels() ; i++)
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetLabels(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetLabels(i).name = replacementName;
if (GetLabels(i).originalName == "")
GetLabels(i).originalName = GetLabels(i).name;
if (IsForbidden(GetLabels(i).originalName, replacementName, badChars,
replacementStr))
{
char msg[1024];
SNPRINTF(msg, 1024, "The database contains an object named \"%s\""
", which contains characters not supported by "
"VisIt. VisIt is renaming it to \"%s\"",
GetLabels(i).originalName.c_str(),
replacementName.c_str());
IssueWarning(msg);
GetLabels(i).name = replacementName;
}
if (IsForbidden(GetLabels(i).meshName, replacementName, badChars,
replacementStr))
GetLabels(i).meshName = replacementName;
}
if (IsForbidden(GetLabels(i).meshName, replacementName, badChars,
replacementStr))
GetLabels(i).meshName = replacementName;
}
}
Function: Add1
Declaration: void Add(avtMeshMetaData *);
Definition:
......
......@@ -163,6 +163,7 @@ public:
void SetIsSimulation(bool isSimulation_);
void SetSimInfo(const avtSimulationInformation &simInfo_);
void SetSuggestedDefaultSILRestriction(const stringVector &suggestedDefaultSILRestriction_);
void SetReplacementMask(int replacementMask_);
// Property getting methods
bool GetHasTemporalExtents() const;
......@@ -223,6 +224,7 @@ public:
avtSimulationInformation &GetSimInfo();
const stringVector &GetSuggestedDefaultSILRestriction() const;
stringVector &GetSuggestedDefaultSILRestriction();
int GetReplacementMask() const;
// Attributegroup convenience methods
......@@ -430,6 +432,7 @@ public:
ID_isSimulation,
ID_simInfo,
ID_suggestedDefaultSILRestriction,
ID_replacementMask,
ID__LAST
};
......@@ -470,11 +473,12 @@ private:
bool isSimulation;
avtSimulationInformation simInfo;
stringVector suggestedDefaultSILRestriction;
int replacementMask;
// Static class format string for type map.
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define AVTDATABASEMETADATA_TMFS "bddibbbbbss*i*i*d*i*sssaa*a*a*a*a*a*a*a*a*a*a*a*bas*"
#define AVTDATABASEMETADATA_TMFS "bddibbbbbss*i*i*d*i*sssaa*a*a*a*a*a*a*a*a*a*a*a*bas*i"
#endif
......@@ -78,6 +78,9 @@
</Field>
<Field name="suggestedDefaultSILRestriction" label="Description of default SIL restriction for plots suggested by database plugin" type="stringVector">
</Field>
<Field name="replacementMask" label="-1 and not VAR_CATEGORY_CURVE = -65" type="int">
-65
</Field>
<Function name="SetNumStates" user="false" member="true">
</Function>
<Function name="SetTemporalExtents" user="true" member="true">
......@@ -312,4 +315,7 @@
<Include file="source" quoted="false">
snprintf.h
</Include>
<Include file="source" quoted="false">
plugin_vartypes.h
</Include>
</Attribute>
......@@ -187,7 +187,10 @@ avtBasic_MTSD_NETCDFFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md
{
reader->PopulateDatabaseMetaData(timeState, md);
if(md != 0)
{
md->SetDatabaseComment(std::string("Read using Basic NETCDF MT reader\n") + md->GetDatabaseComment());
md->SetReplacementMask(-1);
}
}
////////////////////////////////////////////////////////////////////////////////
......@@ -408,7 +411,10 @@ avtBasic_STSD_NETCDFFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md
{
reader->PopulateDatabaseMetaData(0, md);
if(md != 0)
{
md->SetDatabaseComment(std::string("Read using Basic NETCDF ST reader\n") + md->GetDatabaseComment());
md->SetReplacementMask(-1);
}
}
// ****************************************************************************
......
......@@ -59,7 +59,7 @@ import java.lang.Double;
public class avtDatabaseMetaData extends AttributeSubject
{
private static int avtDatabaseMetaData_numAdditionalAtts = 34;
private static int avtDatabaseMetaData_numAdditionalAtts = 35;
public avtDatabaseMetaData()
{
......@@ -99,6 +99,7 @@ public class avtDatabaseMetaData extends AttributeSubject
isSimulation = false;
simInfo = new avtSimulationInformation();
suggestedDefaultSILRestriction = new Vector();
replacementMask = -65;
}
public avtDatabaseMetaData(int nMoreFields)
......@@ -139,6 +140,7 @@ public class avtDatabaseMetaData extends AttributeSubject
isSimulation = false;
simInfo = new avtSimulationInformation();
suggestedDefaultSILRestriction = new Vector();
replacementMask = -65;
}
public avtDatabaseMetaData(avtDatabaseMetaData obj)
......@@ -292,6 +294,7 @@ public class avtDatabaseMetaData extends AttributeSubject
for(i = 0; i < obj.suggestedDefaultSILRestriction.size(); ++i)
suggestedDefaultSILRestriction.addElement(new String((String)obj.suggestedDefaultSILRestriction.elementAt(i)));
replacementMask = obj.replacementMask;
SelectAll();
}
......@@ -506,7 +509,8 @@ public class avtDatabaseMetaData extends AttributeSubject
defaultPlots_equal &&
(isSimulation == obj.isSimulation) &&
(simInfo.equals(obj.simInfo)) &&
suggestedDefaultSILRestriction_equal);
suggestedDefaultSILRestriction_equal &&
(replacementMask == obj.replacementMask));
}
// Property setting methods
......@@ -642,6 +646,12 @@ public class avtDatabaseMetaData extends AttributeSubject
Select(33);
}
public void SetReplacementMask(int replacementMask_)
{
replacementMask = replacementMask_;
Select(34);
}
// Property getting methods
public boolean GetHasTemporalExtents() { return hasTemporalExtents; }
public double GetMinTemporalExtents() { return minTemporalExtents; }
......@@ -677,6 +687,7 @@ public class avtDatabaseMetaData extends AttributeSubject
public boolean GetIsSimulation() { return isSimulation; }
public avtSimulationInformation GetSimInfo() { return simInfo; }
public Vector GetSuggestedDefaultSILRestriction() { return suggestedDefaultSILRestriction; }
public int GetReplacementMask() { return replacementMask; }
// Write and read methods.
public void WriteAtts(CommunicationBuffer buf)
......@@ -833,6 +844,8 @@ public class avtDatabaseMetaData extends AttributeSubject
simInfo.Write(buf);
if(WriteSelect(33, buf))
buf.WriteStringVector(suggestedDefaultSILRestriction);
if(WriteSelect(34, buf))
buf.WriteInt(replacementMask);
}
public void ReadAtts(int index, CommunicationBuffer buf)
......@@ -1063,6 +1076,9 @@ public class avtDatabaseMetaData extends AttributeSubject
case 33:
SetSuggestedDefaultSILRestriction(buf.ReadStringVector());
break;
case 34:
SetReplacementMask(buf.ReadInt());
break;
}
}
......@@ -1211,6 +1227,7 @@ public class avtDatabaseMetaData extends AttributeSubject
str = str + boolToString("isSimulation", isSimulation, indent) + "\n";
str = str + indent + "simInfo = {\n" + simInfo.toString(indent + " ") + indent + "}\n";
str = str + stringVectorToString("suggestedDefaultSILRestriction", suggestedDefaultSILRestriction, indent) + "\n";
str = str + intToString("replacementMask", replacementMask, indent) + "\n";
return str;
}
......@@ -1635,5 +1652,6 @@ public class avtDatabaseMetaData extends AttributeSubject
private boolean isSimulation;
private avtSimulationInformation simInfo;
private Vector suggestedDefaultSILRestriction; // vector of String objects
private int replacementMask;
}
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