Commit 4a641b91 authored by hrchilds's avatar hrchilds
Browse files

Update from August 24, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@307 18c085ea-50e0-402c-830e-de6fd14e8384
parent d6185bb5
......@@ -2389,6 +2389,11 @@ avtRectilinearDomainBoundaries::ExchangeMesh(vector<int> domainNum,
// Programmer: Hank Childs
// Creation: August 14, 2004
//
// Modifications:
//
// Hank Childs, Tue Aug 24 09:25:39 PDT 2004
// Create avtRealDims.
//
// ****************************************************************************
void
......@@ -2476,6 +2481,23 @@ avtStructuredDomainBoundaries::CreateGhostNodes(vector<int> domainNum,
ds->GetPointData()->AddArray(gn);
gn->Delete();
//
// Create a field-data array indicating the extents of real zones.
// Used during ghostzone removal.
//
vtkIntArray *realDims = vtkIntArray::New();
realDims->SetName("avtRealDims");
realDims->SetNumberOfTuples(6);
realDims->SetValue(0, 0);
realDims->SetValue(1, dims[0]);
realDims->SetValue(2, 0);
realDims->SetValue(3, dims[1]);
realDims->SetValue(4, 0);
realDims->SetValue(5, dims[2]);
ds->GetFieldData()->AddArray(realDims);
ds->GetFieldData()->CopyFieldOn("avtRealDims");
realDims->Delete();
}
}
......
......@@ -76,6 +76,9 @@
// Brad Whitlock, Tue Jul 20 16:10:51 PST 2004
// Added variable units.
//
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Added cellCountMultiplierForSRThreshold
//
// ****************************************************************************
avtPlot::avtPlot()
......@@ -94,6 +97,7 @@ avtPlot::avtPlot()
silr = NULL;
index = -1;
intermediateDataObject = NULL;
cellCountMultiplierForSRThreshold = 0.0; // an invalid value
}
......@@ -234,6 +238,9 @@ avtPlot::GetDataExtents(vector<double> &extents)
// Hank Childs, Tue Feb 24 13:47:47 PST 2004
// Fixed memory leak.
//
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Added code to set cellCountMultiplierForSRThreshold back to zero
//
// ****************************************************************************
void
......@@ -255,6 +262,7 @@ avtPlot::SetVarName(const char *name)
legend->SetVarName(varname);
}
needsRecalculation = true;
cellCountMultiplierForSRThreshold = 0.0;
}
// ****************************************************************************
......@@ -380,6 +388,9 @@ avtPlot::Execute(avtDataObject_p input, avtPipelineSpecification_p spec,
// Brad Whitlock, Tue Jul 20 16:39:07 PST 2004
// Added code to set the units for the plot.
//
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Added call to set cell count multiplier for SR threshold
//
// ****************************************************************************
avtDataObjectWriter_p
......@@ -441,6 +452,8 @@ avtPlot::Execute(avtDataObject_p input, avtPipelineSpecification_p spec,
}
ENDTRY
SetCellCountMultiplierForSRThreshold(dob);
return writer;
}
......@@ -1105,4 +1118,43 @@ avtPlot::ReleaseData(void)
theater.SetInput(NULL, doi, NULL);
}
// ****************************************************************************
// Method: avtPlot::SetCellCountMultiplierForSRThreshold
//
// Purpose: Default method to set a plot's cell count multiplier for SR
// threshold. By default, all plot's that don't override this method
// will set a value of 1.0.
//
// Programmer: Mark C. Miller
// Creation: August 23, 2004
//
// ****************************************************************************
void
avtPlot::SetCellCountMultiplierForSRThreshold(const avtDataObject_p)
{
cellCountMultiplierForSRThreshold = 1.0;
}
// ****************************************************************************
// Method: avtPlot::GetCellCountMultiplierForSRThreshold
//
// Purpose: Return the cell count multiplier for SR threshold. However, throw
// an exception if this information is requested but hasn't already been set.
//
// Programmer: Mark C. Miller
// Creation: August 23, 2004
//
// ****************************************************************************
float
avtPlot::GetCellCountMultiplierForSRThreshold() const
{
if (cellCountMultiplierForSRThreshold == 0.0)
{
EXCEPTION1(ImproperUseException, "The plot has not been executed such "
"that the cell count multiplier for SR threshold can be computed");
}
return cellCountMultiplierForSRThreshold;
}
......@@ -145,6 +145,10 @@ class AttributeSubject;
// Mark C. Miller, Wed Aug 11 23:42:18 PDT 2004
// Added GetCellCountMultiplierForSRThreshold
//
// Mark C. Miller, Mon Aug 23 20:27:17 PDT 2004
// Made GetCellCountMultiplierForSRThreshold non-virtual
// Added SetCellCountMultiplierForSRThreshold
//
// ****************************************************************************
class PLOTTER_API avtPlot
......@@ -199,8 +203,7 @@ class PLOTTER_API avtPlot
virtual const AttributeSubject
*SetOpaqueMeshIsAppropriate(bool)
{ return NULL; };
virtual float GetCellCountMultiplierForSRThreshold() const
{ return 1.0; };
float GetCellCountMultiplierForSRThreshold() const;
protected:
bool needsRecalculation;
......@@ -218,6 +221,7 @@ class PLOTTER_API avtPlot
char *varname;
char *varunits;
vector<double> dataExtents;
float cellCountMultiplierForSRThreshold;
avtDataObjectWriter_p Execute(avtDataObject_p,
avtPipelineSpecification_p,
......@@ -243,6 +247,9 @@ class PLOTTER_API avtPlot
EnhanceSpecification(avtPipelineSpecification_p);
virtual avtDecorationsMapper
*GetDecorationsMapper(void);
virtual void SetCellCountMultiplierForSRThreshold(
const avtDataObject_p dob);
};
typedef ref_ptr<avtPlot> avtPlot_p;
......
......@@ -11,12 +11,14 @@
#include <vtkCell.h>
#include <vtkDataSet.h>
#include <vtkDataSetRemoveGhostCells.h>
#include <vtkGeometryFilter.h>
#include <vtkPolyData.h>
#include <avtQueryableSource.h>
#include <DebugStream.h>
#include <ImproperUseException.h>
#ifdef PARALLEL
#include <mpi.h>
......@@ -90,20 +92,28 @@ avtEulerianQuery::~avtEulerianQuery()
// Instead of creating a data array, keep track of the Eulerian
// for this domain in domToEulerMap.
//
// Hank Childs, Tue Aug 24 08:47:57 PDT 2004
// Manually remove ghost cells, since the geometry filter only removes
// vtkGhostLevels, not vtkGhostNodes.
//
// ****************************************************************************
void
avtEulerianQuery::Execute(vtkDataSet *in_ds, const int dom)
{
gFilter->SetInput(in_ds);
vtkDataSetRemoveGhostCells *ghost_remover =
vtkDataSetRemoveGhostCells::New();
ghost_remover->SetInput(gFilter->GetOutput());
vtkDataSet *out = ghost_remover->GetOutput();
if (out->GetDataObjectType() != VTK_POLY_DATA)
{
// The output of a geometry filter should always be poly-data.
EXCEPTION0(ImproperUseException);
}
vtkPolyData *pds = vtkPolyData::New();
gFilter->SetOutput(pds);
pds->Delete();
vtkPolyData *pds = (vtkPolyData *) out;
pds->Update();
pds->SetSource(NULL);
// I believe this isn't good enough. I believe the facelist filter
// simply passes points through, and only modifies the cell structure.
......@@ -197,6 +207,7 @@ avtEulerianQuery::Execute(vtkDataSet *in_ds, const int dom)
Eulerian = numUsedPoints - edges.size() + nCells;
domToEulerMap.insert(DomainToEulerMap::value_type(dom, Eulerian));
ghost_remover->Delete();
}
......
......@@ -6,6 +6,7 @@
#include <vtkCellData.h>
#include <vtkDataSet.h>
#include <vtkIdList.h>
#include <vtkPointData.h>
#include <vtkUnsignedCharArray.h>
......@@ -249,6 +250,9 @@ avtSummationQuery::PostExecute(void)
// Kathleen Bonnell, Fri Nov 15 09:07:36 PST 2002
// Added dom argument.
//
// Hank Childs, Tue Aug 24 08:22:24 PDT 2004
// Add support for ghost nodes.
//
// ****************************************************************************
void
......@@ -267,30 +271,53 @@ avtSummationQuery::Execute(vtkDataSet *ds, const int dom)
EXCEPTION1(InvalidVariableException, variableName);
}
vtkUnsignedCharArray *ghosts = NULL;
vtkUnsignedCharArray *ghost_zones = NULL;
if (!pointData && !sumGhostValues)
{
ghosts = (vtkUnsignedCharArray *)
ghost_zones = (vtkUnsignedCharArray *)
ds->GetCellData()->GetArray("vtkGhostLevels");
}
vtkUnsignedCharArray *ghost_nodes = NULL;
if (!sumGhostValues)
{
ghost_nodes = (vtkUnsignedCharArray *)
ds->GetPointData()->GetArray("vtkGhostNodes");
}
int nValues = arr->GetNumberOfTuples();
vtkIdList *list = vtkIdList::New();
for (int i = 0 ; i < nValues ; i++)
{
float val = arr->GetTuple1(i);
if (ghosts != NULL)
if (ghost_zones != NULL)
{
unsigned char g = ghosts->GetValue(i);
unsigned char g = ghost_zones->GetValue(i);
if (g != 0)
{
val = 0.;
}
}
if (ghost_nodes != NULL)
{
bool allGhost = true;
ds->GetCellPoints(i, list);
vtkIdType npts = list->GetNumberOfIds();
for (int j = 0 ; j < npts ; j++)
{
vtkIdType id = list->GetId(j);
unsigned char g = ghost_nodes->GetValue(id);
if (g == 0)
allGhost = false;
}
if (allGhost)
val = 0.;
}
if (sumOnlyPositiveValues && val < 0.)
continue;
sum += val;
}
list->Delete();
}
......@@ -754,6 +754,9 @@ RPCExecutor<SetWinAnnotAttsRPC>::Execute(SetWinAnnotAttsRPC *rpc)
// Mark C. Miller, Wed Aug 11 23:42:18 PDT 2004
// Added code to pass cellCountMultiplier to WriteData
//
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Moved code to get cellCountMultiplier to inside GetOutput
//
// ****************************************************************************
template<>
void
......@@ -787,7 +790,7 @@ RPCExecutor<ExecuteRPC>::Execute(ExecuteRPC *rpc)
{
// save the current network id for later
bool shouldSendAbort = false;
float cellCountMultiplier = netmgr->GetPlot()->GetCellCountMultiplierForSRThreshold();
float cellCountMultiplier;
int netId = netmgr->GetCurrentNetworkId();
avtNullData abortDob(NULL);
......@@ -796,7 +799,8 @@ RPCExecutor<ExecuteRPC>::Execute(ExecuteRPC *rpc)
avtDataObjectWriter_p writer;
TRY
{
writer = netmgr->GetOutput(rpc->GetRespondWithNull(),false);
writer = netmgr->GetOutput(rpc->GetRespondWithNull(), false,
&cellCountMultiplier);
}
CATCH(AbortException)
{
......
......@@ -1263,9 +1263,13 @@ NetworkManager::UpdatePlotAtts(int id, const AttributeGroup *atts)
// Kathleen Bonnell, Wed Jun 2 09:48:29 PDT 2004
// Set MayRequireNodes.
//
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Added cellCountMultiplier arg and call to get and set it
//
// ****************************************************************************
avtDataObjectWriter_p
NetworkManager::GetOutput(bool respondWithNullData, bool calledForRender)
NetworkManager::GetOutput(bool respondWithNullData, bool calledForRender,
float *cellCountMultiplier)
{
// Is the network complete?
......@@ -1289,6 +1293,10 @@ NetworkManager::GetOutput(bool respondWithNullData, bool calledForRender)
workingNet->GetPipelineSpec(),
&windowAttributes);
// get the SR multiplier
*cellCountMultiplier =
workingNet->GetPlot()->GetCellCountMultiplierForSRThreshold();
if (respondWithNullData)
{
// get the data object at the input to the writer
......@@ -1383,6 +1391,9 @@ NetworkManager::GetOutput(bool respondWithNullData, bool calledForRender)
// Added code to get cell count multiplier for SR mode and adjust
// cell counts for SR threshold
//
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Added arg to GetOutput call
//
// ****************************************************************************
avtDataObjectWriter_p
NetworkManager::Render(intVector plotIds, bool getZBuffer, bool do3DAnnotsOnly)
......@@ -1429,12 +1440,12 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, bool do3DAnnotsOnly)
// get the network output as we would normally
workingNet = NULL;
UseNetwork(plotIds[i]);
float cellCountMultiplier =
GetPlot()->GetCellCountMultiplierForSRThreshold();
float cellCountMultiplier;
DataNetwork *workingNetSaved = workingNet;
int t4 = visitTimer->StartTimer();
avtDataObjectWriter_p tmpWriter = GetOutput(false,true);
avtDataObjectWriter_p tmpWriter = GetOutput(false, true,
&cellCountMultiplier);
avtDataObject_p dob = tmpWriter->GetInput();
// merge polygon info output across processors
......
......@@ -173,6 +173,9 @@ class VisWindow;
// Added frameAndState data member and associated arg to
// SetAnnotationAttributes
//
// Mark C. Miller, Mon Aug 23 20:27:17 PDT 2004
// Added argument to GetOutput for cell count multiplier
//
// ****************************************************************************
class NetworkManager
{
......@@ -221,7 +224,8 @@ class NetworkManager
void SetLoadBalancer(LoadBalancer *lb) {loadBalancer = lb;};
avtDataObjectWriter_p GetOutput(bool respondWithNullData,
bool calledForRender);
bool calledForRender,
float *cellCountMultiplier);
avtDataObjectWriter_p Render(intVector networkIds, bool getZBuffer,
bool do3DAnnotsOnly);
......
......@@ -219,26 +219,32 @@ avtMeshPlot::Create()
}
// ****************************************************************************
// Method: avtMeshPlot::GetCellCountMultiplierForSRThreshold
// Method: avtMeshPlot::SetCellCountMultiplierForSRThreshold
//
// Purpose: Returns number of polygons each point in the plot's output will be
// Purpose: Sets number of polygons each point in the plot's output will be
// glyphed into.
//
// Programmer: Mark C. Miller
// Creation: August 12, 2004
//
// Modifications:
//
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Changed to the Set... method (Get is now done in avtPlot.C)
//
// ****************************************************************************
float
avtMeshPlot::GetCellCountMultiplierForSRThreshold() const
void
avtMeshPlot::SetCellCountMultiplierForSRThreshold(const avtDataObject_p dob)
{
float retval = 1.0;
if (*behavior)
if (*dob)
{
int dim = behavior->GetInfo().GetAttributes().GetSpatialDimension();
int dim = dob->GetInfo().GetAttributes().GetSpatialDimension();
if (dim == 0)
retval = 6.0;
cellCountMultiplierForSRThreshold = 6.0;
else
cellCountMultiplierForSRThreshold = 1.0;
}
return retval;
}
// ****************************************************************************
......
......@@ -88,6 +88,9 @@ class avtSmoothPolyDataFilter;
// Mark C. Miller, Thu Aug 12 21:17:35 PDT 2004
// Added GetCellCountMultiplierForSRThreshold
//
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Changed GetCellCountMultiplierForSRThreshold to Set...
//
// ****************************************************************************
class
......@@ -122,7 +125,6 @@ avtMeshPlot : public avtPlot
virtual const AttributeSubject
*SetOpaqueMeshIsAppropriate(bool);
float GetCellCountMultiplierForSRThreshold() const;
protected:
avtSurfaceAndWireframeRenderer_p renderer;
......@@ -145,6 +147,8 @@ avtMeshPlot : public avtPlot
virtual void CustomizeBehavior(void);
virtual void CustomizeMapper(avtDataObjectInformation &);
virtual avtLegend_p GetLegend(void) { return varLegendRefPtr; };
void SetCellCountMultiplierForSRThreshold(
const avtDataObject_p);
private:
bool ShouldRenderOpaque(void);
......
......@@ -32,6 +32,9 @@ class avtLookupTable;
// Mark C. Miller, Wed Aug 11 23:42:18 PDT 2004
// Added GetCellCountMultiplierForSRThreshold
//
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Changed GetCellCountMultiplierForSRThreshold to Set...
//
// ****************************************************************************
class avtTensorPlot : public avtPointDataPlot
......@@ -47,9 +50,6 @@ class avtTensorPlot : public avtPointDataPlot
virtual void SetAtts(const AttributeGroup*);
virtual float GetCellCountMultiplierForSRThreshold() const
{ return 96.0; };
protected:
TensorAttributes atts;
bool colorsInitialized;
......@@ -72,6 +72,9 @@ class avtTensorPlot : public avtPointDataPlot
virtual avtLegend_p GetLegend(void) { return varLegendRefPtr; };
void SetLegend(bool);
void SetLegendRanges();
virtual void SetCellCountMultiplierForSRThreshold(const avtDataObject_p)
{ cellCountMultiplierForSRThreshold = 96.0; };
};
......
......@@ -117,10 +117,10 @@ avtVectorPlot::Create()
// ****************************************************************************
// Method: avtVectorPlot::GetCellCountMultiplierForSRThreshold
// Method: avtVectorPlot::SetCellCountMultiplierForSRThreshold
//
// Purpose: Returns number of polygons each point in the plot's output will be
// glyphed into.
// Purpose: Sets the number of polygons each point in the plot's output will
// be glyphed into.
//
// Programmer: Mark C. Miller
// Creation: August 11, 2004
......@@ -129,20 +129,23 @@ avtVectorPlot::Create()
// Jeremy Meredith, Thu Aug 12 14:15:55 PDT 2004
// Changed some code to get it to compile.
//
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Changed to Set... (Get is now done in avtPlot.C)
//
// ****************************************************************************
float
avtVectorPlot::GetCellCountMultiplierForSRThreshold() const
void
avtVectorPlot::SetCellCountMultiplierForSRThreshold(const avtDataObject_p dob)
{
float retval = 6.0;
if (*behavior)
cellCountMultiplierForSRThreshold = 6.0;
if (*dob)
{
int dim = behavior->GetInfo().GetAttributes().GetSpatialDimension();
int dim = dob->GetInfo().GetAttributes().GetSpatialDimension();
if (dim == 2)
retval = 2.0;
cellCountMultiplierForSRThreshold = 2.0;
else
retval = 6.0;
cellCountMultiplierForSRThreshold = 6.0;
}
return retval;
}
// ****************************************************************************
......
......@@ -50,6 +50,9 @@ class avtLookupTable;
// Kathleen Bonnell, Mon Aug 9 14:33:26 PDT 2004
// Added magVarName, ComputeMagVarName, and SetMapperColors.
//
// Mark C. Miller, Mon Aug 23 20:24:31 PDT 2004
// Changed GetCellCountMultiplierForSRThreshold to Set...
//
// ****************************************************************************
class avtVectorPlot : public avtPointDataPlot
......@@ -66,7 +69,6 @@ class avtVectorPlot : public avtPointDataPlot
virtual void SetAtts(const AttributeGroup*);
virtual bool SetColorTable(const char *ctName);
virtual float GetCellCountMultiplierForSRThreshold() const;
protected:
VectorAttributes atts;
......@@ -93,6 +95,8 @@ class avtVectorPlot : public avtPointDataPlot
void ComputeMagVarName(const std::string &);
void SetMapperColors(void);
std::string magVarName;
virtual void SetCellCountMultiplierForSRThreshold(const avtDataObject_p);
};
......
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