Commit c357aab0 authored by hrchilds's avatar hrchilds
Browse files

Update from May 11, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@240 18c085ea-50e0-402c-830e-de6fd14e8384
parent 1f3d0624
......@@ -439,11 +439,16 @@ avtContourFilter::PreExecute(void)
// Hank Childs, Fri Jul 25 22:13:58 PDT 2003
// Made use of scalar tree and faster VisIt contouring module.
//
// Hank Childs, Tue May 11 06:47:24 PDT 2004
// Fix a bug that assumed that we would always have *something* to contour.
//
// ****************************************************************************
avtDataTree_p
avtContourFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain, string label)
{
int tt1 = visitTimer->StartTimer();
int i;
char *contourVar = (activeVariable != NULL ? activeVariable
: pipelineVariable);
......@@ -466,6 +471,7 @@ avtContourFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain, string label)
// Contouring only works on nodal variables -- make sure that we have
// a nodal variable before progressing.
//
int t3 = visitTimer->StartTimer();
vtkDataArray *cellVar = in_ds->GetCellData()->GetArray(contourVar);
if (cellVar != NULL)
{
......@@ -499,6 +505,7 @@ avtContourFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain, string label)
toBeContoured->ShallowCopy(in_ds);
}
toBeContoured->GetPointData()->SetActiveScalars(contourVar);
visitTimer->StopTimer(t3, "Recentering");
vtkVisItScalarTree *tree = vtkVisItScalarTree::New();
tree->SetDataSet(toBeContoured);
......@@ -520,7 +527,13 @@ avtContourFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain, string label)
visitTimer->StopTimer(id1, "Getting cell list");
int id2 = visitTimer->StartTimer();
cf->SetIsovalue(isoValues[i]);
cf->SetCellList(&(list[0]), list.size());
int *list2 = NULL;
int emptylist[1] = { 0 };
if (list.size() <= 0)
list2 = emptylist;
else
list2 = &(list[0]);
cf->SetCellList(list2, list.size());
output->Update();
if (output->GetNumberOfCells() == 0)
......@@ -560,6 +573,7 @@ avtContourFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain, string label)
toBeContoured->Delete();
tree->Delete();
visitTimer->StopTimer(tt1, "avtContourFilter::ExecuteData");
return outDT;
}
......
......@@ -843,6 +843,9 @@ GetDataRange(vtkDataSet *ds, double *de, const char *vname)
// Kathleen Bonnell, Thu Mar 11 10:32:04 PST 2004
// Renamed from GetDataRange. DataExtents now always have only 2 components.
//
// Kathleen Bonnell, Tue May 11 08:02:51 PDT 2004
// Added support for VTK_DOUBLE.
//
// ****************************************************************************
void
......@@ -877,6 +880,16 @@ GetDataScalarRange(vtkDataSet *ds, double *exts, const char *vname)
ptr++;
}
}
if (da->GetDataType() == VTK_DOUBLE)
{
double *ptr = (double *) da->GetVoidPointer(0);
for (i = 0 ; i < nvals ; i++)
{
exts[0] = (exts[0] < *ptr ? exts[0] : *ptr);
exts[1] = (exts[1] > *ptr ? exts[1] : *ptr);
ptr++;
}
}
else if (da->GetDataType() == VTK_INT)
{
int *ptr = (int *) da->GetVoidPointer(0);
......
......@@ -105,6 +105,9 @@ avtOpenGL3DTextureVolumeRenderer::~avtOpenGL3DTextureVolumeRenderer()
// Jeremy Meredith, Fri Oct 10 16:29:31 PDT 2003
// Made it work with Mesa again.
//
// Hank Childs, Tue May 11 15:24:45 PDT 2004
// Turn off blending so transparent surfaces can work afterwards.
//
// ****************************************************************************
void
avtOpenGL3DTextureVolumeRenderer::Render(vtkRectilinearGrid *grid,
......@@ -329,7 +332,9 @@ avtOpenGL3DTextureVolumeRenderer::Render(vtkRectilinearGrid *grid,
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glEnable(GL_TEXTURE_3D);
//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
bool alreadyBlending = glIsEnabled(GL_BLEND);
if (!alreadyBlending)
glEnable(GL_BLEND);
glDepthMask(false);
// Set up camera parameters
......@@ -427,7 +432,8 @@ avtOpenGL3DTextureVolumeRenderer::Render(vtkRectilinearGrid *grid,
// Set some GL parameters back to their expected values and free memory
glDepthMask(true);
glDisable(GL_TEXTURE_3D);
glDisable(GL_BLEND);
if (!alreadyBlending)
glDisable(GL_BLEND);
glEnable(GL_LIGHTING);
opac->Delete();
data->Delete();
......@@ -460,6 +466,9 @@ avtOpenGL3DTextureVolumeRenderer::Render(vtkRectilinearGrid *grid,
//
// Modifications:
//
// Hank Childs, Tue May 11 15:24:45 PDT 2004
// Turn off blending so transparent surfaces can work afterwards.
//
// ****************************************************************************
void
......@@ -658,7 +667,9 @@ avtOpenGL3DTextureVolumeRenderer::Render(vtkRectilinearGrid *grid,
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glEnable(GL_TEXTURE_3D);
//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
bool alreadyBlending = glIsEnabled(GL_BLEND);
if (!alreadyBlending)
glEnable(GL_BLEND);
// set up parameters
vtkCamera *camera = vtkCamera::New();
......@@ -891,7 +902,8 @@ avtOpenGL3DTextureVolumeRenderer::Render(vtkRectilinearGrid *grid,
glDepthMask(true);
glDisable(GL_TEXTURE_3D);
glDisable(GL_BLEND);
if (!alreadyBlending)
glDisable(GL_BLEND);
glEnable(GL_LIGHTING);
opac->Delete();
data->Delete();
......
......@@ -116,6 +116,9 @@ avtOpenGLSplattingVolumeRenderer::~avtOpenGLSplattingVolumeRenderer()
// Made this class not inherit from avtVolumeRenderer, so it now receives
// most of its state in the Render arguments every frame.
//
// Hank Childs, Tue May 11 15:24:45 PDT 2004
// Turn off blending so transparent surfaces can work afterwards.
//
// ****************************************************************************
void
......@@ -169,7 +172,9 @@ avtOpenGLSplattingVolumeRenderer::Render(vtkRectilinearGrid *grid,
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glBindTexture(GL_TEXTURE_2D, alphatexId);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
bool alreadyBlending = glIsEnabled(GL_BLEND);
if (!alreadyBlending)
glEnable(GL_BLEND);
// set up parameters
vtkCamera *camera = vtkCamera::New();
......@@ -485,7 +490,8 @@ avtOpenGLSplattingVolumeRenderer::Render(vtkRectilinearGrid *grid,
glDepthMask(true);
glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
if (!alreadyBlending)
glDisable(GL_BLEND);
glEnable(GL_LIGHTING);
opac->Delete();
data->Delete();
......
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