Commit f87e70b3 authored by hrchilds's avatar hrchilds
Browse files

Update from July 30, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@291 18c085ea-50e0-402c-830e-de6fd14e8384
parent e0a9a56d
......@@ -307,6 +307,11 @@ CGetNumberOfZones(avtDataRepresentation &data, void *sum, bool &)
// Programmer: Hank Childs
// Creation: July 27, 2004
//
// Modifications:
//
// Hank Childs, Thu Jul 29 17:24:40 PDT 2004
// Copy over field data as well.
//
// ****************************************************************************
void
......@@ -325,6 +330,7 @@ CConvertUnstructuredGridToPolyData(avtDataRepresentation &data, void *, bool &)
out_pd->SetPoints(ugrid->GetPoints());
out_pd->GetPointData()->ShallowCopy(ugrid->GetPointData());
out_pd->GetCellData()->ShallowCopy(ugrid->GetCellData());
out_pd->GetFieldData()->ShallowCopy(ugrid->GetFieldData());
int ncells = ugrid->GetNumberOfCells();
out_pd->Allocate(ncells);
for (int i = 0 ; i < ncells ; i++)
......
......@@ -677,6 +677,9 @@ void vtkExodusReader::ReadGeometry(int exoid)
// Hank Childs, Sat Jul 10 12:19:28 PDT 2004
// Remove virtual function calls for performance.
//
// Hank Childs, Thu Jul 29 15:30:40 PDT 2004
// Fix bug with setting up the cell list.
//
//----------------------------------------------------------------------------
void vtkExodusReader::ReadCells(int exoid)
{
......@@ -781,6 +784,7 @@ void vtkExodusReader::ReadCells(int exoid)
int *cl = cellLocations->GetPointer(0);
int idx = 0;
int currentIndex = 0;
for (i = this->StartBlock, idx=0 ; i <= this->EndBlock; i++, idx++)
{
// cellNumPoints may be smaller than num_nodes_per_elem
......@@ -835,7 +839,6 @@ void vtkExodusReader::ReadCells(int exoid)
// Now save the cells in a cell array.
int *pConnect = connect[idx];
int currentIndex = 0;
for (j = 0; j < num_elem_in_block[idx]; ++j)
{
*ct++ = cellType;
......
......@@ -4,6 +4,7 @@
#include <avtSurfaceFilter.h>
#include <float.h>
#include <math.h>
#include <vtkCellData.h>
......@@ -208,6 +209,9 @@ avtSurfaceFilter::Equivalent(const AttributeGroup *a)
// and Query, only use the Scalars generated by cd2pd in the output of
// this filter.
//
// Hank Childs, Fri Jul 30 12:26:20 PDT 2004
// Update zValMin and zValMax.
//
// ****************************************************************************
vtkDataSet *
......@@ -264,6 +268,9 @@ avtSurfaceFilter::ExecuteData(vtkDataSet *inDS, int, std::string)
zVal = Ms * zVal + Bs;
outScalars->SetValue(i, zVal);
zValMin = (zVal < zValMin ? zVal : zValMin);
zValMax = (zVal > zValMax ? zVal : zValMax);
}
vtkUnstructuredGrid *outUG = vtkUnstructuredGrid::New();
......@@ -478,6 +485,9 @@ avtSurfaceFilter::PerformRestriction(avtPipelineSpecification_p spec)
// Hank Childs, Fri Mar 15 18:25:20 PST 2002
// Account for dataset examiner.
//
// Hank Childs, Fri Jul 30 12:24:30 PDT 2004
// Initialize zValMin, zValMax.
//
// ****************************************************************************
void
......@@ -493,6 +503,9 @@ avtSurfaceFilter::PreExecute(void)
CalculateScaleValues(dataExtents, spatialExtents);
}
zValMin = +FLT_MAX;
zValMax = -FLT_MAX;
}
......@@ -592,3 +605,52 @@ avtSurfaceFilter::ReleaseData(void)
}
// ****************************************************************************
// Method: avtSurfaceFilter::PostExecute
//
// Purpose:
// Send accurate Spatial Extents to output.
//
// Programmer: Kathleen Bonnell
// Creation: May 24, 2004
//
// Modifications:
//
// Hank Childs, Fri Jul 30 12:09:16 PDT 2004
// Moved from avtWireframe filter. Also re-wrote logic for getting extents.
//
// ****************************************************************************
void
avtSurfaceFilter::PostExecute(void)
{
avtStreamer::PostExecute();
avtDataAttributes& inAtts = GetInput()->GetInfo().GetAttributes();
avtDataAttributes& outAtts = GetOutput()->GetInfo().GetAttributes();
// over-write spatial extents
outAtts.GetTrueSpatialExtents()->Clear();
outAtts.GetCumulativeTrueSpatialExtents()->Clear();
// get the outputs's spatial extents
double se[6];
if (inAtts.GetTrueSpatialExtents()->HasExtents())
{
inAtts.GetTrueSpatialExtents()->CopyTo(se);
se[4] = zValMin;
se[5] = zValMax;
// We can only set as cumulative, since the zVals are for the
// current processor only.
outAtts.GetCumulativeTrueSpatialExtents()->Set(se);
}
else if (inAtts.GetCumulativeTrueSpatialExtents()->HasExtents())
{
inAtts.GetCumulativeTrueSpatialExtents()->CopyTo(se);
se[4] = zValMin;
se[5] = zValMax;
outAtts.GetCumulativeTrueSpatialExtents()->Set(se);
}
}
......@@ -54,6 +54,9 @@ class vtkCellDataToPointData;
// Moved geofilter, appendFilter and edgesFilter to avtWireframeFilter.
// Removed PostExecute.
//
// Hank Childs, Fri Jul 30 12:09:16 PDT 2004
// Added PostExecute.
//
// ****************************************************************************
class avtSurfaceFilter : public avtStreamer
......@@ -79,6 +82,7 @@ class avtSurfaceFilter : public avtStreamer
double max;
double Ms;
double Bs;
double zValMin, zValMax;
bool stillNeedExtents;
double SkewTheValue(const double);
......@@ -88,6 +92,7 @@ class avtSurfaceFilter : public avtStreamer
virtual void RefashionDataObjectInfo(void);
virtual void VerifyInput(void);
virtual void PreExecute(void);
virtual void PostExecute(void);
virtual avtPipelineSpecification_p
PerformRestriction(avtPipelineSpecification_p);
};
......
......@@ -6,6 +6,7 @@
#include <vtkAppendPolyData.h>
#include <vtkDataSet.h>
#include <vtkFieldData.h>
#include <vtkGeometryFilter.h>
#include <vtkPolyData.h>
#include <vtkUniqueFeatureEdges.h>
......@@ -131,6 +132,9 @@ avtWireframeFilter::Equivalent(const AttributeGroup *a)
//
// Modifications:
//
// Hank Childs, Thu Jul 29 17:24:40 PDT 2004
// Reverse order of inputs to appender to get around VTK funniness.
//
// ****************************************************************************
vtkDataSet *
......@@ -139,16 +143,29 @@ avtWireframeFilter::ExecuteData(vtkDataSet *inDS, int, std::string)
// xtract the edges for correct wireframe rendering.
geoFilter->SetInput(inDS);
//
// If the input to the geometry filter is poly data, it does not pass
// the field data through. So copy that now.
//
geoFilter->Update(); // Update now so we can copy over the field data.
if (inDS->GetDataObjectType() == VTK_POLY_DATA)
geoFilter->GetOutput()->GetFieldData()
->ShallowCopy(inDS->GetFieldData());
edgesFilter->SetInput(geoFilter->GetOutput());
appendFilter->SetInputByNumber(0, geoFilter->GetOutput());
appendFilter->SetInputByNumber(1, edgesFilter->GetOutput());
//
// Lines must go before polys to avoid VTK bug with indexing cell data.
//
appendFilter->SetInputByNumber(0, edgesFilter->GetOutput());
appendFilter->SetInputByNumber(1, geoFilter->GetOutput());
vtkPolyData *outPolys = vtkPolyData::New();
appendFilter->SetOutput(outPolys);
appendFilter->Update();
return (vtkDataSet*) outPolys;
return outPolys;
}
......@@ -185,32 +202,3 @@ avtWireframeFilter::ReleaseData(void)
}
// ****************************************************************************
// Method: avtWireframeFilter::PostExecute
//
// Purpose:
// Send accurate Spatial Extents to output.
//
// Programmer: Kathleen Bonnell
// Creation: May 24, 2004
//
// Modifications:
//
// ****************************************************************************
void
avtWireframeFilter::PostExecute(void)
{
avtDataAttributes& outAtts = GetOutput()->GetInfo().GetAttributes();
// get the outputs's spatial extents
double se[6];
avtDataset_p output = GetTypedOutput();
avtDatasetExaminer::GetSpatialExtents(output, se);
// over-write spatial extents
outAtts.GetTrueSpatialExtents()->Clear();
outAtts.GetCumulativeTrueSpatialExtents()->Set(se);
}
// ************************************************************************* //
// avtWireframeFilter.h //
// avtWireframeFilter.h //
// ************************************************************************* //
#ifndef AVT_WIREFRAME_FILTER_H
......@@ -28,6 +28,9 @@ class vtkGeometryFilter;
//
// Modifications:
//
// Hank Childs, Fri Jul 30 12:09:16 PDT 2004
// Moved PostExecute to avtSurfaceFilter.
//
// ****************************************************************************
class avtWireframeFilter : public avtStreamer
......@@ -52,7 +55,6 @@ class avtWireframeFilter : public avtStreamer
vtkUniqueFeatureEdges *edgesFilter;
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
virtual void PostExecute(void);
};
......
......@@ -102,6 +102,10 @@ vtkUniqueFeatureEdges::~vtkUniqueFeatureEdges()
//
// Kathleen Bonnell, Mon May 20 17:01:31 PDT 2002
// Fix memory leak. (delete edgeTable).
//
// Hank Childs, Fri Jul 30 08:02:44 PDT 2004
// Copy over field data.
//
// ****************************************************************************
void vtkUniqueFeatureEdges::Execute()
......@@ -206,6 +210,7 @@ void vtkUniqueFeatureEdges::Execute()
outPD->CopyAllocate(pd, numPts);
outCD->CopyAllocate(cd, numCells);
GetOutput()->GetFieldData()->ShallowCopy(GetInput()->GetFieldData());
// Get our locator for merging points
//
......
......@@ -89,6 +89,9 @@ vtkVisItPolyDataNormals::Execute()
// critical math operations. Added note of concern about using
// VTK's normal calculation at all.
//
// Hank Childs, Fri Jul 30 09:00:51 PDT 2004
// Copy along cell data from verts and lines as well.
//
// ****************************************************************************
void
vtkVisItPolyDataNormals::ExecutePointWithoutSplitting()
......@@ -103,6 +106,10 @@ vtkVisItPolyDataNormals::ExecutePointWithoutSplitting()
vtkPoints *inPts = input->GetPoints();
int nCells = inCA->GetNumberOfCells();
int nOtherCells = input->GetVerts()->GetNumberOfCells() +
input->GetLines()->GetNumberOfCells();
int nTotalCells = nCells + nOtherCells;
int nPoints = input->GetNumberOfPoints();
vtkPolyData *output = GetOutput();
......@@ -144,11 +151,12 @@ vtkVisItPolyDataNormals::ExecutePointWithoutSplitting()
// Create the output cells, accumulating cell normals to the points
output->Allocate(inCA->GetNumberOfConnectivityEntries());
outCD->CopyAllocate(inCD, nCells);
outCD->CopyAllocate(inCD, nTotalCells);
vtkIdType *connPtr = inCA->GetPointer();
for (i = 0 ; i < nCells ; i++)
{
outCD->CopyData(inCD, i, i);
outCD->CopyData(inCD, nOtherCells+i, nOtherCells+i);
int nVerts = *connPtr++;
if (nVerts == 3)
{
......@@ -207,6 +215,10 @@ vtkVisItPolyDataNormals::ExecutePointWithoutSplitting()
// copy the original vertices and lines to the output
output->SetVerts(input->GetVerts());
output->SetLines(input->GetLines());
// copy the data from the lines and vertices now.
for (i = 0 ; i < nOtherCells ; i++)
outCD->CopyData(inCD, i, i);
}
// ****************************************************************************
......@@ -344,6 +356,9 @@ class NormalList
// Jeremy Meredith, Fri May 28 09:46:14 PDT 2004
// Use double precision math in critical sections.
//
// Hank Childs, Fri Jul 30 09:00:51 PDT 2004
// Account for cell data in verts and lines.
//
// ****************************************************************************
void
vtkVisItPolyDataNormals::ExecutePointWithSplitting()
......@@ -358,6 +373,10 @@ vtkVisItPolyDataNormals::ExecutePointWithSplitting()
vtkPoints *inPts = input->GetPoints();
int nCells = inCA->GetNumberOfCells();
int nOtherCells = input->GetPolys()->GetNumberOfCells() +
input->GetLines()->GetNumberOfCells();
int nTotalCells = nCells + nOtherCells;
int nPoints = input->GetNumberOfPoints();
vtkPolyData *output = GetOutput();
......@@ -375,7 +394,7 @@ vtkVisItPolyDataNormals::ExecutePointWithSplitting()
// the duplicated points (where a feature edge was found).
NormalList normalList(nPoints);
outCD->CopyAllocate(inCD, nCells);
outCD->CopyAllocate(inCD, nTotalCells);
vtkIdTypeArray *list = vtkIdTypeArray::New();
list->SetNumberOfValues(inCA->GetNumberOfConnectivityEntries());
vtkIdType *nl = list->GetPointer(0);
......@@ -385,7 +404,7 @@ vtkVisItPolyDataNormals::ExecutePointWithSplitting()
int newPointIndex = nPoints;
for (i = 0 ; i < nCells ; i++)
{
outCD->CopyData(inCD, i, i);
outCD->CopyData(inCD, i+nOtherCells, i+nOtherCells);
int nVerts;
nVerts = *connPtr++;
......@@ -595,6 +614,9 @@ vtkVisItPolyDataNormals::ExecutePointWithSplitting()
output->SetVerts(input->GetVerts());
output->SetLines(input->GetLines());
// copy the data from the lines and vertices now.
for (i = 0 ; i < nOtherCells ; i++)
outCD->CopyData(inCD, i, i);
}
// ****************************************************************************
......
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