Commit 86767b05 authored by hrchilds's avatar hrchilds

Update from May 5, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@235 18c085ea-50e0-402c-830e-de6fd14e8384
parent 1cd70c04
......@@ -325,6 +325,9 @@ avtFacelistFilter::ExecuteData(vtkDataSet *in_ds, int domain, std::string)
// Hank Childs, Tue Jun 3 15:07:11 PDT 2003
// Account for avtFacelists that are "bad".
//
// Hank Childs, Wed May 5 16:18:44 PDT 2004
// Do not prevent normal calculation for rectilinear grids.
//
// ****************************************************************************
vtkDataSet *
......@@ -342,7 +345,6 @@ avtFacelistFilter::Take3DFaces(vtkDataSet *in_ds, int domain)
rf->SetInput((vtkRectilinearGrid *) in_ds);
rf->SetOutput(pd);
rf->Update();
GetOutput()->GetInfo().GetValidity().SetNormalsAreInappropriate(true);
out_ds = pd;
mustDeReference = true;
break;
......
......@@ -538,6 +538,9 @@ avtPointToGlyphFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
// Jeremy Meredith, Tue May 4 12:31:47 PDT 2004
// Don't change topological dimension from zero if we are not glyphing.
//
// Hank Childs, Wed May 5 16:05:41 PDT 2004
// Allow for all glyphs to get shaded.
//
// ****************************************************************************
void
......@@ -549,9 +552,6 @@ avtPointToGlyphFilter::RefashionDataObjectInfo(void)
GetOutput()->GetInfo().GetAttributes().SetTopologicalDimension(2);
GetOutput()->GetInfo().GetValidity().
SetWireframeRenderingIsInappropriate(true);
if (glyphType != 2)
GetOutput()->GetInfo().GetValidity().
SetNormalsAreInappropriate(true);
}
}
......
......@@ -10,6 +10,7 @@
#include <vtkProperty.h>
#include <vtkPolyData.h>
#include <vtkTensorGlyph.h>
#include <vtkVisItPolyDataNormals.h>
#include <BadIndexException.h>
......@@ -24,6 +25,11 @@
// Programmer: Hank Childs
// Creation: September 23, 2003
//
// Modifications:
//
// Hank Childs, Wed May 5 14:19:54 PDT 2004
// Added poly data normals.
//
// ****************************************************************************
avtTensorGlyphMapper::avtTensorGlyphMapper(vtkPolyData *g)
......@@ -34,6 +40,7 @@ avtTensorGlyphMapper::avtTensorGlyphMapper(vtkPolyData *g)
colorByMag = true;
scale = 0.2;
tensorFilter = NULL;
normalsFilter = NULL;
nTensorFilters = 0;
lut = NULL;
}
......@@ -45,6 +52,11 @@ avtTensorGlyphMapper::avtTensorGlyphMapper(vtkPolyData *g)
// Programmer: Hank Childs
// Creation: September 23, 2003
//
// Modifications:
//
// Hank Childs, Wed May 5 14:19:54 PDT 2004
// Deleted poly data normals.
//
// ****************************************************************************
avtTensorGlyphMapper::~avtTensorGlyphMapper()
......@@ -66,6 +78,17 @@ avtTensorGlyphMapper::~avtTensorGlyphMapper()
}
delete [] tensorFilter;
}
if (normalsFilter != NULL)
{
for (int i = 0 ; i < nTensorFilters ; i++)
{
if (normalsFilter[i] != NULL)
{
normalsFilter[i]->Delete();
}
}
delete [] normalsFilter;
}
}
......@@ -79,6 +102,11 @@ avtTensorGlyphMapper::~avtTensorGlyphMapper()
// Programmer: Hank Childs
// Creation: September 23, 2003
//
// Modifications:
//
// Hank Childs, Wed May 5 14:19:54 PDT 2004
// Added poly data normals.
//
// ****************************************************************************
void
......@@ -93,6 +121,10 @@ avtTensorGlyphMapper::CustomizeMappers(void)
tensorFilter[i]->SetSource(glyph);
tensorFilter[i]->SetScaling(1);
}
if (normalsFilter[i] != NULL)
{
normalsFilter[i]->SetNormalTypeToCell();
}
}
}
......@@ -129,6 +161,11 @@ avtTensorGlyphMapper::CustomizeMappers(void)
// Programmer: Hank Childs
// Creation: September 23, 2003
//
// Modifications:
//
// Hank Childs, Wed May 5 14:19:54 PDT 2004
// Added poly data normals.
//
// ****************************************************************************
void
......@@ -145,12 +182,25 @@ avtTensorGlyphMapper::SetUpFilters(int nDoms)
}
delete [] tensorFilter;
}
if (normalsFilter != NULL)
{
for (int i = 0 ; i < nTensorFilters ; i++)
{
if (normalsFilter[i] != NULL)
{
normalsFilter[i]->Delete();
}
}
delete [] normalsFilter;
}
nTensorFilters = nDoms;
tensorFilter = new vtkTensorGlyph*[nTensorFilters];
normalsFilter = new vtkVisItPolyDataNormals*[nTensorFilters];
for (int i = 0 ; i < nTensorFilters ; i++)
{
tensorFilter[i] = NULL;
normalsFilter[i] = NULL;
}
}
......@@ -171,6 +221,11 @@ avtTensorGlyphMapper::SetUpFilters(int nDoms)
// Programmer: Hank Childs
// Creation: September 23, 2003
//
// Modifications:
//
// Hank Childs, Wed May 5 14:19:54 PDT 2004
// Added poly data normals.
//
// ****************************************************************************
vtkDataSet *
......@@ -189,10 +244,15 @@ avtTensorGlyphMapper::InsertFilters(vtkDataSet *ds, int dom)
//
tensorFilter[dom] = vtkTensorGlyph::New();
}
if (normalsFilter[dom] == NULL)
{
normalsFilter[dom] = vtkVisItPolyDataNormals::New();
}
tensorFilter[dom]->SetInput(ds);
normalsFilter[dom]->SetInput(tensorFilter[dom]->GetOutput());
return tensorFilter[dom]->GetOutput();
return normalsFilter[dom]->GetOutput();
}
......
......@@ -12,6 +12,7 @@
class vtkTensorGlyph;
class vtkLookupTable;
class vtkPolyData;
class vtkVisItPolyDataNormals;
// ****************************************************************************
......@@ -24,6 +25,11 @@ class vtkPolyData;
// Programmer: Hank Childs
// Creation: September 23, 2003
//
// Modifications:
//
// Hank Childs, Wed May 5 16:23:29 PDT 2004
// Add normals calculation.
//
// ****************************************************************************
class PLOTTER_API avtTensorGlyphMapper : public avtMapper
......@@ -45,6 +51,7 @@ class PLOTTER_API avtTensorGlyphMapper : public avtMapper
float scale;
vtkTensorGlyph **tensorFilter;
vtkVisItPolyDataNormals **normalsFilter;
int nTensorFilters;
virtual void CustomizeMappers(void);
......
......@@ -10,6 +10,7 @@
#include <vtkProperty.h>
#include <vtkDataSetMapper.h>
#include <vtkLookupTable.h>
#include <vtkVisItPolyDataNormals.h>
#include <BadIndexException.h>
......@@ -41,6 +42,9 @@
// Kathleen Bonnell, Tue Dec 3 16:10:40 PST 2002
// Re-initialize lineWidth, based on new LineAttributes.
//
// Hank Childs, Wed May 5 14:19:54 PDT 2004
// Added poly data normals.
//
// ****************************************************************************
avtVectorGlyphMapper::avtVectorGlyphMapper(vtkPolyData *g)
......@@ -53,6 +57,7 @@ avtVectorGlyphMapper::avtVectorGlyphMapper(vtkPolyData *g)
colorByMag = true;
scale = 0.2;
glyphFilter = 0;
normalsFilter = NULL;
nGlyphFilters = 0;
lut = NULL;
}
......@@ -64,6 +69,11 @@ avtVectorGlyphMapper::avtVectorGlyphMapper(vtkPolyData *g)
// Programmer: Hank Childs
// Creation: March 23, 2001
//
// Modifications:
//
// Hank Childs, Wed May 5 14:19:54 PDT 2004
// Deleted poly data normals.
//
// ****************************************************************************
avtVectorGlyphMapper::~avtVectorGlyphMapper()
......@@ -85,6 +95,17 @@ avtVectorGlyphMapper::~avtVectorGlyphMapper()
}
delete [] glyphFilter;
}
if (normalsFilter != NULL)
{
for (int i = 0 ; i < nGlyphFilters ; i++)
{
if (normalsFilter[i] != NULL)
{
normalsFilter[i]->Delete();
}
}
delete [] normalsFilter;
}
}
......@@ -110,6 +131,9 @@ avtVectorGlyphMapper::~avtVectorGlyphMapper()
// Kathleen Bonnell, Wed Aug 29 16:44:31 PDT 2001
// Set mappers lookup table with member lut.
//
// Hank Childs, Wed May 5 14:19:54 PDT 2004
// Added poly data normals.
//
// ****************************************************************************
void
......@@ -124,6 +148,10 @@ avtVectorGlyphMapper::CustomizeMappers(void)
glyphFilter[i]->SetSource(glyph);
glyphFilter[i]->SetScaleModeToScaleByVector();
}
if (normalsFilter[i] != NULL)
{
normalsFilter[i]->SetNormalTypeToCell();
}
}
}
......@@ -169,6 +197,9 @@ avtVectorGlyphMapper::CustomizeMappers(void)
// Removed unsupported parameter nRenModes, and logic associated with
// it, including glyphFilterStride..
//
// Hank Childs, Wed May 5 14:19:54 PDT 2004
// Added poly data normals.
//
// ****************************************************************************
void
......@@ -185,12 +216,25 @@ avtVectorGlyphMapper::SetUpFilters(int nDoms)
}
delete [] glyphFilter;
}
if (normalsFilter != NULL)
{
for (int i = 0 ; i < nGlyphFilters ; i++)
{
if (normalsFilter[i] != NULL)
{
normalsFilter[i]->Delete();
}
}
delete [] normalsFilter;
}
nGlyphFilters = nDoms;
glyphFilter = new vtkGlyph3D*[nGlyphFilters];
normalsFilter = new vtkVisItPolyDataNormals*[nGlyphFilters];
for (int i = 0 ; i < nGlyphFilters ; i++)
{
glyphFilter[i] = NULL;
normalsFilter[i] = NULL;
}
}
......@@ -216,6 +260,9 @@ avtVectorGlyphMapper::SetUpFilters(int nDoms)
// Kathleen Bonnell, Mon Aug 20 18:19:25 PDT 2001
// Removed unsupported paramter 'mode' and logic associated with it.
//
// Hank Childs, Wed May 5 14:19:54 PDT 2004
// Added poly data normals.
//
// ****************************************************************************
vtkDataSet *
......@@ -234,10 +281,15 @@ avtVectorGlyphMapper::InsertFilters(vtkDataSet *ds, int dom)
//
glyphFilter[dom] = vtkGlyph3D::New();
}
if (normalsFilter[dom] == NULL)
{
normalsFilter[dom] = vtkVisItPolyDataNormals::New();
}
glyphFilter[dom]->SetInput(ds);
normalsFilter[dom]->SetInput(glyphFilter[dom]->GetOutput());
return glyphFilter[dom]->GetOutput();
return normalsFilter[dom]->GetOutput();
}
......
......@@ -13,6 +13,7 @@
class vtkGlyph3D;
class vtkLookupTable;
class vtkPolyData;
class vtkVisItPolyDataNormals;
// ****************************************************************************
......@@ -47,6 +48,9 @@ class vtkPolyData;
// Hank Childs, Wed Sep 24 09:42:29 PDT 2003
// Renamed to vector glyph mapper.
//
// Hank Childs, Tue May 4 16:47:29 PDT 2004
// Allow for normals-generation.
//
// ****************************************************************************
class PLOTTER_API avtVectorGlyphMapper : public avtMapper
......@@ -72,6 +76,7 @@ class PLOTTER_API avtVectorGlyphMapper : public avtMapper
float scale;
vtkGlyph3D **glyphFilter;
vtkVisItPolyDataNormals **normalsFilter;
int nGlyphFilters;
virtual void CustomizeMappers(void);
......
......@@ -178,6 +178,9 @@ avtPickQuery::PreExecute(void)
// Kathleen Bonnell, Tue Mar 16 15:55:18 PST 2004
// Remove any "mesh" PickVarInfo's, as they are unnecessary
//
// Kathleen Bonnell, Wed May 5 13:24:52 PDT 2004
// Added error message.
//
// ****************************************************************************
void
......@@ -229,7 +232,9 @@ avtPickQuery::PostExecute(void)
MPI_Send(buf, size, MPI_UNSIGNED_CHAR, 0, myRank, MPI_COMM_WORLD);
delete [] buf;
}
return;
}
#endif
//
......@@ -244,7 +249,15 @@ avtPickQuery::PostExecute(void)
}
}
//
// If we haven't been able to get the necessary info, and
// no previous error was set, then
//
if (!pickAtts.GetFulfilled() && !pickAtts.GetError())
{
pickAtts.SetError(true);
pickAtts.SetErrorMessage("Chosen pick did not intersect surface.");
}
}
......@@ -333,6 +346,9 @@ avtPickQuery::PostExecute(void)
// Kathleen Bonnell, Tue May 4 14:26:42 PDT 2004
// Replaced avtCallback to a pickAtts error message.
//
// Kathleen Bonnell, Wed May 5 13:24:52 PDT 2004
// Added error messages.
//
// ****************************************************************************
void
......@@ -369,7 +385,8 @@ avtPickQuery::Execute(vtkDataSet *ds, const int dom)
debug5 << "PICK BIG PROBLEM! "
<< "Could not find zone corresponding to pick point" << endl;
pickAtts.SetErrorMessage("Pick encountered an internal "
"error. Please contact a VisIt developer");
"error (could not find zone corresponding to pick point).\n"
"Please contact a VisIt developer");
pickAtts.SetError(true);
return;
}
......@@ -440,6 +457,10 @@ avtPickQuery::Execute(vtkDataSet *ds, const int dom)
// SetDomain and ElementNumber to -1 to indicate failure.
pickAtts.SetDomain(-1);
pickAtts.SetElementNumber(-1);
pickAtts.SetErrorMessage("Pick encountered an internal "
"error (could not find incident elements).\n"
"Please contact a VisIt developer");
pickAtts.SetError(true);
return;
}
}
......
......@@ -1771,6 +1771,9 @@ NetworkManager::StopPickMode(void)
// Send the SILRestriction to PickQuery (insted of UseSet).
// If LocateCellQuery fails, set error condition in PickAtts.
//
// Kathleen Bonnell, Wed May 5 13:07:12 PDT 2004
// Moved error-setting code to PickQuery, as it causes problems in parallel.
//
// ****************************************************************************
void
......@@ -1828,32 +1831,22 @@ NetworkManager::Pick(const int id, PickAttributes *pa)
*pa = *(lcQ->GetPickAtts());
delete lcQ;
}
if (pa->GetDomain() != -1)
{
pQ = new avtPickQuery;
pQ->SetInput(networkCache[id]->GetNetDB()->GetOutput());
if (*silr != NULL)
pQ->SetSILRestriction(silr->MakeAttributes());
if (queryInput->GetInfo().GetAttributes().HasTransform() &&
queryInput->GetInfo().GetAttributes().GetCanUseTransform())
{
pQ->SetTransform(queryInput->GetInfo().GetAttributes().GetTransform());
}
pQ->SetNeedTransform(
queryInput->GetInfo().GetValidity().GetPointsWereTransformed());
pQ->SetPickAtts(pa);
pQ->PerformQuery(&qa);
*pa = *(pQ->GetPickAtts());
delete pQ;
}
else
pQ = new avtPickQuery;
pQ->SetInput(networkCache[id]->GetNetDB()->GetOutput());
if (*silr != NULL)
pQ->SetSILRestriction(silr->MakeAttributes());
if (queryInput->GetInfo().GetAttributes().HasTransform() &&
queryInput->GetInfo().GetAttributes().GetCanUseTransform())
{
if (!pa->GetError())
{
pa->SetError(true);
pa->SetErrorMessage("Chosen pick did not intersect surface.");
}
pQ->SetTransform(queryInput->GetInfo().GetAttributes().GetTransform());
}
pQ->SetNeedTransform(
queryInput->GetInfo().GetValidity().GetPointsWereTransformed());
pQ->SetPickAtts(pa);
pQ->PerformQuery(&qa);
*pa = *(pQ->GetPickAtts());
delete pQ;
}
else
{
......
......@@ -6,7 +6,6 @@
#include <vtkCell.h>
#include <vtkCellData.h>
#include <vtkClipDataSet.h>
#include <vtkClipPolyData.h>
#include <vtkDataSet.h>
#include <vtkIdList.h>
......@@ -20,7 +19,7 @@
#include <vtkSphere.h>
#include <vtkStructuredPoints.h>
#include <vtkUnstructuredGrid.h>
#include <vtkVisItClipper3D.h>
#include <vtkVisItClipper.h>
#include <vtkVisItUtility.h>
#include <vtkDataSetWriter.h>
......@@ -47,13 +46,16 @@
// Jeremy Meredith, Fri Aug 8 09:18:40 PDT 2003
// Removed subdivision and connectivity flags. Added fastClipper.
//
// Jeremy Meredith, Wed May 5 13:05:35 PDT 2004
// Made my fast clipper support 2D, and removed the old generic
// VTK data set clipper.
//
// ****************************************************************************
avtClipFilter::avtClipFilter()
{
clipData = vtkClipDataSet::New();
clipPoly = vtkClipPolyData::New();
fastClipper = vtkVisItClipper3D::New();
fastClipper = vtkVisItClipper::New();
}
......@@ -71,15 +73,14 @@ avtClipFilter::avtClipFilter()
// Jeremy Meredith, Mon Aug 11 17:04:29 PDT 2003
// Added fastClipper.
//
// Jeremy Meredith, Wed May 5 13:05:35 PDT 2004
// Made my fast clipper support 2D, and removed the old generic
// VTK data set clipper.
//
// ****************************************************************************
avtClipFilter::~avtClipFilter()
{
if (clipData != NULL)
{
clipData->Delete();
clipData = NULL;
}
if (clipPoly != NULL)
{
clipPoly->Delete();
......@@ -197,6 +198,9 @@ avtClipFilter::Equivalent(const AttributeGroup *a)
// Creation: August 8, 2003
//
// Modifications:
// Jeremy Meredith, Wed May 5 13:05:35 PDT 2004
// Made my fast clipper support 2D, and removed the old generic
// VTK data set clipper.
//
// ****************************************************************************
......@@ -235,23 +239,6 @@ avtClipFilter::ExecuteData(vtkDataSet *inDS, int dom, std::string)
}
clipPoly->Update();
}
else if(GetInput()->GetInfo().GetAttributes().GetTopologicalDimension()!=3)
{
outDS = vtkUnstructuredGrid::New();
clipData->SetInput(inDS);
clipData->SetOutput((vtkUnstructuredGrid*)outDS);
clipData->SetClipFunction(ifuncs);
clipData->GenerateClipScalarsOff();
if (inverse)
{
clipData->InsideOutOn();
}
else
{
clipData->InsideOutOff();
}
clipData->Update();
}
else
{
outDS = vtkUnstructuredGrid::New();
......@@ -429,6 +416,9 @@ avtClipFilter::PerformRestriction(avtPipelineSpecification_p spec)
// Creation: August 8, 2003
//
// Modifications:
// Jeremy Meredith, Wed May 5 13:05:35 PDT 2004
// Made my fast clipper support 2D, and removed the old generic
// VTK data set clipper.
//
// ****************************************************************************
......@@ -437,9 +427,6 @@ avtClipFilter::ReleaseData(void)
{
avtPluginStreamer::ReleaseData();
clipData->SetInput(NULL);
clipData->SetOutput(NULL);
clipData->SetLocator(NULL);
clipPoly->SetInput(NULL);
clipPoly->SetOutput(NULL);
}
......@@ -11,13 +11,12 @@
class vtkDataSet;
class vtkClipDataSet;
class vtkClipVolume;
class vtkClipPolyData;
class vtkImplicitBoolean;
class vtkImplicitFunction;
class vtkUnstructuredGrid;
class vtkVisItClipper3D;
class vtkVisItClipper;
// ****************************************************************************
......@@ -44,6 +43,10 @@ class vtkVisItClipper3D;
// Rewrote a huge chunk to make use of my new vtkVisItClipper3D. The
// speedup from using this filter whenever possible is really, really big.
//
// Jeremy Meredith, Wed May 5 13:05:35 PDT 2004
// Made my fast clipper support 2D, and removed the old generic
// VTK data set clipper.
//
// ****************************************************************************
class avtClipFilter : public avtPluginStreamer
......@@ -64,9 +67,8 @@ class avtClipFilter : public avtPluginStreamer
protected:
ClipAttributes atts;
vtkClipDataSet *clipData;
vtkClipPolyData *clipPoly;
vtkVisItClipper3D *fastClipper;
vtkVisItClipper *fastClipper;
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
virtual void RefashionDataObjectInfo(void);
......
......@@ -116,6 +116,9 @@ QvisIsovolumeWindow::CreateWindowContents()
// Creation: Fri Jan 30 14:50:02 PST 2004
//
// Modifications:
// Jeremy Meredith, Wed May 5 14:55:08 PDT 2004
// Made it support "min" and "max" as legal values, respectively, for
// the lower and upper bound fields.
//
// ****************************************************************************
......@@ -123,33 +126,31 @@ void
QvisIsovolumeWindow::UpdateWindow(bool doAll)
{
QString temp;
double r;
for(int i = 0; i < atts->NumAttributes(); ++i)
for (int i = 0; i < atts->NumAttributes(); ++i)
{
if(!doAll)
if (!doAll)
{
if(!atts->IsSelected(i))
if (!atts->IsSelected(i))
{
continue;
}
}
const double *dptr;
const float *fptr;
const int *iptr;
const char *cptr;
const unsigned char *uptr;
const string *sptr;
QColor tempcolor;
switch(i)
switch (i)
{
case 0: //lbound
temp.sprintf("%g", atts->GetLbound());
if (atts->GetLbound() == -1e+37)
temp = "min";
else
temp.sprintf("%g", atts->GetLbound());
lbound->setText(temp);
break;
case 1: //ubound
temp.sprintf("%g", atts->GetUbound());
if (atts->GetUbound() == +1e+37)
temp = "max";
else
temp.sprintf("%g", atts->GetUbound());
ubound->setText(temp);
break;
case 2: //variable
......@@ -171,6 +172,9 @@ QvisIsovolumeWindow::UpdateWindow(bool doAll)
// Creation: Fri Jan 30 14:50:02 PST 2004
//
// Modifications:
// Jeremy Meredith, Wed May 5 14:55:08 PDT 2004
// Made it support "min" and "max" as legal values, respectively, for
// the lower and upper bound fields.
//
// ****************************************************************************
......@@ -184,20 +188,25 @@ QvisIsovolumeWindow::GetCurrentValues(int which_widget)
if(which_widget == 0 || doAll)
{
temp = lbound->displayText().simplifyWhiteSpace();
okay = !temp.isEmpty();
if(okay)
if (temp.latin1() == QString("min"))
atts->SetLbound(-1e+37);
else
{
double val = temp.toDouble(&okay);
atts->SetLbound(val);
}
okay = !temp.isEmpty();
if(okay)
{
double val = temp.toDouble(&okay);
atts->SetLbound(val);
}
if(!okay)
{
msg.sprintf("The value of lbound was invalid. "
"Resetting to the last good value of %g.",
atts->GetLbound());
Message(msg);
atts->SetLbound(atts->GetLbound());
if(!okay)
{
msg.sprintf("The value of lbound was invalid. "
"Resetting to the last good value of %g.",
atts->GetLbound());
Message(msg);
atts->SetLbound(atts->GetLbound());
}
}
}
......@@ -205,20 +214,25 @@ QvisIsovolumeWindow::GetCurrentValues(int which_widget)
if(which_widget == 1 || doAll)
{
temp = ubound->displayText().simplifyWhiteSpace();
okay = !temp.isEmpty();
if(okay)
if (temp.latin1() == QString("max"))