Commit 1e89eb07 authored by hrchilds's avatar hrchilds

Update from July 2, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@26 18c085ea-50e0-402c-830e-de6fd14e8384
parent 2222bd99
This diff is collapsed.
......@@ -14,7 +14,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:40 PST 2003
// Creation: Tue Jun 24 13:14:21 PST 2003
//
// Modifications:
//
......@@ -99,6 +99,7 @@ public:
void SetYLabelFontHeight2D(double yLabelFontHeight2D_);
void SetXTitleFontHeight2D(double xTitleFontHeight2D_);
void SetYTitleFontHeight2D(double yTitleFontHeight2D_);
void SetAxesLineWidth2D(int axesLineWidth2D_);
void SetAxesTickLocation2D(Location axesTickLocation2D_);
void SetAxesTicks2D(Ticks axesTicks2D_);
void SetAxesFlag(bool axesFlag_);
......@@ -168,6 +169,7 @@ public:
double GetYLabelFontHeight2D() const;
double GetXTitleFontHeight2D() const;
double GetYTitleFontHeight2D() const;
int GetAxesLineWidth2D() const;
Location GetAxesTickLocation2D() const;
Ticks GetAxesTicks2D() const;
bool GetAxesFlag() const;
......@@ -278,6 +280,7 @@ private:
double yLabelFontHeight2D;
double xTitleFontHeight2D;
double yTitleFontHeight2D;
int axesLineWidth2D;
int axesTickLocation2D;
int axesTicks2D;
bool axesFlag;
......
......@@ -50,6 +50,7 @@
<Field name="yLabelFontHeight2D" type="double">0.02</Field>
<Field name="xTitleFontHeight2D" type="double">0.02</Field>
<Field name="yTitleFontHeight2D" type="double">0.02</Field>
<Field name="axesLineWidth2D" type="linewidth">0</Field>
<Field name="axesTickLocation2D" type="enum" subtype="Location">Outside</Field>
<Field name="axesTicks2D" type="enum" subtype="Ticks">BottomLeft</Field>
<Field name="axesFlag" type="bool">true</Field>
......
......@@ -14,6 +14,7 @@
#include <vtkIdList.h>
#include <DebugStream.h>
#include <ExpressionException.h>
// ****************************************************************************
......@@ -60,7 +61,7 @@ avtGradientFilter::~avtGradientFilter()
// Returns: The derived variable. The calling class must free this
// memory.
//
// Programmer: Matthew Haddox
// Programmer: Akira Haddox
// Creation: July 30, 2002
//
// Modifications:
......@@ -72,6 +73,9 @@ avtGradientFilter::~avtGradientFilter()
// Kathleen Bonnell, Fri Dec 13 14:07:15 PST 2002
// Use NewInstance instead of MakeObject, new vtkapi.
//
// Akira Haddox, Wed Jun 18 13:03:23 PDT 2003
// Added proper error check for scalar data, and check for 2D data.
//
// ****************************************************************************
vtkDataArray *
......@@ -84,7 +88,8 @@ avtGradientFilter::DeriveVariable(vtkDataSet *in_ds)
{
if (!(in_ds->GetCellData()->GetScalars()))
{
return NULL; // No data
EXCEPTION1(ExpressionException, "the scalar variable could not"
" be found.");
}
myFilter->SetInput(in_ds);
......@@ -108,6 +113,9 @@ avtGradientFilter::DeriveVariable(vtkDataSet *in_ds)
for (int nodeId = 0 ; nodeId < nPoints; nodeId++)
{
if (nodeId % 10000 == 0)
UpdateProgress(nodeId, nPoints);
float xDELTA=1e6, yDELTA=1e6, zDELTA=1e6;
float *nodeCoords = in_ds->GetPoint(nodeId);
......@@ -150,8 +158,13 @@ avtGradientFilter::DeriveVariable(vtkDataSet *in_ds)
xDELTA, 0, 0, nodeValue, in_ds, scalarValues, neighborCellIds);
yComponent=EvaluateComponent(nodeCoords[0],nodeCoords[1],nodeCoords[2],
0, yDELTA, 0, nodeValue, in_ds, scalarValues, neighborCellIds);
zComponent=EvaluateComponent(nodeCoords[0],nodeCoords[1],nodeCoords[2],
0, 0, zDELTA, nodeValue, in_ds, scalarValues, neighborCellIds);
if (zDELTA == 0)
zComponent = 0;
else
zComponent=EvaluateComponent(nodeCoords[0],nodeCoords[1],
nodeCoords[2], 0, 0, zDELTA,
nodeValue, in_ds, scalarValues,
neighborCellIds);
results->SetTuple3(nodeId, xComponent, yComponent, zComponent);
}
......@@ -181,7 +194,7 @@ avtGradientFilter::DeriveVariable(vtkDataSet *in_ds)
//
// Returns: The value at that point.
//
// Programmer: Matthew Haddox
// Programmer: Akira Haddox
// Creation: July 30, 2002
//
// ****************************************************************************
......@@ -236,9 +249,13 @@ float avtGradientFilter::EvaluateComponent(float x, float y, float z,
//
// Returns: The value at that point.
//
// Programmer: Matthew Haddox
// Programmer: Akira Haddox
// Creation: July 30, 2002
//
// Modifications:
// Akira Haddox, Mon Jun 23 10:43:12 PDT 2003
// Changed an accumulator from float to double for precision.
//
// ****************************************************************************
......@@ -287,7 +304,7 @@ float avtGradientFilter::EvaluateValue(float x, float y, float z,
return 0.;
}
float value = 0.;
double value = 0.;
if (abnormalWeights)
{
for (int k=0 ; k < c->GetNumberOfPoints() ; k++)
......@@ -307,5 +324,3 @@ float avtGradientFilter::EvaluateValue(float x, float y, float z,
}
return value;
}
......@@ -232,6 +232,10 @@ avtRevolvedVolume::GetZoneVolume(vtkCell *cell)
//
// Programmer: Hank Childs
// Creation: March 29, 2000
//
// Modifications:
// Akira Haddox, Wed Jul 2 12:27:24 PDT 2003
// Dealt with triangles below or on the y-axis.
//
// ****************************************************************************
......@@ -243,7 +247,101 @@ avtRevolvedVolume::GetTriangleVolume(double x[3], double y[3])
double slope01, slope02, slope12;
double volume;
double ls_x[2], ls_y[2];
//
// Check to see if we straddle the line y = 0, and break it up into
// triangles which don't. Keep in mind the points are ordered
// by x-coordinate.
//
if (y[0] * y[1] < 0 || y[1] * y[2] < 0 || y[0] * y[2] < 0)
{
double oppositeX, oppositeY;
double pt1X, pt2X, pt1Y, pt2Y;
// Find the one point that is opposite the other two.
if (y[1] * y[2] >= 0)
{
// The point is 0
oppositeX = x[0];
oppositeY = y[0];
pt1X = x[1];
pt1Y = y[1];
pt2X = x[2];
pt2Y = y[2];
}
else if(y[0] * y[2] >= 0)
{
// The point is 1
oppositeX = x[1];
oppositeY = y[1];
pt1X = x[0];
pt1Y = y[0];
pt2X = x[2];
pt2Y = y[2];
}
else
{
// The point is 2
oppositeX = x[2];
oppositeY = y[2];
pt1X = x[0];
pt1Y = y[0];
pt2X = x[1];
pt2Y = y[1];
}
//
// Now take this information and find the two intersections.
//
double xInt1, xInt2;
// Special cases: infinite slopes
if (oppositeX == pt1X)
xInt1 = oppositeX;
else
{
double nslope = (oppositeY - pt1Y) / (oppositeX - pt1X);
xInt1 = oppositeX + oppositeY / nslope;
}
if (oppositeX == pt2X)
xInt2 = oppositeX;
else
{
double nslope = (oppositeY - pt2Y) / (oppositeX - pt2X);
xInt2 = oppositeX + oppositeY / nslope;
}
double v1, v2, v3;
//
// Find the volume of the single triangle
//
x[0] = oppositeX;
x[1] = xInt1;
x[2] = xInt2;
y[0] = oppositeY;
y[1] = 0;
y[2] = 0;
v1 = GetTriangleVolume(x, y);
//
// Find the volume of the quad by splitting it into triangles
// (the intercepts to pt1, then {pt1, pt2, Intercept2}).
//
x[0] = pt1X;
y[0] = pt1Y;
v2 = GetTriangleVolume(x, y);
x[1] = pt2X;
y[1] = pt2Y;
v3 = GetTriangleVolume(x, y);
return v1 + v2 + v3;
}
//
// Sort the points so that they are ordered by x-coordinate. This will
// make things much easier later.
......@@ -281,7 +379,13 @@ avtRevolvedVolume::GetTriangleVolume(double x[3], double y[3])
ls_x[0] = x[1];
ls_y[0] = y[1];
cone12 = RevolveLineSegment(ls_x, ls_y, &slope12);
bool aboveY;
if (y[0] < 0 || y[1] < 0 || y[2] < 0)
aboveY = false;
else
aboveY = true;
//
// This is a little tricky and best shown by picture, but if slope01 is
// greater than slope02, then P0P1 and P1P2 make up the top of the volume
......@@ -291,13 +395,22 @@ avtRevolvedVolume::GetTriangleVolume(double x[3], double y[3])
// math actually works out fine, since the volume of the cone from P0P1
// plus P1P2 equals P0P2.
//
if (slope01 < slope02)
// Note that if we're below the line y = 0, then this rule is reversed.
//
if (aboveY)
{
volume = cone02 - cone01 - cone12;
if (slope01 < slope02)
volume = cone02 - cone01 - cone12;
else
volume = cone12 + cone01 - cone02;
}
else
{
volume = cone12 + cone01 - cone02;
if (slope01 < slope02)
volume = cone12 + cone01 - cone02;
else
volume = cone02 - cone01 - cone12;
}
return volume;
......@@ -320,7 +433,7 @@ avtRevolvedVolume::GetTriangleVolume(double x[3], double y[3])
//
// Programmer: Hank Childs
// Creation: March 29, 2000
//
//
// ****************************************************************************
double
......@@ -358,9 +471,9 @@ avtRevolvedVolume::RevolveLineSegment(double x[2], double y[2], double *slope)
double height = x[1] - x[0];
double volume = M_PI * radius * radius * height;
*slope = 0.;
return volume;
return (volume);
}
//
// Calculate where the line segment will hit the line x = 0.
// Note we have already taken care of degenerate cases.
......@@ -415,7 +528,7 @@ avtRevolvedVolume::RevolveLineSegment(double x[2], double y[2], double *slope)
}
*slope = m;
return coneAll - coneCropped;
return (coneAll - coneCropped);
}
......@@ -91,6 +91,12 @@ avtVerdictFilter::avtVerdictFilter()
// Programmer: Akira Haddox
// Creation: June 11, 2002
//
//
// Modifications:
//
// Akira Haddox, Wed Jul 2 08:26:30 PDT 2003
// Added conversion from pixel cell type.
//
// ****************************************************************************
vtkDataArray *
......@@ -135,14 +141,23 @@ avtVerdictFilter::DeriveVariable(vtkDataSet *in_ds)
pointData->GetTuple(j,coordinates[j]);
}
int cellType = cell->GetCellType();
// Convert Voxel format into hexahedron format.
if (cell->GetCellType() == VTK_VOXEL)
if (cellType == VTK_VOXEL)
{
Swap3(coordinates, 2,3);
Swap3(coordinates, 6,7);
Swap3(coordinates, 2,3);
Swap3(coordinates, 6,7);
}
// Convert Pixel format into quad format.
if (cellType == VTK_PIXEL)
{
Swap3(coordinates, 2, 3);
cellType = VTK_QUAD;
}
results[i] = Metric(coordinates, cell->GetCellType());
results[i] = Metric(coordinates, cellType);
}
......@@ -238,6 +253,9 @@ avtVerdictFilter::PreExecute()
// Hank Childs, Thu Oct 17 08:07:53 PDT 2002
// Update for new verdict interface.
//
// Akira Haddox, Wed Jul 2 08:26:30 PDT 2003
// Added conversion from pixel cell type.
//
// ****************************************************************************
void SumSize(avtDataRepresentation &adr, void *, bool &)
......@@ -279,6 +297,11 @@ void SumSize(avtDataRepresentation &adr, void *, bool &)
Swap3(coordinates, 6,7);
}
// Convert Pixel format into quad format.
if (cell->GetCellType() == VTK_PIXEL)
{
Swap3(coordinates, 2, 3);
}
switch (cell->GetCellType())
{
......@@ -295,6 +318,7 @@ void SumSize(avtDataRepresentation &adr, void *, bool &)
++VerdictSizeData.triCount;
VerdictSizeData.triSize+=v_tri_area(3, coordinates);
break;
case VTK_PIXEL:
case VTK_QUAD:
++VerdictSizeData.quadCount;
VerdictSizeData.quadSize+=v_quad_area(3, coordinates);
......
......@@ -843,7 +843,7 @@ LabelExponent(float min, float max)
// ****************************************************************************
// Function: SetXTickVisibility
// Method: VisWinAxes::SetXTickVisibility
//
// Purpose:
// Sets the visibility of x-axis ticks.
......@@ -868,7 +868,7 @@ VisWinAxes::SetXTickVisibility(int xVis, int xLabelsVis)
// ****************************************************************************
// Function: SetYTickVisibility
// Method: VisWinAxes::SetYTickVisibility
//
// Purpose:
// Sets the visibility of y-axis ticks.
......@@ -892,7 +892,7 @@ VisWinAxes::SetYTickVisibility(int yVis, int yLabelsVis)
// ****************************************************************************
// Function: SetLabelsVisibility
// Method: VisWinAxes::SetLabelsVisibility
//
// Purpose:
// Sets the visibility of x-axis and y-axis labels.
......@@ -920,7 +920,7 @@ VisWinAxes::SetLabelsVisibility(int xVis, int yVis)
// ****************************************************************************
// Function: SetTitleVisibility
// Method: VisWinAxes::SetTitleVisibility
//
// Purpose:
// Sets the visibility of x-axis and y-axis titles.
......@@ -943,7 +943,7 @@ VisWinAxes::SetTitleVisibility(int xVis, int yVis)
// ****************************************************************************
// Function: SetVisibility
// Method: VisWinAxes::SetVisibility
//
// Purpose:
// Sets the visibility of this colleague.
......@@ -965,7 +965,7 @@ VisWinAxes::SetVisibility(int vis)
// ****************************************************************************
// Function: SetTickLocation
// Method: VisWinAxes::SetTickLocation
//
// Purpose:
// Sets the location of the ticks.
......@@ -987,7 +987,7 @@ VisWinAxes::SetTickLocation(int loc)
// ****************************************************************************
// Function: SetXGridVisibility
// Method: VisWinAxes::SetXGridVisibility
//
// Purpose:
// Sets the visibility of x-axis gridlines.
......@@ -1008,7 +1008,7 @@ VisWinAxes::SetXGridVisibility(int vis)
// ****************************************************************************
// Function: SetYGridVisibility
// Method: VisWinAxes::SetYGridVisibility
//
// Purpose:
// Sets the visibility of y-axis gridlines.
......@@ -1029,7 +1029,7 @@ VisWinAxes::SetYGridVisibility(int vis)
// ****************************************************************************
// Function: SetAutoSetTicks
// Method: VisWinAxes::SetAutoSetTicks
//
// Purpose:
// Sets the flag which specifies if the ticks should be automatically
......@@ -1053,7 +1053,7 @@ VisWinAxes::SetAutoSetTicks(int autoSetTicks)
// ****************************************************************************
// Function: SetMajorTickMinimum
// Method: VisWinAxes::SetMajorTickMinimum
//
// Purpose:
// Sets the minimum values for the major tick marks.
......@@ -1076,7 +1076,7 @@ VisWinAxes::SetMajorTickMinimum(double xMajorMinimum, double yMajorMinimum)
// ****************************************************************************
// Function: SetMajorTickMaximum
// Method: VisWinAxes::SetMajorTickMaximum
//
// Purpose:
// Sets the maximum values for the major tick marks.
......@@ -1099,7 +1099,7 @@ VisWinAxes::SetMajorTickMaximum(double xMajorMaximum, double yMajorMaximum)
// ****************************************************************************
// Function: SetMajorTickSpacing
// Method: VisWinAxes::SetMajorTickSpacing
//
// Purpose:
// Sets the spacing for the major tick marks.
......@@ -1122,7 +1122,7 @@ VisWinAxes::SetMajorTickSpacing(double xMajorSpacing, double yMajorSpacing)
// ****************************************************************************
// Function: SetMinorTickSpacing
// Method: VisWinAxes::SetMinorTickSpacing
//
// Purpose:
// Sets the spacing for the minor tick marks.
......@@ -1145,7 +1145,7 @@ VisWinAxes::SetMinorTickSpacing(double xMinorSpacing, double yMinorSpacing)
// ****************************************************************************
// Function: SetXLabelFontHeight
// Method: VisWinAxes::SetXLabelFontHeight
//
// Purpose:
// Sets the label font height for the x axis.
......@@ -1166,7 +1166,7 @@ VisWinAxes::SetXLabelFontHeight(double height)
// ****************************************************************************
// Function: SetYLabelFontHeight
// Method: VisWinAxes::SetYLabelFontHeight
//
// Purpose:
// Sets the label font height for the y axis.
......@@ -1187,7 +1187,7 @@ VisWinAxes::SetYLabelFontHeight(double height)
// ****************************************************************************
// Function: SetXTitleFontHeight
// Method: VisWinAxes::SetXTitleFontHeight
//
// Purpose:
// Sets the title font height for the x axis.
......@@ -1208,7 +1208,7 @@ VisWinAxes::SetXTitleFontHeight(double height)
// ****************************************************************************
// Function: SetYTitleFontHeight
// Method: VisWinAxes::SetYTitleFontHeight
//
// Purpose:
// Sets the title font height for the y axis.
......@@ -1228,6 +1228,28 @@ VisWinAxes::SetYTitleFontHeight(double height)
}
// ****************************************************************************
// Method: VisWinAxes::SetLineWidth
//
// Purpose:
// Sets the line width for the axes.
//
// Arguments:
// width The line width.
//
// Programmer: Eric Brugger
// Creation: June 25, 2003
//
// ****************************************************************************
void
VisWinAxes::SetLineWidth(int width)
{
xAxis->GetProperty()->SetLineWidth(width);
yAxis->GetProperty()->SetLineWidth(width);
}
// ****************************************************************************
// Method: VisWinAxes::SetTitle
//
......
......@@ -55,6 +55,9 @@ class VisWindowColleagueProxy;
// Modified AdjustValues so that the arguments aren't passed by reference
// because they are no longer modified.
//
// Eric Brugger, Wed Jun 25 14:09:15 PDT 2003
// I added SetLineWidth.
//
// ****************************************************************************
class VISWINDOW_API VisWinAxes : public VisWinColleague
......@@ -94,6 +97,7 @@ class VISWINDOW_API VisWinAxes : public VisWinColleague
void SetYLabelFontHeight(double);
void SetXTitleFontHeight(double);
void SetYTitleFontHeight(double);
void SetLineWidth(int);
protected:
vtkHankAxisActor2D *xAxis, *yAxis;
......
......@@ -436,7 +436,7 @@ VisWinFrame::SetTickLocation(int loc)
// ****************************************************************************
// Function: SetAutoSetTicks
// Method: VisWinFrame::SetAutoSetTicks
//
// Purpose:
// Sets the flag which specifies if the ticks should be automatically
......@@ -460,7 +460,7 @@ VisWinFrame::SetAutoSetTicks(int autoSetTicks)
// ****************************************************************************
// Function: SetMajorTickMinimum
// Method: VisWinFrame::SetMajorTickMinimum
//
// Purpose:
// Sets the minimum values for the major tick marks.
......@@ -483,7 +483,7 @@ VisWinFrame::SetMajorTickMinimum(double xMajorMinimum, double yMajorMinimum)
// ****************************************************************************
// Function: SetMajorTickMaximum
// Method: VisWinFrame::SetMajorTickMaximum
//
// Purpose:
// Sets the maximum values for the major tick marks.
......@@ -506,7 +506,7 @@ VisWinFrame::SetMajorTickMaximum(double xMajorMaximum, double yMajorMaximum)
// ****************************************************************************
// Function: SetMajorTickSpacing
// Method: VisWinFrame::SetMajorTickSpacing
//
// Purpose:
// Sets the spacing for the major tick marks.
......@@ -529,7 +529,7 @@ VisWinFrame::SetMajorTickSpacing(double xMajorSpacing, double yMajorSpacing)
// ****************************************************************************
// Function: SetMinorTickSpacing
// Method: VisWinFrame::SetMinorTickSpacing
//
// Purpose:
// Sets the spacing for the minor tick marks.
......@@ -551,6 +551,30 @@ VisWinFrame::SetMinorTickSpacing(double xMinorSpacing, double yMinorSpacing)
}
// ****************************************************************************
// Method: VisWinFrame::SetLineWidth
//
// Purpose:
// Sets the line width for the frame.
//
// Arguments:
// width The line width.
//
// Programmer: Eric Brugger
// Creation: June 25, 2003
//
// ****************************************************************************
void
VisWinFrame::SetLineWidth(int width)
{
leftBorder->GetProperty()->SetLineWidth(width);
rightBorder->GetProperty()->SetLineWidth(width);
topBorder->GetProperty()->SetLineWidth(width);
bottomBorder->GetProperty()->SetLineWidth(width);
}
// ****************************************************************************
// Method: VisWinFrame::UpdateView
//
......
......@@ -36,6 +36,9 @@ class vtkHankAxisActor2D;
// Added methods SetAutoSetTicks, SetMajorTickMinimum, SetMajorTickMaximum,
// SetMajorTickSpacing and SetMinorTickSpacing.
//
// Eric Brugger, Wed Jun 25 15:36:16 PDT 2003
// I added SetLineWidth.
//
// ****************************************************************************
class VISWINDOW_API VisWinFrame : public VisWinColleague
......@@ -62,6 +65,7 @@ class VISWINDOW_API VisWinFrame : public VisWinColleague
void SetMajorTickMaximum(double, double);
void SetMajorTickSpacing(double, double);
void SetMinorTickSpacing(double, double);
void SetLineWidth(int);
protected:
vtkHankAxisActor2D *leftBorder, *rightBorder, *topBorder,
......
......@@ -329,6 +329,10 @@ ZoomInteractor::EndRubberBand()
// Hank Childs, Tue Sep 18 12:02:29 PDT 2001
// Cast return value of ceil/floor to get rid of compiler warnings.
//
// Kathleen Bonnell, Wed Jul 2 09:12:52 PDT 2003
// Switch ceil to floor and vice-versa, so that rubber ban can extend
// all the way to the xmin, xmax, ymin, ymax.
//
// ****************************************************************************
void
......@@ -336,19 +340,19 @@ ZoomInteractor::ForceCoordsToViewport(int &x, int &y)
{
if (x < canvasDeviceMinX)
{
x = (int)ceil(canvasDeviceMinX);
x = (int)floor(canvasDeviceMinX);
}
if (x > canvasDeviceMaxX)
{
x = (int)floor(canvasDeviceMaxX);
x = (int)ceil(canvasDeviceMaxX);
}
if (y < canvasDeviceMinY)
{
y = (int)ceil(canvasDeviceMinY);
y = (int)floor(canvasDeviceMinY);
}
if (y > canvasDeviceMaxY)
{
y = (int)floor(canvasDeviceMaxY);
y = (int)ceil(canvasDeviceMaxY);
}
}
......
......@@ -12,6 +12,7 @@
#include <vtkMatrix4x4.h>
#include <ColorAttribute.h>
#include <LineAttributes.h>
#include <avtPlot.h>
#include <avtLightList.h>
......@@ -2082,16 +2083,6 @@ VisWindow::SetView3D(const avtView3D &v)
//
view3D = v;
/*
cerr << "VisWindow::SetView3D setting view to..." << endl;
cerr << " viewUp[0] = " << view3D.viewUp[0]
<< " viewUp[1] = " << view3D.viewUp[1]
<< " viewUp[2] = " << view3D.viewUp[2] << endl;
cerr << " focus[0] = " << view3D.focus[0]
<< " focus[1] = " << view3D.focus[1]
<< " focus[2] = " << view3D.focus[2] << endl;
*/
UpdateView();
}
......@@ -2936,13 +2927,16 @@ VisWindow::GetLightList() const
// Eric Brugger, Fri Jan 24 11:22