Commit cca4a4f7 authored by hrchilds's avatar hrchilds

Update from April 20, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@226 18c085ea-50e0-402c-830e-de6fd14e8384
parent 0a6d6864
......@@ -1063,6 +1063,9 @@ avtDatabase::GetFileListFromTextFile(const char *textfile,
// Kathleen Bonnell, Tue Mar 16 15:55:18 PST 2004
// Don't remove any pickVarInfo's, let Pick handle that.
//
// Kathleen Bonnell, Mon Apr 19 15:49:05 PDT 2004
// Ensure that the timestep being queried is the active one.
//
// ****************************************************************************
void
......@@ -1082,6 +1085,11 @@ avtDatabase::Query(PickAttributes *pa)
vector<string> userVars = pa->GetVariables();
std::string vName;
//
// Ensure that the timestep being queried is the active one.
//
ActivateTimestep(ts);
//
// Filling the incidentElements is usually done by PickQuery,
// but if matSelect has been applied, then the values from PickQuery
......
......@@ -5727,6 +5727,10 @@ avtGenericDatabase::QuerySpecies(const std::string &varName, const int dom,
// Programmer: Kathleen Bonnell
// Creation: November 13, 2003
//
// Modifications:
// Kathleen Bonnell, Mon Apr 19 15:49:05 PDT 2004
// Ensure that the timestep being queried is the active one.
//
// ****************************************************************************
bool
......@@ -5734,6 +5738,8 @@ avtGenericDatabase::FindElementForPoint(const char *var, const int ts,
const int dom, const char *elementName,
float pt[3], int &elNum)
{
ActivateTimestep(ts);
string mesh = GetMetaData(ts)->MeshForVar(var);
vtkDataSet *ds = GetMeshDataset(mesh.c_str(), ts, dom, "_all");
......@@ -5764,12 +5770,17 @@ avtGenericDatabase::FindElementForPoint(const char *var, const int ts,
// Programmer: Kathleen Bonnell
// Creation: December 22, 2003
//
// Kathleen Bonnell, Mon Apr 19 15:49:05 PDT 2004
// Ensure that the timestep being queried is the active one.
//
// ****************************************************************************
void
avtGenericDatabase::GetDomainName(const std::string &varName, const int ts,
const int dom, std::string &domName)
{
ActivateTimestep(ts);
string mesh = GetMetaData(ts)->MeshForVar(varName.c_str());
const avtMeshMetaData *mmd = GetMetaData(ts)->GetMesh(mesh);
char temp[256];
......
......@@ -57,6 +57,9 @@ avtNumZonesQuery::~avtNumZonesQuery()
// Rewrote code to work correctly in parallel when some processors have
// not done any work and thus have a different value for ghost type.
//
// Kathleen Bonnell, Tue Apr 20 12:49:46 PDT 2004
// Modified msg creation so that it works properly on all platforms.
//
// ****************************************************************************
void
......@@ -132,14 +135,16 @@ avtNumZonesQuery::PerformQuery(QueryAttributes *qA)
if (gt != AVT_HAS_GHOSTS)
{
qA->SetResultsValue((double)totalZones[0]);
qA->SetResultsMessage(msg);
}
else
{
SNPRINTF(msg, 200, "%s\nThe number of ghost zones is %d.", msg, totalZones[1]);
char msg2[200];
SNPRINTF(msg2, 200, "%s\nThe number of ghost zones is %d.", msg, totalZones[1]);
double results[2] = {(double) totalZones[0], (double) totalZones[1]};
qA->SetResultsValues(results, 2);
qA->SetResultsMessage(msg2);
}
qA->SetResultsMessage(msg);
UpdateProgress(1, 0);
}
......@@ -88,6 +88,9 @@ avtOriginalDataMinMaxQuery::~avtOriginalDataMinMaxQuery()
// Kathleen Bonnell, Wed Apr 14 18:05:08 PDT 2004
// Added condense filter.
//
// Kathleen Bonnell, Tue Apr 20 09:36:58 PDT 2004
// Ensure that we are working with correct var and timestep.
//
// ****************************************************************************
avtDataObject_p
......@@ -95,23 +98,21 @@ avtOriginalDataMinMaxQuery::ApplyFilters(avtDataObject_p inData)
{
Preparation(inData);
avtDataSpecification_p dspec;
if (!timeVarying)
{
dspec = inData->GetTerminatingSource()->
GetGeneralPipelineSpecification()->GetDataSpecification();
}
else
{
avtDataSpecification_p oldSpec = inData->GetTerminatingSource()->
GetGeneralPipelineSpecification()->GetDataSpecification();
avtDataSpecification_p dspec =
inData->GetTerminatingSource()->GetFullDataSpecification();
dspec = new avtDataSpecification(oldSpec->GetVariable(),
if (dspec->GetVariable() != queryAtts.GetVariables()[0] ||
dspec->GetTimestep() != queryAtts.GetTimeStep() ||
timeVarying)
{
dspec = new avtDataSpecification(queryAtts.GetVariables()[0].c_str(),
queryAtts.GetTimeStep(),
oldSpec->GetRestriction());
dspec->GetRestriction());
}
avtPipelineSpecification_p pspec =
new avtPipelineSpecification(dspec, queryAtts.GetPipeIndex());
avtDataObject_p temp;
CopyTo(temp, inData);
eef->SetInput(temp);
......
......@@ -603,6 +603,10 @@ avtPickQuery::Execute(vtkDataSet *ds, const int dom)
// Hank Childs, Fri Apr 9 16:25:40 PDT 2004
// Minimize work done by creating new SIL.
//
// Kathleen Bonnell, Mon Apr 19 15:40:23 PDT 2004
// Simplified use of pspec and dspec. No longer use dspec's timestep
// to set pickAtts' timestep.
//
// ****************************************************************************
avtDataObject_p
......@@ -656,11 +660,9 @@ avtPickQuery::ApplyFilters(avtDataObject_p inData)
pickAtts.SetNeedTransformMessage(false);
}
avtDataSpecification_p dspec = inData->GetTerminatingSource()
->GetGeneralPipelineSpecification()->GetDataSpecification();
avtDataSpecification_p dspec =
inData->GetTerminatingSource()->GetFullDataSpecification();
int ts = dspec->GetTimestep();
pickAtts.SetTimeStep(ts);
intVector dlist;
dspec->GetSIL().GetDomainList(dlist);
if (dlist.size() == 1 && dspec->UsesAllDomains())
......@@ -674,35 +676,34 @@ avtPickQuery::ApplyFilters(avtDataObject_p inData)
dlist.clear();
dlist.push_back(pickAtts.GetDomain());
avtPipelineSpecification_p pspec =
inData->GetTerminatingSource()->GetGeneralPipelineSpecification();
stringVector vars = pickAtts.GetVariables();
pspec->SetDataSpecification(dspec);
stringVector vars = pickAtts.GetVariables();
pspec->GetDataSpecification()->GetRestriction()->SuspendCorrectnessChecking();
pspec->GetDataSpecification()->GetRestriction()->TurnOnAll();
dspec->GetRestriction()->SuspendCorrectnessChecking();
dspec->GetRestriction()->TurnOnAll();
int i;
for (i = 0; i < silUseSet.size(); i++)
{
if (silUseSet[i] == 0)
pspec->GetDataSpecification()->GetRestriction()->TurnOffSet(i);
dspec->GetRestriction()->TurnOffSet(i);
}
pspec->GetDataSpecification()->GetRestriction()->EnableCorrectnessChecking();
dspec->GetRestriction()->EnableCorrectnessChecking();
if (!singleDomain)
{
pspec->GetDataSpecification()->GetRestriction()->RestrictDomains(dlist);
dspec->GetRestriction()->RestrictDomains(dlist);
}
for (i = 0; i < vars.size(); i++)
{
if (strcmp(pspec->GetDataSpecification()->GetVariable(), vars[i].c_str()) != 0)
if (strcmp(dspec->GetVariable(), vars[i].c_str()) != 0)
{
if (!pspec->GetDataSpecification()->HasSecondaryVariable(vars[i].c_str()))
pspec->GetDataSpecification()->AddSecondaryVariable(vars[i].c_str());
if (!dspec->HasSecondaryVariable(vars[i].c_str()))
dspec->AddSecondaryVariable(vars[i].c_str());
}
}
avtPipelineSpecification_p pspec = new avtPipelineSpecification(dspec, 0);
avtDataObject_p temp;
CopyTo(temp, inData);
eef->SetInput(temp);
......
......@@ -1041,6 +1041,9 @@ RPCExecutor<DefineVirtualDatabaseRPC>::Execute(DefineVirtualDatabaseRPC *rpc)
// Mark C. Miller, Mon Mar 29 14:27:10 PST 200
// Added stuff to pass knowledge of annotations to render method
//
// Mark C. Miller, Tue Apr 20 07:44:34 PDT 2004
// Added code to set the warning call back
//
// ****************************************************************************
template<>
void
......@@ -1058,7 +1061,7 @@ RPCExecutor<RenderRPC>::Execute(RenderRPC *rpc)
avtDataObjectSource::RegisterProgressCallback(NULL, NULL);
LoadBalancer::RegisterProgressCallback(NULL, NULL);
avtTerminatingSource::RegisterInitializeProgressCallback(NULL, NULL);
avtCallback::RegisterWarningCallback(NULL, NULL);
avtCallback::RegisterWarningCallback(Engine::EngineWarningCallback, (void*)rpc);
TRY
{
// do the render
......
#include <snprintf.h>
#include <NetworkManager.h>
#include <DataNetwork.h>
#include <ClonedDataNetwork.h>
......@@ -14,6 +15,7 @@
#include <OperatorPluginManager.h>
#include <OperatorPluginInfo.h>
#include <PickAttributes.h>
#include <avtCallback.h>
#include <avtExtents.h>
#include <avtNullData.h>
#include <avtDatabaseMetaData.h>
......@@ -1324,6 +1326,9 @@ NetworkManager::GetOutput(bool respondWithNullData, bool calledForRender)
//
// Mark C. Miller, Fri Apr 2 11:06:09 PST 2004
// Removed call to FullFrameOff
//
// Mark C. Miller, Tue Apr 20 07:44:34 PDT 2004
// Added code to issue a warning if a plot's actor has no data
// ****************************************************************************
avtDataObjectWriter_p
NetworkManager::Render(intVector plotIds, bool getZBuffer, bool do3DAnnotsOnly)
......@@ -1395,7 +1400,16 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, bool do3DAnnotsOnly)
avtActor_p anActor = workingNetSaved->GetActor(dob,
&windowAttributes);
visitTimer->StopTimer(t5, "Calling GetActor for DOB");
bool polysOnly = false;
if (anActor->GetDataObject()->GetNumberOfCells(polysOnly) == 0)
{
char message[256];
SNPRINTF(message, sizeof(message),
"The plot with id = %d yielded no data", plotIds[i]);
avtCallback::IssueWarning(message);
}
int t6 = visitTimer->StartTimer();
viswin->AddPlot(anActor);
visitTimer->StopTimer(t6, "Adding plot to the vis window");
......
......@@ -737,12 +737,16 @@ EngineProxy::DefineVirtualDatabase(const std::string &fileFormat,
// Modifications:
// Mark C. Miller, Mon Mar 29 15:01:58 PST 2004
// Added new bool arg for controlling 3D annoations
//
// Mark C. Miller, Tue Apr 20 07:44:34 PDT 2004
// Added new waitCB and cbData args as well as a call to the waitCB in the
// inner loop to support warning messages comming from engine
//
// ****************************************************************************
avtDataObjectReader_p
EngineProxy::Render(bool sendZBuffer, const intVector& networkIDs,
bool do3DAnnotsOnly)
bool do3DAnnotsOnly, void (*waitCB)(void *), void *cbData)
{
// Send a status message indicating that we're starting a scalable render
......@@ -770,6 +774,9 @@ EngineProxy::Render(bool sendZBuffer, const intVector& networkIDs,
Warning(renderRPC.GetMessage().c_str());
}
// If we passed a callback function, execute it.
if(waitCB)
waitCB(cbData);
}
// Check for abort
......
......@@ -180,6 +180,8 @@ class StatusAttributes;
// Mark C. Miller, Wed Apr 14 16:41:32 PDT 2004
// Added argument for extents type string to SetWinAnnotAtts
//
// Mark C. Miller, Tue Apr 20 07:44:34 PDT 2004
// Added waitCB and cbData args to Render method
// ****************************************************************************
class ENGINE_PROXY_API EngineProxy : public RemoteProxyBase
......@@ -232,7 +234,8 @@ public:
void SetWinAnnotAtts(const WindowAttributes*,
const AnnotationAttributes*,
std::string);
avtDataObjectReader_p Render(bool, const intVector&, bool);
avtDataObjectReader_p Render(bool, const intVector&, bool,
void (*waitCB)(void *), void *cbData);
avtDataObjectReader_p Execute(bool, void (*waitCB)(void *), void *cbData);
......
......@@ -1712,6 +1712,10 @@ ViewerEngineManager::UseDataObjectReader(ViewerPlot *const plot,
// Jeremy Meredith, Fri Mar 26 16:59:59 PST 2004
// Use a map of engines based on a key, and be aware of simulations.
//
// Mark C. Miller, Tue Apr 20 07:44:34 PDT 2004
// Added args to the proxy's render method to support warning call backs
// comming from the engine.
//
// ****************************************************************************
avtDataObjectReader_p
......@@ -1728,7 +1732,9 @@ ViewerEngineManager::GetDataObjectReader(bool sendZBuffer,
TRY
{
retval = engines[ek]->Render(sendZBuffer, ids, !doAllAnnotations);
retval = engines[ek]->Render(sendZBuffer, ids, !doAllAnnotations,
ViewerSubject::ProcessEventsCB,
(void *)viewerSubject);
}
CATCH(LostConnectionException)
{
......
......@@ -2459,13 +2459,19 @@ ViewerPlot::GetReader() const
// Mark C. Miller, Mon Apr 19 12:00:52 PDT 2004
// Added code to issue a warning message if actor has no data
//
// Mark C. Miller, Mon Apr 19 16:17:37 PDT 2004
// Added returned bool argument, actorHasNoData and removed code that
// issues the no data warning message to the caller of this method
//
// ****************************************************************************
// only place in ViewerPlot where ViewerWindowManager is needed
#include <ViewerWindowManager.h>
void
ViewerPlot::CreateActor(bool createNew, bool turningOffScalableRendering)
ViewerPlot::CreateActor(bool createNew,
bool turningOffScalableRendering,
bool& actorHasNoData)
{
avtDataObjectReader_p reader;
......@@ -2629,22 +2635,15 @@ ViewerPlot::CreateActor(bool createNew, bool turningOffScalableRendering)
plotList[cacheIndex]->SetIndex(networkID);
plotList[cacheIndex]->SetCurrentSILRestriction(silr);
// assume the actor has data
actorHasNoData = false;
TRY
{
avtActor_p actor = plotList[cacheIndex]->Execute(reader);
//
// Issue a warning if this actor has no data
//
bool polysOnly = false;
if (actor->GetDataObject()->GetNumberOfCells(polysOnly) == 0)
{
char message[128];
SNPRINTF(message, sizeof(message),
"The %s plot of \"%s\" yielded no data",
GetPlotName(), GetVariableName().c_str());
Warning(message);
}
bool countPolysOnly = false;
if (actor->GetDataObject()->GetNumberOfCells(countPolysOnly) == 0)
actorHasNoData = true;
this->SetActor(actor);
......@@ -2830,7 +2829,8 @@ ViewerPlot::ClearActors(const int i0, const int i1)
void
ViewerPlot::TransmuteActor(bool turningOffScalableRendering)
{
CreateActor(false, turningOffScalableRendering);
bool dummyBool;
CreateActor(false, turningOffScalableRendering, dummyBool);
}
// ****************************************************************************
......
......@@ -183,6 +183,10 @@ class avtToolInterface;
// I added a copy constructor and made changes to make keyframing work
// again.
//
// Mark C. Miller, Tue Apr 20 07:44:34 PDT 2004
// Added actorHasNoData arg. to CreateActor. Eliminated default values for
// other args to CreateActor
//
// ****************************************************************************
class VIEWER_API ViewerPlot
......@@ -292,8 +296,9 @@ class VIEWER_API ViewerPlot
avtActor_p &GetActor() const;
avtDataObjectReader_p &GetReader() const;
bool NoActorExists() const;
void CreateActor(bool createNew = true,
bool turningOffScalableRendering = true);
void CreateActor(bool createNew,
bool turningOffScalableRendering,
bool &actorHasNoData);
void ClearActors();
void ClearCurrentActor();
void TransmuteActor(bool turningOffScalableRendering);
......
......@@ -5311,6 +5311,9 @@ PthreadAttrInit(pthread_attr_t *attr)
// Jeremy Meredith, Tue Mar 30 10:39:20 PST 2004
// Added an engine key to map plots to the engine used to create them.
//
// Mark C. Miller, Tue Apr 20 07:44:34 PDT 2004
// Added code to issue warning message if a created actor has no data
//
// ****************************************************************************
void *
......@@ -5325,7 +5328,25 @@ CreatePlot(void *info)
plotInfo->plot->GetEngineKey());
if(success)
plotInfo->plot->CreateActor();
{
bool createNewActor = true;
bool turningOffScalableRendering = false;
bool actorHasNoData = false;
plotInfo->plot->CreateActor(createNewActor,
turningOffScalableRendering,
actorHasNoData);
if (actorHasNoData && !plotInfo->window->GetScalableRendering())
{
char message[256];
SNPRINTF(message, sizeof(message),
"The %s plot of variable \"%s\" yielded no data.",
plotInfo->plot->GetPlotName(),
plotInfo->plot->GetVariableName().c_str());
Warning(message);
}
}
else
plotInfo->plotList->InterruptUpdatePlotList();
}
......
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