Commit c1dbaf9b authored by whitlocb's avatar whitlocb

Force CQ to use a Parallel Coordinates plot's database instead of its

intermediate data object so CQ works. This works around PC's funky filter that
does not preserve enough information for CQ to operate. This resolves #816.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@16136 18c085ea-50e0-402c-830e-de6fd14e8384
parent ad76bced
......@@ -209,20 +209,23 @@ avtNamedSelectionManager::CreateNamedSelection(avtDataObject_p dob,
// logic, for example the parallel coordinates filter.
//
const std::string &selName = selProps.GetName();
avtNamedSelection *ns = dob->GetSource()->CreateNamedSelection(contract,
selName);
if (ns != NULL)
avtNamedSelection *ns = NULL;
if(selProps.GetSelectionType() == SelectionProperties::BasicSelection)
{
int curSize = selList.size();
selList.resize(curSize+1);
selList[curSize] = ns;
//
// Save out the named selection in case of engine crash /
// save/restore session, etc.
//
SaveNamedSelection(selName, true);
return;
ns = dob->GetSource()->CreateNamedSelection(contract, selName);
if (ns != NULL)
{
int curSize = selList.size();
selList.resize(curSize+1);
selList[curSize] = ns;
//
// Save out the named selection in case of engine crash /
// save/restore session, etc.
//
SaveNamedSelection(selName, true);
return;
}
}
//
......
......@@ -341,6 +341,8 @@ class PLOTTER_API avtPlot
virtual avtFilter *GetFilterForTopOfPipeline() { return 0; }
virtual bool CompatibleWithCumulativeQuery() const { return true; }
protected:
bool needsRecalculation;
int index;
......
......@@ -14,7 +14,7 @@ SET(VISITARCH i386-apple-darwin10_gcc-4.2)
##
## Specify the location of the mesa.
##
VISIT_OPTION_DEFAULT(VISIT_MESA_DIR ${VISITHOME}/mesa/7.10.2.old/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_MESA_DIR ${VISITHOME}/mesa/7.8.2/${VISITARCH})
##
## Specify the location of the vtk.
......
......@@ -620,6 +620,12 @@ CumulativeQuery::CalculateFrequency(const SelectionProperties &props,
for(size_t ts = 0; ts < timesteps.size(); ++ts)
{
if(*timesteps[ts] == NULL)
{
debug5 << mName << "Time step " << ts << " of input dataset is empty." << endl;
continue;
}
// Iterate over all pieces of the data for the current time step and
// figure out the set of cells.
int nleaves = 0;
......
......@@ -3780,13 +3780,60 @@ NetworkManager::CreateNamedSelection(int id, const SelectionProperties &props)
avtExpressionEvaluatorFilter *f = NULL;
avtDataObject_p dob;
debug1 << mName << "selection source " << props.GetSource() << endl;
std::string source(props.GetSource());
debug1 << mName << "selection source " << source << endl;
if(id >= 0)
{
// The selection source is a plot that has been executed.
if (id >= networkCache.size())
{
debug1 << mName << "Internal error: asked to use network ID (" << id
<< ") >= num saved networks ("
<< networkCache.size() << ")" << endl;
EXCEPTION0(ImproperUseException);
}
if (networkCache[id] == NULL)
{
debug1 << mName << "Asked to construct a named selection from a network "
<< "that has already been cleared." << endl;
EXCEPTION0(ImproperUseException);
}
if (id != networkCache[id]->GetNetID())
{
debug1 << mName << "Internal error: network at position[" << id << "] "
<< "does not have same id (" << networkCache[id]->GetNetID()
<< ")" << endl;
EXCEPTION0(ImproperUseException);
}
if(!networkCache[id]->GetPlot()->CompatibleWithCumulativeQuery())
{
// Work off of the source file instead of the plot.
source = networkCache[id]->GetNetDB()->GetFilename();
debug1 << mName << "Do not use the plot's intermediate data object "
"for selection. Use its database source: " << source << endl;
// Do not allow use of the plot's output.
id = -1;
}
else
{
dob = networkCache[id]->GetPlot()->GetIntermediateDataObject();
debug1 << mName << "Cached network's plot id: "
<< networkCache[id]->GetPlotName()
<< ", selection plot: " << source << endl;
}
}
if(id < 0)
{
// We're going to assume that the props.source is a database name.
// We're going to assume that the source is a database name.
int ts = 0;
NetnodeDB *netDB = GetDBFromCache(props.GetSource(), ts);
NetnodeDB *netDB = GetDBFromCache(source, ts);
if(netDB != NULL)
{
// Try and determine a suitable variable to use to start our pipeline.
......@@ -3826,7 +3873,7 @@ NetworkManager::CreateNamedSelection(int id, const SelectionProperties &props)
TRY
{
debug1 << mName << "Try creating new db source for "
<< props.GetSource() << " named selection." << endl;
<< source << " named selection." << endl;
std::string leaf = ParsingExprList::GetRealVariable(var);
// Add an expression filter since we may need to do expressions.
......@@ -3840,7 +3887,7 @@ NetworkManager::CreateNamedSelection(int id, const SelectionProperties &props)
std::string mesh = netDB->GetDB()->GetMetaData(0)->MeshForVar(var);
silr->SetTopSet(mesh.c_str());
avtDataRequest_p dataRequest = new avtDataRequest(var.c_str(), ts, silr);
int pipelineIndex = loadBalancer->AddPipeline(props.GetSource());
int pipelineIndex = loadBalancer->AddPipeline(source);
avtContract_p contract = new avtContract(dataRequest, pipelineIndex);
// Execute with an empty source so the contract gets put in the data
......@@ -3861,41 +3908,8 @@ NetworkManager::CreateNamedSelection(int id, const SelectionProperties &props)
}
else
{
debug1 << mName << "Could not get database " << props.GetSource() << " from cache." << endl;
}
}
else
{
// The selection source is a plot that has been executed.
if (id >= networkCache.size())
{
debug1 << mName << "Internal error: asked to use network ID (" << id
<< ") >= num saved networks ("
<< networkCache.size() << ")" << endl;
EXCEPTION0(ImproperUseException);
debug1 << mName << "Could not get database " << source << " from cache." << endl;
}
if (networkCache[id] == NULL)
{
debug1 << mName << "Asked to construct a named selection from a network "
<< "that has already been cleared." << endl;
EXCEPTION0(ImproperUseException);
}
if (id != networkCache[id]->GetNetID())
{
debug1 << mName << "Internal error: network at position[" << id << "] "
<< "does not have same id (" << networkCache[id]->GetNetID()
<< ")" << endl;
EXCEPTION0(ImproperUseException);
}
dob = networkCache[id]->GetPlot()->GetIntermediateDataObject();
debug1 << mName << "Cached network's plot id: "
<< networkCache[id]->GetPlotName()
<< ", selection plot: " << props.GetSource() << endl;
}
if (*dob == NULL)
......
......@@ -1839,7 +1839,7 @@ QvisSelectionsWindow::processTimeStride()
void
QvisSelectionsWindow::initializeVariableList()
{
Apply(DEFAULT_FORCE_UPDATE, DEFAULT_UPDATE_PLOTS, DONT_ALLOW_CACHING);
Apply(true, DEFAULT_UPDATE_PLOTS, DONT_ALLOW_CACHING);
// Ask the viewer to populate the selection's variables using the
// current plot's attributes.
......
......@@ -90,6 +90,8 @@ public:
virtual void RegisterNamedSelection(const std::string &s)
{ namedSelections.push_back(s); };
virtual bool CompatibleWithCumulativeQuery() const { return false; }
protected:
avtParallelCoordinatesFilter *parAxisFilter;
avtLevelsMapper *levelsMapper;
......
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