Commit 6e60dcf0 authored by hrchilds's avatar hrchilds

Update from June 13, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@12 18c085ea-50e0-402c-830e-de6fd14e8384
parent fd72b39d
......@@ -272,7 +272,9 @@ RemoteProxyBase::GetVisItString() const
// Creation: Fri May 2 15:03:15 PST 2003
//
// Modifications:
//
// Brad Whitlock, Tue Jun 10 14:47:35 PST 2003
// Let -dir pass through.
//
// ****************************************************************************
void
......@@ -288,12 +290,5 @@ RemoteProxyBase::AddExtraArguments()
// Add any extra arguments to the component before opening it.
//
for(int i = 0; i < argv.size(); ++i)
{
if (argv[i] == "-dir")
{
i++;
continue;
}
component->AddArgument(argv[i]);
}
}
This diff is collapsed.
......@@ -12,7 +12,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:40:14 PST 2003
// Creation: Tue Jun 10 11:57:05 PDT 2003
//
// Modifications:
//
......@@ -35,14 +35,15 @@ public:
// Property selection methods
virtual void SelectAll();
void SelectCamera();
void SelectViewNormal();
void SelectFocus();
void SelectViewUp();
void SelectImagePan();
void SelectWindowCoords();
void SelectViewportCoords();
// Property setting methods
void SetCamera(const double *camera_);
void SetViewNormal(const double *viewNormal_);
void SetFocus(const double *focus_);
void SetViewUp(const double *viewUp_);
void SetViewAngle(double viewAngle_);
......@@ -50,13 +51,15 @@ public:
void SetParallelScale(double parallelScale_);
void SetNearPlane(double nearPlane_);
void SetFarPlane(double farPlane_);
void SetImagePan(const double *imagePan_);
void SetImageZoom(double imageZoom_);
void SetPerspective(bool perspective_);
void SetWindowCoords(const double *windowCoords_);
void SetViewportCoords(const double *viewportCoords_);
// Property getting methods
const double *GetCamera() const;
double *GetCamera();
const double *GetViewNormal() const;
double *GetViewNormal();
const double *GetFocus() const;
double *GetFocus();
const double *GetViewUp() const;
......@@ -66,6 +69,9 @@ public:
double GetParallelScale() const;
double GetNearPlane() const;
double GetFarPlane() const;
const double *GetImagePan() const;
double *GetImagePan();
double GetImageZoom() const;
bool GetPerspective() const;
const double *GetWindowCoords() const;
double *GetWindowCoords();
......@@ -84,7 +90,7 @@ public:
virtual bool FieldsEqual(int index, const AttributeGroup *rhs) const;
private:
double camera[3];
double viewNormal[3];
double focus[3];
double viewUp[3];
double viewAngle;
......@@ -92,6 +98,8 @@ private:
double parallelScale;
double nearPlane;
double farPlane;
double imagePan[2];
double imageZoom;
bool perspective;
double windowCoords[4];
double viewportCoords[4];
......
<?xml version="1.0"?>
<Attribute name="ViewAttributes" purpose="This class contains the view attributes." exportAPI="STATE_API" exportInclude="state_exports.h">
<Field name="camera" type="doubleArray" length="3">0. 0. -1.</Field>
<Field name="viewNormal" type="doubleArray" length="3">0. 0. 1.</Field>
<Field name="focus" type="doubleArray" length="3">0. 0. 0.</Field>
<Field name="viewUp" type="doubleArray" length="3">0. 0. 0.</Field>
<Field name="viewUp" type="doubleArray" length="3">0. 1. 0.</Field>
<Field name="viewAngle" type="double">30.</Field>
<Field name="setScale" type="bool">false</Field>
<Field name="parallelScale" type="double">1.</Field>
<Field name="nearPlane" type="double">0.001</Field>
<Field name="farPlane" type="double">100</Field>
<Field name="imagePan" type="doubleArray" length="2">0. 0.</Field>
<Field name="imageZoom" type="double">1.</Field>
<Field name="perspective" type="bool">true</Field>
<Field name="windowCoords" type="doubleArray" length="4">0. 0. 1. 1.</Field>
<Field name="viewportCoords" type="doubleArray" length="4">0.1 0.1 0.9 0.9</Field>
......
......@@ -567,6 +567,9 @@ MIR::Destruct(void *p)
// Hank Childs, Mon Oct 7 15:30:53 PDT 2002
// Took the dataset out of its VTK constructs to improve performance.
//
// Jeremy Meredith, Fri Jun 13 16:56:43 PDT 2003
// Added clean zones only.
//
// ****************************************************************************
bool
MIR::Reconstruct3DMesh(vtkDataSet *mesh, avtMaterial *mat_orig)
......@@ -702,7 +705,8 @@ MIR::Reconstruct3DMesh(vtkDataSet *mesh, avtMaterial *mat_orig)
bool clean = (*real_clean_zones)[c];
int clean_matno = mat->GetMatlist()[c];
if (options.leaveCleanZonesWhole && clean)
if (options.cleanZonesOnly ||
(options.leaveCleanZonesWhole && clean))
{
someClean = true;
ReconstructCleanCell(clean_matno, c, *c_ptr, c_ptr+1,
......@@ -831,6 +835,9 @@ MIR::Reconstruct3DMesh(vtkDataSet *mesh, avtMaterial *mat_orig)
// Hank Childs, Mon Oct 7 14:40:50 PDT 2002
// Use a routine optimized for performance to create the coordinates list.
//
// Jeremy Meredith, Fri Jun 13 16:56:43 PDT 2003
// Added clean zones only.
//
// ****************************************************************************
bool
MIR::Reconstruct2DMesh(vtkDataSet *mesh, avtMaterial *mat_orig)
......@@ -953,7 +960,8 @@ MIR::Reconstruct2DMesh(vtkDataSet *mesh, avtMaterial *mat_orig)
bool clean = (*real_clean_zones)[c];
int clean_matno = mat->GetMatlist()[c];
if (options.leaveCleanZonesWhole && clean)
if (options.cleanZonesOnly ||
(options.leaveCleanZonesWhole && clean))
{
someClean = true;
ReconstructCleanCell(clean_matno, c, *c_ptr, c_ptr+1,
......@@ -1118,6 +1126,9 @@ MIR::ReconstructCleanMesh(vtkDataSet *mesh, avtMaterial *mat,
// Store off the points structure because it remains the same across
// repeated calls.
//
// Jeremy Meredith, Fri Jun 13 16:56:43 PDT 2003
// Added clean-zone-only support.
//
// ****************************************************************************
vtkDataSet *
......@@ -1157,7 +1168,8 @@ MIR::GetDataset(vector<int> mats, vtkDataSet *ds,
int *cellList = new int[ntotalcells];
for (int c = 0; c < ntotalcells; c++)
{
if (matFlag[zonesList[c].mat])
if (zonesList[c].mat >= 0 &&
matFlag[zonesList[c].mat])
{
cellList[ncells] = c;
ncells++;
......
......@@ -88,7 +88,8 @@ Math_src= \
Math/avtSquareFilter.C \
Math/avtSquareRootFilter.C \
Math/avtTanFilter.C \
Math/avtUnaryMinusFilter.C
Math/avtUnaryMinusFilter.C \
Math/avtVectorCrossProductFilter.C
MeshQuality_src= \
MeshQuality/avtNeighborFilter.C \
......
// ************************************************************************* //
// avtVectorCrossProductFilter.C //
// ************************************************************************* //
#include <avtVectorCrossProductFilter.h>
#include <vtkDataSet.h>
#include <ExpressionException.h>
// ****************************************************************************
// Method: avtVectorCrossProductFilter::DoOperation
//
// Purpose:
// Takes the cross product of the two inputs
//
// Arguments:
// in1 The first input vector
// in2 The second input vector
// out The output vector.
// ncomponents The number of components ('1' for scalar, '2' or '3' for
// vectors, etc.) Must be 3 for this operation.
// ntuples The number of tuples (ie 'npoints' or 'ncells')
//
// Notes: a x b = (a2 b3 - a3 b2)i + (a3 b1 - a1 b3)j + (a1 b2 - a2 b1)k
//
// Programmer: Sean Ahern
// Creation: Wed Jun 11 13:32:55 PDT 2003
//
// Modifications:
//
// ****************************************************************************
void
avtVectorCrossProductFilter::DoOperation(vtkDataArray *in1,
vtkDataArray *in2, vtkDataArray *out,
int ncomponents, int ntuples)
{
if (ncomponents != 3)
{
EXCEPTION1(ExpressionException,
"you cannot take the cross product of data which are not 3-component vectors.");
}
for (int i = 0 ; i < ntuples ; i++)
{
float a1 = in1->GetComponent(i, 0);
float a2 = in1->GetComponent(i, 1);
float a3 = in1->GetComponent(i, 2);
float b1 = in2->GetComponent(i, 0);
float b2 = in2->GetComponent(i, 1);
float b3 = in2->GetComponent(i, 2);
out->SetComponent(i, 0, a2*b3 - a3*b2);
out->SetComponent(i, 1, a3*b1 - a1*b3);
out->SetComponent(i, 2, a1*b2 - a2*b1);
}
}
// ************************************************************************* //
// avtVectorCrossProductFilter.h //
// ************************************************************************* //
#ifndef AVT_VCROSSPRODUCT_FILTER_H
#define AVT_VCROSSPRODUCT_FILTER_H
#include <avtBinaryMathFilter.h>
class vtkDataArray;
// ****************************************************************************
// Class: avtVectorCrossProductFilter
//
// Purpose:
// A filter that calculates the vector cross product of its two inputs.
//
// Programmer: Sean Ahern
// Creation: Wed Jun 11 13:29:38 PDT 2003
//
// ****************************************************************************
class EXPRESSION_API avtVectorCrossProductFilter : public avtBinaryMathFilter
{
public:
avtVectorCrossProductFilter() {;};
virtual ~avtVectorCrossProductFilter() {;};
virtual const char *GetType(void) { return "avtVectorCrossProductFilter"; };
virtual const char *GetDescription(void)
{ return "Calculating vector cross product"; };
virtual int NumVariableArguments() { return 2; }
protected:
virtual void DoOperation(vtkDataArray *in1, vtkDataArray *in2,
vtkDataArray *out, int ncomps, int ntuples);
};
#endif
......@@ -36,6 +36,10 @@ avtView3D::avtView3D()
// Programmer: Eric Brugger
// Creation: August 17, 2001
//
// Modifications:
// Eric Brugger, Fri Jun 6 15:24:17 PDT 2003
// I added image pan and image zoom.
//
// ****************************************************************************
avtView3D &
......@@ -54,6 +58,9 @@ avtView3D::operator=(const avtView3D &vi)
parallelScale = vi.parallelScale;
nearPlane = vi.nearPlane;
farPlane = vi.farPlane;
imagePan[0] = vi.imagePan[0];
imagePan[1] = vi.imagePan[1];
imageZoom = vi.imageZoom;
perspective = vi.perspective;
return *this;
......@@ -69,6 +76,10 @@ avtView3D::operator=(const avtView3D &vi)
// Programmer: Eric Brugger
// Creation: August 17, 2001
//
// Modifications:
// Eric Brugger, Fri Jun 6 15:24:17 PDT 2003
// I added image pan and image zoom.
//
// ****************************************************************************
bool
......@@ -94,7 +105,8 @@ avtView3D::operator==(const avtView3D &vi)
if (viewAngle != vi.viewAngle || parallelScale != vi.parallelScale ||
nearPlane != vi.nearPlane || farPlane != vi.farPlane ||
perspective != vi.perspective)
imagePan[0] != vi.imagePan[0] | imagePan[1] != vi.imagePan[1] ||
imageZoom != vi.imageZoom || perspective != vi.perspective)
{
return false;
}
......@@ -118,6 +130,9 @@ avtView3D::operator==(const avtView3D &vi)
// since I changed their definition to be the distance from the focus
// instead of the camera.
//
// Eric Brugger, Fri Jun 6 15:24:17 PDT 2003
// I added image pan and image zoom.
//
// ****************************************************************************
void
......@@ -136,6 +151,9 @@ avtView3D::SetToDefault()
parallelScale = 0.5;
nearPlane = -0.5;
farPlane = 0.5;
imagePan[0] = 0.;
imagePan[1] = 0.;
imageZoom = 1.;
perspective = false;
}
......@@ -171,6 +189,9 @@ avtView3D::SetToDefault()
// Eric Brugger, Wed Jan 8 13:34:01 PST 2003
// I modified the routine to normalize the normal before using it.
//
// Eric Brugger, Fri Jun 6 15:24:17 PDT 2003
// I added image pan and image zoom.
//
// ****************************************************************************
void
......@@ -227,4 +248,11 @@ avtView3D::SetViewInfoFromView(avtViewInfo &viewInfo) const
//
viewInfo.nearPlane = max (nearPlane + distance, (farPlane - nearPlane) / 5000.);
viewInfo.farPlane = farPlane + distance;
//
// Set the image pan and image zoom.
//
viewInfo.imagePan[0] = imagePan[0];
viewInfo.imagePan[1] = imagePan[1];
viewInfo.imageZoom = imageZoom;
}
......@@ -21,6 +21,9 @@ struct avtViewInfo;
// Eric Brugger, Fri Mar 29 15:09:35 PST 2002
// Remove the method SetViewFromViewInfo.
//
// Eric Brugger, Fri Jun 6 15:20:43 PDT 2003
// I added image pan and image zoom.
//
// ****************************************************************************
struct PIPELINE_API avtView3D
......@@ -32,6 +35,8 @@ struct PIPELINE_API avtView3D
double parallelScale;
double nearPlane;
double farPlane;
double imagePan[2];
double imageZoom;
bool perspective;
public:
......
......@@ -30,6 +30,10 @@ avtViewInfo::avtViewInfo()
// Programmer: Hank Childs
// Creation: November 27, 2000
//
// Modifications:
// Eric Brugger, Fri Jun 6 15:30:49 PDT 2003
// I added image pan and image zoom.
//
// ****************************************************************************
avtViewInfo &
......@@ -50,6 +54,9 @@ avtViewInfo::operator=(const avtViewInfo &vi)
orthographic = vi.orthographic;
nearPlane = vi.nearPlane;
farPlane = vi.farPlane;
imagePan[0] = vi.imagePan[0];
imagePan[1] = vi.imagePan[1];
imageZoom = vi.imageZoom;
return *this;
}
......@@ -64,6 +71,10 @@ avtViewInfo::operator=(const avtViewInfo &vi)
// Programmer: Hank Childs
// Creation: November 27, 2000
//
// Modifications:
// Eric Brugger, Fri Jun 6 15:30:49 PDT 2003
// I added image pan and image zoom.
//
// ****************************************************************************
bool
......@@ -107,6 +118,9 @@ avtViewInfo::operator==(const avtViewInfo &vi)
return false;
}
if (imagePan[0] != vi.imagePan[0] || imagePan[1] != vi.imagePan[1] ||
imageZoom != vi.imageZoom)
return true;
}
......@@ -120,6 +134,10 @@ avtViewInfo::operator==(const avtViewInfo &vi)
// Programmer: Kathleen Bonnell
// Creation: January 08, 2001
//
// Modifications:
// Eric Brugger, Fri Jun 6 15:30:49 PDT 2003
// I added image pan and image zoom.
//
// ****************************************************************************
void
......@@ -140,6 +158,9 @@ avtViewInfo::SetToDefault()
nearPlane = 0.001;
farPlane = 100;
orthographic = true;
imagePan[0] = 0.;
imagePan[1] = 0.;
imageZoom = 1.;
}
// ****************************************************************************
......@@ -180,6 +201,10 @@ avtViewInfo::SetViewFromCamera(vtkCamera *vtkcam)
// Programmer: Kathleen Bonnell
// Creation: January 08, 2001
//
// Modifications:
// Eric Brugger, Fri Jun 6 15:30:49 PDT 2003
// I added image pan and image zoom.
//
// ****************************************************************************
void
......@@ -195,6 +220,8 @@ avtViewInfo::SetCameraFromView(vtkCamera *vtkcam) const
vtkcam->SetFocalPoint(focus);
vtkcam->SetPosition(camera);
vtkcam->SetViewUp(viewUp);
vtkcam->SetWindowCenter(imagePan[0], imagePan[1]);
vtkcam->SetFocalDisk(imageZoom);
}
......@@ -30,6 +30,9 @@ class vtkCamera;
// Hank Childs, Mon Jun 18 09:03:19 PDT 2001
// Added constructor.
//
// Eric Brugger, Fri Jun 6 15:29:28 PDT 2003
// I added image pan and image zoom.
//
// ****************************************************************************
struct PIPELINE_API avtViewInfo
......@@ -42,6 +45,8 @@ struct PIPELINE_API avtViewInfo
bool setScale;
double nearPlane;
double farPlane;
double imagePan[2];
double imageZoom;
bool orthographic;
public:
......
......@@ -488,6 +488,10 @@ Navigate3D::RotateCamera(const int x, const int y)
// Eric Brugger, Tue Apr 2 11:28:11 PST 2002
// I modified the routine to make the viewing changes using an avtView3D.
//
// Eric Brugger, Wed Jun 11 08:55:07 PDT 2003
// I changed the pan behavior so that it pans the image and doesn't
// change the camera or focal point.
//
// ****************************************************************************
void
......@@ -501,66 +505,23 @@ Navigate3D::PanCamera(const int x, const int y)
// Determine the size of the window.
//
int size[2];
int width, height;
rwi->GetSize(size);
width = size[0];
height = size[1];
//
// Get the current view information.
//
VisWindow *vw = proxy;
const avtView3D &oldView3D = vw->GetView3D();
double pan[2];
double VPN[3];
double VUP[3];
VPN[0] = oldView3D.normal[0];
VPN[1] = oldView3D.normal[1];
VPN[2] = oldView3D.normal[2];
VUP[0] = oldView3D.viewUp[0];
VUP[1] = oldView3D.viewUp[1];
VUP[2] = oldView3D.viewUp[2];
//
// Calculate the coordinate transformation from the world coordinate
// space to the screen coordinate space.
//
double VUPCrossVPN[3];
double mat[3][3], matTranspose[3][3];
VectorCross(VUP, VPN, VUPCrossVPN);
MatrixSet(mat, VUPCrossVPN, VUP, VPN);
MatrixTranspose(mat, matTranspose);
//
// Calculate the x and y pan distances in the view plane.
//
double pan[3];
pan[0] = ((double)((OldX - x) / height)) *
2.0 * oldView3D.parallelScale;
pan[1] = ((double)((OldY - y) / height)) *
2.0 * oldView3D.parallelScale;
pan[2] = 0.;
//
// Transform the screen space pan factors to world space pan factors.
//
double pan2[3];
VectorMatrixMult(pan, matTranspose, pan2);
//
// Set the new origin.
//
avtView3D newView3D = vw->GetView3D();
newView3D.focus[0] += pan2[0];
newView3D.focus[1] += pan2[1];
newView3D.focus[2] += pan2[2];
pan[0] = ((double)((x - OldX) / size[0])) / newView3D.imageZoom;
pan[1] = ((double)((y - OldY) / size[1])) / newView3D.imageZoom;
newView3D.imagePan[0] += pan[0];
newView3D.imagePan[1] += pan[1];
vw->SetView3D(newView3D);
......@@ -588,6 +549,10 @@ Navigate3D::PanCamera(const int x, const int y)
// Eric Brugger, Tue Apr 2 11:28:11 PST 2002
// I modified the routine to make the viewing changes using an avtView3D.
//
// Eric Brugger, Wed Jun 11 08:55:07 PDT 2003
// I changed the zoom behavior so that it zooms the image and doesn't
// change the camera or focal point.
//
// ****************************************************************************
void
......@@ -611,7 +576,7 @@ Navigate3D::ZoomCamera(const int x, const int y)
avtView3D newView3D = vw->GetView3D();
newView3D.parallelScale = newView3D.parallelScale / zoomFactor;
newView3D.imageZoom = newView3D.imageZoom * zoomFactor;
vw->SetView3D(newView3D);
......
......@@ -187,6 +187,10 @@ Zoom3D::EndMiddleButtonAction()
// Eric Brugger, Fri Apr 12 12:37:26 PDT 2002
// Correct a bug in the calculation of the pan factor.
//
// Eric Brugger, Thu Jun 12 12:35:20 PDT 2003
// I changed the zoom behavior so that it pans and zooms the image and
// doesn't change the camera and focal point.
//
// ****************************************************************************
void
......@@ -206,75 +210,31 @@ Zoom3D::ZoomCamera(void)
// Determine the size of the window.
//
int size[2];
int width, height;
rwi->GetSize(size);
width = size[0];
height = size[1];
//
// Get the current view information.
//
VisWindow *vw = proxy;
const avtView3D &oldView3D = vw->GetView3D();
double VPN[3];
double VUP[3];
VPN[0] = oldView3D.normal[0];
VPN[1] = oldView3D.normal[1];
VPN[2] = oldView3D.normal[2];
VUP[0] = oldView3D.viewUp[0];
VUP[1] = oldView3D.viewUp[1];
VUP[2] = oldView3D.viewUp[2];
//
// Calculate the coordinate transformation from the world coordinate
// space to the screen coordinate space.
//
double VUPCrossVPN[3];
double mat[3][3], matTranspose[3][3];
VectorCross(VUP, VPN, VUPCrossVPN);
MatrixSet(mat, VUPCrossVPN, VUP, VPN);
MatrixTranspose(mat, matTranspose);
//
// Calculate the x and y pan distances in the view plane.
//
double pan[3];
pan[0] = (((double)(anchorX + lastX - width)) / (2.0 * (double)width)) *
2.0 * oldView3D.parallelScale;
pan[1] = (((double)(anchorY + lastY - height)) / (2.0 * (double)height)) *
2.0 * oldView3D.parallelScale;
pan[2] = 0.;
//
// Transform the screen space pan factors to world space pan factors.
//
double pan2[3];
VectorMatrixMult(pan, matTranspose, pan2);
//
// Calculate the zoom factor.
// Set the new image pan and image zoom.
//
double zoomFactor;
double pan[2];
zoomFactor = fabs((double)(anchorY - lastY)) / (double) height;
//
// Set the new origin and parallel scale.
//
avtView3D newView3D = vw->GetView3D();
newView3D.focus[0] += pan2[0];
newView3D.focus[1] += pan2[1];
newView3D.focus[2] += pan2[2];
pan[0] = (((double)(anchorX + lastX - size[0])) / (2.0 * (double)size[0]))
/ newView3D.imageZoom;
pan[1] = (((double)(anchorY + lastY - size[1])) / (2.0 * (double)size[1]))
/ newView3D.imageZoom;
zoomFactor = fabs((double)(anchorY - lastY)) / (double) size[1];
newView3D.parallelScale = newView3D.parallelScale * zoomFactor;
newView3D.imagePan[0] -= pan[0];
newView3D.imagePan[1] -= pan[1];
newView3D.imageZoom = newView3D.imageZoom / zoomFactor;
vw->SetView3D(newView3D);
......@@ -294,6 +254,11 @@ Zoom3D::ZoomCamera(void)
// Programmer: Eric Brugger
// Creation: April 12, 2002
//
// Modifications:
// Eric Brugger, Fri Jun 13 09:06:00 PDT 2003
// I changed the zoom behavior so that it zooms the image and doesn't
// change the camera or focal point.
//
// ****************************************************************************
void
......@@ -317,7 +282,7 @@ Zoom3D::ZoomCamera(const int x, const int y)
avtView3D newView3D = vw->GetView3D();
newView3D.parallelScale = newView3D.parallelScale / zoomFactor;
newView3D.imageZoom = newView3D.imageZoom * zoomFactor;
vw->SetView3D(newView3D);
......
......@@ -51,6 +51,10 @@ const int THROWOUT_DIM = (2 * GHOST_PADDING);
// Programmer: Akira Haddox
// Creation: June 4, 2003
//
// Modifications:
// Akira Haddox, Fri Jun 13 11:16:41 PDT 2003