Commit 25500bc2 authored by hrchilds's avatar hrchilds
Browse files

Update from December 6, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@373 18c085ea-50e0-402c-830e-de6fd14e8384
parent 6b25983e
......@@ -96,6 +96,9 @@
# Jeremy Meredith, Thu Oct 21 11:54:58 PDT 2004
# Removed reflect2.py from skip list for scalable,parallel.
#
# Hank Childs, Fri Dec 3 11:08:55 PST 2004
# Removed volume.py from skipList.
#
# ----------------------------------------------------------------------------
# list of users who want email every night with the log file
......@@ -223,8 +226,7 @@ curdate=`date +%Y-%m-%d-%p%I%M`
modes="serial parallel scalable,parallel"
# set list of tests/modes to skip
skipList="scalable,parallel:tests/hybrid/lineout.py \
scalable,parallel:tests/rendering/volume.py"
skipList="scalable,parallel:tests/hybrid/lineout.py"
# run the test(s)
error=0
......
......@@ -44,6 +44,9 @@
# Jeremy Meredith, Wed Sep 1 09:56:48 PDT 2004
# Added avtTiledImageCompositor.
#
# Hank Childs, Mon Nov 22 08:38:45 PST 2004
# Added avtMassVoxelExtractor.
#
##############################################################################
##
......@@ -69,6 +72,7 @@ SRC=\
avtGhostZoneFilter.C \
avtImageCommunicator.C \
avtImageCompositer.C \
avtMassVoxelExtractor.C \
avtPointToGlyphFilter.C \
avtRayCompositer.C \
avtRayTracer.C \
......
This diff is collapsed.
......@@ -5,11 +5,13 @@
#ifndef AVT_MASS_VOXEL_EXTRACTOR_H
#define AVT_MASS_VOXEL_EXTRACTOR_H
#include <pipeline_exports.h>
#include <filters_exports.h>
#include <avtExtractor.h>
#include <avtViewInfo.h>
class vtkRectilinearGrid;
class vtkMatrix4x4;
// ****************************************************************************
......@@ -29,9 +31,13 @@ class vtkRectilinearGrid;
// Moved inlined constructor and destructor definitions to .C files
// because certain compilers have problems with them.
//
// Hank Childs, Fri Nov 19 14:50:58 PST 2004
// Added support for accepting grids that need to do a world space to
// image space conversion as well. Also changed API to AVTFILTERS_API.
//
// ****************************************************************************
class PIPELINE_API avtMassVoxelExtractor : public avtExtractor
class AVTFILTERS_API avtMassVoxelExtractor : public avtExtractor
{
public:
avtMassVoxelExtractor(int, int, int, avtVolume *,
......@@ -39,6 +45,52 @@ class PIPELINE_API avtMassVoxelExtractor : public avtExtractor
virtual ~avtMassVoxelExtractor();
void Extract(vtkRectilinearGrid *);
void SetGridsAreInWorldSpace(bool, const avtViewInfo &,double);
protected:
bool gridsAreInWorldSpace;
avtViewInfo view;
double aspect;
double cur_clip_range[2];
vtkMatrix4x4 *view_to_world_transform;
float *ProportionSpaceToZBufferSpace;
float *X;
float *Y;
float *Z;
unsigned char *ghosts;
int dims[3];
int ncell_arrays;
float *cell_arrays[AVT_VARIABLE_LIMIT];
int npt_arrays;
float *pt_arrays[AVT_VARIABLE_LIMIT];
float *prop_buffer;
int *ind_buffer;
bool *valid_sample;
// We repeaated divide by the term (X[i+1]-X[i]). In the interest of
// performance, cache the term 1./(X[i+1]-X[i]) and use that for faster
// multiplication. This speed up total performance by about 5%.
float *divisors_X;
float *divisors_Y;
float *divisors_Z;
void ExtractImageSpaceGrid(vtkRectilinearGrid *);
void ExtractWorldSpaceGrid(vtkRectilinearGrid *);
void RegisterGrid(vtkRectilinearGrid *);
void SampleAlongSegment(const float *, const float*, int, int);
void SampleVariable(int, int, int, int);
bool FrustumIntersectsGrid(int, int, int, int) const;
void GetSegment(int, int, float *, float *) const;
static void FindPlaneNormal(const float *, const float *,
const float *, float *);
bool GridOnPlusSideOfPlane(const float *, const float *) const;
bool FindSegmentIntersections(const float *, const float *,
int &, int &);
};
......
......@@ -216,6 +216,13 @@ avtRayTracer::SetGradientBackgroundColors(const float bg1[3],
// Hank Childs, Fri Sep 13 12:04:04 PDT 2002
// Reverse arguments for CopyTo (we weren't sending in the input correctly).
//
// Hank Childs, Fri Nov 19 13:47:20 PST 2004
// Added option to have sampling of rectilinear grids done efficiently
// by sample point extractor by not converting grid into image space.
//
// Hank Childs, Thu Dec 2 09:26:28 PST 2004
// No longer tighten clipping planes ['5699].
//
// ****************************************************************************
void
......@@ -238,7 +245,6 @@ avtRayTracer::Execute(void)
aspect = (double)screen[0] / (double)screen[1];
}
avtWorldSpaceToImageSpaceTransform trans(view, aspect);
trans.TightenClippingPlanes(true);
trans.SetInput(GetInput());
//
......@@ -248,6 +254,15 @@ avtRayTracer::Execute(void)
extractor.RegisterRayFunction(rayfoo);
extractor.SetInput(trans.GetOutput());
//
// For curvilinear and unstructured meshes, it makes sense to convert the
// cells to image space. But for rectilinear meshes, it is not the
// most efficient strategy. So set some flags here that allow the
// extractor to do the extraction in world space.
//
trans.SetPassThruRectilinearGrids(true);
extractor.SetRectilinearGridsAreInWorldSpace(true, view, aspect);
avtDataObject_p samples = extractor.GetOutput();
#ifdef PARALLEL
......
......@@ -55,6 +55,9 @@
// Hank Childs, Sun Dec 14 11:07:56 PST 2003
// Initialized massVoxelExtractor.
//
// Hank Childs, Fri Nov 19 13:57:02 PST 2004
// Initialized rectilinearGridsAreInWorldSpace.
//
// ****************************************************************************
avtSamplePointExtractor::avtSamplePointExtractor(int w, int h, int d)
......@@ -73,8 +76,10 @@ avtSamplePointExtractor::avtSamplePointExtractor(int w, int h, int d)
wedgeExtractor = NULL;
sendCells = false;
rayfoo = NULL;
rectilinearGridsAreInWorldSpace = false;
aspect = 1.;
}
......@@ -121,6 +126,28 @@ avtSamplePointExtractor::~avtSamplePointExtractor()
}
// ****************************************************************************
// Method: avtSamplePointExtractor::SetRectilinearGridsAreInWorldSpace
//
// Purpose:
// Tells this object that any input rectilinear grids are in world space,
// not image space.
//
// Programmer: Hank Childs
// Creation: November 19, 2004
//
// ****************************************************************************
void
avtSamplePointExtractor::SetRectilinearGridsAreInWorldSpace(bool val,
const avtViewInfo &v, double a)
{
rectilinearGridsAreInWorldSpace = true;
viewInfo = v;
aspect = a;
}
// ****************************************************************************
// Method: avtSamplePointExtractor::Execute
//
......@@ -275,6 +302,10 @@ avtSamplePointExtractor::SetUpExtractors(void)
// Hank Childs, Fri Aug 27 16:47:45 PDT 2004
// Rename ghost data arrays.
//
// Hank Childs, Fri Nov 19 13:57:02 PST 2004
// If the rectilinear grids are in world space, then let the mass voxel
// extractor know about it.
//
// ****************************************************************************
void
......@@ -307,6 +338,8 @@ avtSamplePointExtractor::ExecuteTree(avtDataTree_p dt)
if (ds->GetDataObjectType() == VTK_RECTILINEAR_GRID)
{
massVoxelExtractor->SetGridsAreInWorldSpace(
rectilinearGridsAreInWorldSpace, viewInfo, aspect);
massVoxelExtractor->Extract((vtkRectilinearGrid *) ds);
return;
}
......
......@@ -10,6 +10,7 @@
#include <avtDatasetToSamplePointsFilter.h>
#include <avtVolume.h>
#include <avtViewInfo.h>
class vtkHexahedron;
class vtkPyramid;
......@@ -51,9 +52,13 @@ class avtRayFunction;
// Hank Childs, Sun Dec 14 11:07:56 PST 2003
// Added mass voxel extractor.
//
// Hank Childs, Fri Nov 19 13:41:56 PST 2004
// Added view conversion option.
//
// ****************************************************************************
class AVTFILTERS_API avtSamplePointExtractor : public avtDatasetToSamplePointsFilter
class AVTFILTERS_API avtSamplePointExtractor
: public avtDatasetToSamplePointsFilter
{
public:
avtSamplePointExtractor(int, int, int);
......@@ -67,6 +72,8 @@ class AVTFILTERS_API avtSamplePointExtractor : public avtDatasetToSamplePointsFi
void RegisterRayFunction(avtRayFunction *rf)
{ rayfoo = rf; };
void SendCellsMode(bool);
void SetRectilinearGridsAreInWorldSpace(bool,
const avtViewInfo &,double);
protected:
int width, height, depth;
......@@ -81,6 +88,10 @@ class AVTFILTERS_API avtSamplePointExtractor : public avtDatasetToSamplePointsFi
bool sendCells;
avtRayFunction *rayfoo;
bool rectilinearGridsAreInWorldSpace;
avtViewInfo viewInfo;
double aspect;
virtual void Execute(void);
virtual void ExecuteTree(avtDataTree_p);
void SetUpExtractors(void);
......
......@@ -8,6 +8,7 @@
#include <vtkCamera.h>
#include <vtkMatrix4x4.h>
#include <vtkRectilinearGrid.h>
#include <avtDataset.h>
#include <avtExtents.h>
......@@ -41,6 +42,9 @@ bool HexIntersectsImageCube(const float [8][3]);
// Hank Childs, Mon Nov 26 18:33:16 PST 2001
// Made use of aspect ratio.
//
// Hank Childs, Fri Nov 19 13:41:56 PST 2004
// Initialize passThruRectilinear.
//
// ****************************************************************************
avtWorldSpaceToImageSpaceTransform::avtWorldSpaceToImageSpaceTransform(
......@@ -52,6 +56,7 @@ avtWorldSpaceToImageSpaceTransform::avtWorldSpaceToImageSpaceTransform(
aspect = asp;
tightenClippingPlanes = false;
passThruRectilinear = false;
view = vi;
transform = vtkMatrix4x4::New();
......@@ -74,6 +79,9 @@ avtWorldSpaceToImageSpaceTransform::avtWorldSpaceToImageSpaceTransform(
// Hank Childs, Mon Nov 26 18:33:16 PST 2001
// Initialized aspect ratio.
//
// Hank Childs, Fri Nov 19 13:41:56 PST 2004
// Initialize passThruRectilinear.
//
// ****************************************************************************
avtWorldSpaceToImageSpaceTransform::avtWorldSpaceToImageSpaceTransform(
......@@ -85,6 +93,7 @@ avtWorldSpaceToImageSpaceTransform::avtWorldSpaceToImageSpaceTransform(
aspect = 1.;
tightenClippingPlanes = false;
passThruRectilinear = false;
view = vi;
transform = vtkMatrix4x4::New();
......@@ -827,3 +836,28 @@ avtWorldSpaceToImageSpaceTransform::PreExecute(void)
}
// ****************************************************************************
// Method: avtWorldSpaceToImageSpaceTransform::ExecuteData
//
// Purpose:
// Pass rectilinear datasets through if specified.
//
// Programmer: Hank Childs
// Creation: November 19, 2004
//
// ****************************************************************************
vtkDataSet *
avtWorldSpaceToImageSpaceTransform::ExecuteData(vtkDataSet *in_ds, int domain,
std::string label)
{
if (passThruRectilinear &&
in_ds->GetDataObjectType() == VTK_RECTILINEAR_GRID)
{
return in_ds;
}
return avtTransform::ExecuteData(in_ds, domain, label);
}
......@@ -34,6 +34,9 @@ class avtIntervalTree;
// Hank Childs, Mon Nov 26 18:33:16 PST 2001
// Add support for aspect ratios.
//
// Hank Childs, Fri Nov 19 13:38:21 PST 2004
// Define ExecuteData so we can pass rectilinear grids through if specified.
//
// ****************************************************************************
class AVTFILTERS_API avtWorldSpaceToImageSpaceTransform : public avtTransform
......@@ -55,6 +58,8 @@ class AVTFILTERS_API avtWorldSpaceToImageSpaceTransform : public avtTransform
void TightenClippingPlanes(bool t)
{ tightenClippingPlanes = t; };
void SetPassThruRectilinearGrids(bool t)
{ passThruRectilinear = t; };
protected:
vtkMatrix4x4 *transform;
......@@ -62,8 +67,10 @@ class AVTFILTERS_API avtWorldSpaceToImageSpaceTransform : public avtTransform
double scale[3];
double aspect;
bool tightenClippingPlanes;
bool passThruRectilinear;
virtual vtkMatrix4x4 *GetTransform(void);
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
static void CalculatePerspectiveTransform(const avtViewInfo &,
vtkMatrix4x4 *);
......
......@@ -110,6 +110,10 @@ avtCompositeRF::~avtCompositeRF()
// Hank Childs, Sun Dec 2 15:55:28 PST 2001
// Full support for multiple variables.
//
// Hank Childs, Fri Dec 3 14:34:59 PST 2004
// Allow a fully opaque sample to terminate a ray. Also make a correction
// so low opacity samples don't have a huge impact. ['1735]
//
// ****************************************************************************
void
......@@ -151,9 +155,10 @@ avtCompositeRF::GetRayValue(const avtRay *ray, const avtGradients *gradients,
//
if (opac.A > 0)
{
double numberOfSamplesToReachFullOpacity = numSamples * 0.02;
double numberOfSamplesToReachFullOpacity = 1;
double samplesOpacity = opac.A /
numberOfSamplesToReachFullOpacity;
samplesOpacity = samplesOpacity*samplesOpacity;
//
// There is a leap of faith here that the gradients were not
......
......@@ -989,6 +989,9 @@ avtDataAttributes::GetDataExtents(double *buff, const char *varname)
// Kathleen Bonnell, Wed Mar 31 08:03:47 PST 2004
// Added a reason to the exception.
//
// Hank Childs, Wed Dec 1 15:29:56 PST 2004
// Make sure varname is non-NULL, or we'll crash.
//
// ****************************************************************************
avtExtents *
......@@ -1001,8 +1004,10 @@ avtDataAttributes::GetTrueDataExtents(const char *varname)
// We were asked to set the variable dimension of a non-existent
// variable.
//
const char *varname_to_print = (varname != NULL ? varname
: "<null>");
string reason = "Attempting to retrieve data extents of non-existent ";
reason = reason + " variable: " + varname + ".\n";
reason = reason + " variable: " + varname_to_print + ".\n";
EXCEPTION1(ImproperUseException, reason);
}
......@@ -1030,6 +1035,9 @@ avtDataAttributes::GetTrueDataExtents(const char *varname)
// Kathleen Bonnell, Wed Mar 31 08:03:47 PST 2004
// Added a reason to the exception.
//
// Hank Childs, Wed Dec 1 15:29:56 PST 2004
// Make sure varname is non-NULL, or we'll crash.
//
// ****************************************************************************
avtExtents *
......@@ -1042,8 +1050,10 @@ avtDataAttributes::GetCumulativeTrueDataExtents(const char *varname)
// We were asked to set the variable dimension of a non-existent
// variable.
//
const char *varname_to_print = (varname != NULL ? varname
: "<null>");
string reason = "Attempting to retrieve data extents of non-existent ";
reason = reason + " variable: " + varname + ".\n";
reason = reason + " variable: " + varname_to_print + ".\n";
EXCEPTION1(ImproperUseException, reason);
}
......@@ -1071,6 +1081,9 @@ avtDataAttributes::GetCumulativeTrueDataExtents(const char *varname)
// Kathleen Bonnell, Wed Mar 31 08:03:47 PST 2004
// Added a reason to the exception.
//
// Hank Childs, Wed Dec 1 15:29:56 PST 2004
// Make sure varname is non-NULL, or we'll crash.
//
// ****************************************************************************
avtExtents *
......@@ -1083,8 +1096,10 @@ avtDataAttributes::GetEffectiveDataExtents(const char *varname)
// We were asked to set the variable dimension of a non-existent
// variable.
//
const char *varname_to_print = (varname != NULL ? varname
: "<null>");
string reason = "Attempting to retrieve data extents of non-existent ";
reason = reason + " variable: " + varname + ".\n";
reason = reason + " variable: " + varname_to_print + ".\n";
EXCEPTION1(ImproperUseException, reason);
}
......@@ -1112,6 +1127,9 @@ avtDataAttributes::GetEffectiveDataExtents(const char *varname)
// Kathleen Bonnell, Wed Mar 31 08:03:47 PST 2004
// Added a reason to the exception.
//
// Hank Childs, Wed Dec 1 15:29:56 PST 2004
// Make sure varname is non-NULL, or we'll crash.
//
// ****************************************************************************
avtExtents *
......@@ -1124,8 +1142,10 @@ avtDataAttributes::GetCurrentDataExtents(const char *varname)
// We were asked to set the variable dimension of a non-existent
// variable.
//
const char *varname_to_print = (varname != NULL ? varname
: "<null>");
string reason = "Attempting to retrieve data extents of non-existent ";
reason = reason + " variable: " + varname + ".\n";
reason = reason + " variable: " + varname_to_print + ".\n";
EXCEPTION1(ImproperUseException, reason);
}
......@@ -1153,6 +1173,9 @@ avtDataAttributes::GetCurrentDataExtents(const char *varname)
// Kathleen Bonnell, Wed Mar 31 08:03:47 PST 2004
// Added a reason to the exception.
//
// Hank Childs, Wed Dec 1 15:29:56 PST 2004
// Make sure varname is non-NULL, or we'll crash.
//
// ****************************************************************************
avtExtents *
......@@ -1165,8 +1188,10 @@ avtDataAttributes::GetCumulativeCurrentDataExtents(const char *varname)
// We were asked to set the variable dimension of a non-existent
// variable.
//
const char *varname_to_print = (varname != NULL ? varname
: "<null>");
string reason = "Attempting to retrieve data extents of non-existent ";
reason = reason + " variable: " + varname + ".\n";
reason = reason + " variable: " + varname_to_print + ".\n";
EXCEPTION1(ImproperUseException, reason);
}
......@@ -1282,6 +1307,9 @@ avtDataAttributes::SetSpatialDimension(int td)
// Kathleen Bonnell, Wed Mar 31 08:03:47 PST 2004
// Added a reason to the exception.
//
// Hank Childs, Wed Dec 1 15:29:56 PST 2004
// Make sure varname is non-NULL, or we'll crash.
//
// ****************************************************************************
void
......@@ -1294,8 +1322,10 @@ avtDataAttributes::SetVariableDimension(int vd, const char *varname)
// We were asked to set the variable dimension of a non-existent
// variable.
//
const char *varname_to_print = (varname != NULL ? varname
: "<null>");
string reason = "Attempting to set dimension of non-existent ";
reason = reason + " variable: " + varname + ".\n";
reason = reason + " variable: " + varname_to_print + ".\n";
EXCEPTION1(ImproperUseException, reason);
}
......@@ -1351,6 +1381,9 @@ avtDataAttributes::SetVariableDimension(int vd, const char *varname)
// Kathleen Bonnell, Wed Mar 31 08:03:47 PST 2004
// Added a reason to the exception.
//
// Hank Childs, Wed Dec 1 15:29:56 PST 2004
// Make sure varname is non-NULL, or we'll crash.
//
// ****************************************************************************
int
......@@ -1363,8 +1396,10 @@ avtDataAttributes::GetVariableDimension(const char *varname) const
// We were asked to set the variable dimension of a non-existent
// variable.
//
const char *varname_to_print = (varname != NULL ? varname
: "<null>");
string reason = "Attempting to retrieve dimension of non-existent ";
reason = reason + " variable: " + varname + ".\n";
reason = reason + " variable: " + varname_to_print + ".\n";
EXCEPTION1(ImproperUseException, reason);
}
......@@ -3022,6 +3057,9 @@ avtDataAttributes::ReadTransform(char *input)
//
// Modifications:
//
// Hank Childs, Wed Dec 1 15:29:56 PST 2004
// Make sure varname is non-NULL, or we'll crash.
//
// ****************************************************************************
void
......@@ -3034,8 +3072,10 @@ avtDataAttributes::SetTreatAsASCII(const bool ascii, const char *varname)
// We were asked to set the treatAsASCII value of a non-existent
// variable.
//
const char *varname_to_print = (varname != NULL ? varname
: "<null>");
string reason = "Attempting to set TreatAsASCII of non-existent";
reason = reason + " variable: " + varname + ".\n";
reason = reason + " variable: " + varname_to_print + ".\n";
EXCEPTION1(ImproperUseException, reason);
}
......@@ -3055,6 +3095,9 @@ avtDataAttributes::SetTreatAsASCII(const bool ascii, const char *varname)
//
// Modifications:
//
// Hank Childs, Wed Dec 1 15:29:56 PST 2004
// Make sure varname is non-NULL, or we'll crash.
//
// ****************************************************************************
bool
......@@ -3067,8 +3110,10 @@ avtDataAttributes::GetTreatAsASCII(const char *varname) const
// We were asked to get the treatAsASCII of a non-existent
// variable.
//
const char *varname_to_print = (varname != NULL ? varname
: "<null>");
string reason = "Attempting to retrieve TreatAsASCII of non-existent";
reason = reason + " variable: " + varname + ".\n";
reason = reason + " variable: " + varname_to_print + ".\n";
EXCEPTION1(ImproperUseException, reason);
}
......
// ************************************************************************* //
// avtMassVoxelExtractor.C //
// ************************************************************************* //
#include <avtMassVoxelExtractor.h>
#include <float.h>
#include <avtCellList.h>
#include <avtVolume.h>
#include <vtkCellData.h>
#include <vtkPointData.h>
#include <vtkRectilinearGrid.h>
#include <vtkUnsignedCharArray.h>
// ****************************************************************************
// Method: avtMassVoxelExtractor constructor
//
// Arguments:
// w The number of sample points in the x direction (width).
// h The number of sample points in the y direction (height).
// d The number of sample points in the z direction (depth).