Commit 83bfc4e3 authored by js9's avatar js9

Adding shear support to 3D view, allowing e.g. oblique projections.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@12078 18c085ea-50e0-402c-830e-de6fd14e8384
parent ed4f3dc8
......@@ -88,6 +88,9 @@ avtView3D::avtView3D()
// Jeremy Meredith, Wed May 19 14:15:58 EDT 2010
// Support 3D axis scaling (3D equivalent of full-frame mode).
//
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
avtView3D &
......@@ -119,6 +122,9 @@ avtView3D::operator=(const avtView3D &vi)
axis3DScales[0] = vi.axis3DScales[0];
axis3DScales[1] = vi.axis3DScales[1];
axis3DScales[2] = vi.axis3DScales[2];
shear[0] = vi.shear[0];
shear[1] = vi.shear[1];
shear[2] = vi.shear[2];
return *this;
}
......@@ -145,6 +151,9 @@ avtView3D::operator=(const avtView3D &vi)
// Jeremy Meredith, Wed May 19 14:15:58 EDT 2010
// Support 3D axis scaling (3D equivalent of full-frame mode).
//
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
bool
......@@ -182,6 +191,12 @@ avtView3D::operator==(const avtView3D &vi)
return false;
}
if (shear[0] != vi.shear[0] || shear[1] != vi.shear[1] ||
shear[2] != vi.shear[2])
{
return false;
}
if (viewAngle != vi.viewAngle || parallelScale != vi.parallelScale ||
nearPlane != vi.nearPlane || farPlane != vi.farPlane ||
imagePan[0] != vi.imagePan[0] || imagePan[1] != vi.imagePan[1] ||
......@@ -223,6 +238,9 @@ avtView3D::operator==(const avtView3D &vi)
// Jeremy Meredith, Wed May 19 14:15:58 EDT 2010
// Support 3D axis scaling (3D equivalent of full-frame mode).
//
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
void
......@@ -254,6 +272,9 @@ avtView3D::SetToDefault()
axis3DScales[0] = 1.0;
axis3DScales[1] = 1.0;
axis3DScales[2] = 1.0;
shear[0] = 0.;
shear[1] = 0.;
shear[2] = 1.;
}
// ****************************************************************************
......@@ -300,6 +321,9 @@ avtView3D::SetToDefault()
// Mark C. Miller, Thu Nov 18 21:25:36 PST 2004
// Undid previous change. It could result in negative nearPlane values
//
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
void
......@@ -365,6 +389,13 @@ avtView3D::SetViewInfoFromView(avtViewInfo &viewInfo) const
viewInfo.imagePan[0] = imagePan[0];
viewInfo.imagePan[1] = imagePan[1];
viewInfo.imageZoom = imageZoom;
//
// Set the vew shear.
//
viewInfo.shear[0] = shear[0];
viewInfo.shear[1] = shear[1];
viewInfo.shear[2] = shear[2];
}
// ****************************************************************************
......@@ -392,6 +423,9 @@ avtView3D::SetViewInfoFromView(avtViewInfo &viewInfo) const
// Jeremy Meredith, Wed May 19 14:15:58 EDT 2010
// Support 3D axis scaling (3D equivalent of full-frame mode).
//
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
void
......@@ -404,6 +438,7 @@ avtView3D::SetFromView3DAttributes(const View3DAttributes *view3DAtts)
viewUp[i] = view3DAtts->GetViewUp()[i];
centerOfRotation[i] = view3DAtts->GetCenterOfRotation()[i];
axis3DScales[i] = view3DAtts->GetAxis3DScales()[i];
shear[i] = view3DAtts->GetShear()[i];
}
viewAngle = view3DAtts->GetViewAngle();
......@@ -444,6 +479,9 @@ avtView3D::SetFromView3DAttributes(const View3DAttributes *view3DAtts)
// Jeremy Meredith, Wed May 19 14:15:58 EDT 2010
// Support 3D axis scaling (3D equivalent of full-frame mode).
//
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
void
......@@ -464,4 +502,5 @@ avtView3D::SetToView3DAttributes(View3DAttributes *view3DAtts) const
view3DAtts->SetCenterOfRotation(centerOfRotation);
view3DAtts->SetAxis3DScaleFlag(axis3DScaleFlag);
view3DAtts->SetAxis3DScales(axis3DScales);
view3DAtts->SetShear(shear);
}
......@@ -76,6 +76,9 @@ class View3DAttributes;
// Jeremy Meredith, Wed May 19 14:15:58 EDT 2010
// Support 3D axis scaling (3D equivalent of full-frame mode).
//
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
struct AVTVIEW_API avtView3D
......@@ -95,6 +98,7 @@ struct AVTVIEW_API avtView3D
double centerOfRotation[3];
bool axis3DScaleFlag;
double axis3DScales[3];
double shear[3];
public:
avtView3D();
......
......@@ -75,6 +75,9 @@ avtViewInfo::avtViewInfo()
// Hank Childs, Wed Oct 15 13:09:03 PDT 2003
// Added eye angle.
//
// Jeremy Meredith, Mon Aug 2 13:47:52 EDT 2010
// Added shear.
//
// ****************************************************************************
avtViewInfo &
......@@ -99,6 +102,9 @@ avtViewInfo::operator=(const avtViewInfo &vi)
imagePan[0] = vi.imagePan[0];
imagePan[1] = vi.imagePan[1];
imageZoom = vi.imageZoom;
shear[0] = vi.shear[0];
shear[1] = vi.shear[1];
shear[2] = vi.shear[2];
return *this;
}
......@@ -120,6 +126,9 @@ avtViewInfo::operator=(const avtViewInfo &vi)
// Hank Childs, Wed Oct 15 13:09:03 PDT 2003
// Added eye angle.
//
// Jeremy Meredith, Mon Aug 2 13:47:52 EDT 2010
// Added shear.
//
// ****************************************************************************
bool
......@@ -174,6 +183,13 @@ avtViewInfo::operator==(const avtViewInfo &vi)
return false;
}
if (shear[0] != vi.shear[0] || shear[1] != vi.shear[1]
|| shear[2] != vi.shear[2])
{
return false;
}
return true;
}
......@@ -194,6 +210,9 @@ avtViewInfo::operator==(const avtViewInfo &vi)
// Hank Childs, Wed Oct 15 13:09:03 PDT 2003
// Added eye angle.
//
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
void
......@@ -218,6 +237,9 @@ avtViewInfo::SetToDefault()
imagePan[0] = 0.;
imagePan[1] = 0.;
imageZoom = 1.;
shear[0] = 0.;
shear[1] = 0.;
shear[2] = 1.;
}
// ****************************************************************************
......@@ -234,6 +256,9 @@ avtViewInfo::SetToDefault()
// Hank Childs, Wed Oct 15 13:09:03 PDT 2003
// Added eye angle.
//
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
void
......@@ -252,6 +277,7 @@ avtViewInfo::SetViewFromCamera(vtkCamera *vtkcam)
eyeAngle = vtkcam->GetEyeAngle();
parallelScale = vtkcam->GetParallelScale();
orthographic = (vtkcam->GetParallelProjection() != 0 ? true : false);
vtkcam->GetViewShear(shear);
}
......@@ -275,6 +301,9 @@ avtViewInfo::SetViewFromCamera(vtkCamera *vtkcam)
// Hank Childs, Wed Oct 15 13:09:03 PDT 2003
// Added eye angle.
//
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
void
......@@ -288,6 +317,7 @@ avtViewInfo::SetCameraFromView(vtkCamera *vtkcam) const
}
vtkcam->SetParallelProjection(orthographic ? 1 : 0);
vtkcam->SetClippingRange(nearPlane, farPlane);
vtkcam->SetViewShear(shear[0],shear[1],shear[2]);
vtkcam->SetFocalPoint(focus);
vtkcam->SetPosition(camera);
vtkcam->SetViewUp(viewUp);
......
......@@ -74,6 +74,9 @@ class vtkCamera;
// Hank Childs, Wed Oct 15 13:09:03 PDT 2003
// Added eye angle.
//
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
struct AVTVIEW_API avtViewInfo
......@@ -90,6 +93,7 @@ struct AVTVIEW_API avtViewInfo
double imagePan[2];
double imageZoom;
bool orthographic;
double shear[3];
public:
avtViewInfo();
......
......@@ -83,6 +83,9 @@ void View3DAttributes::Init()
axis3DScales[0] = 1;
axis3DScales[1] = 1;
axis3DScales[2] = 1;
shear[0] = 0;
shear[1] = 0;
shear[2] = 1;
View3DAttributes::SelectAll();
}
......@@ -136,6 +139,10 @@ void View3DAttributes::Copy(const View3DAttributes &obj)
axis3DScales[1] = obj.axis3DScales[1];
axis3DScales[2] = obj.axis3DScales[2];
shear[0] = obj.shear[0];
shear[1] = obj.shear[1];
shear[2] = obj.shear[2];
View3DAttributes::SelectAll();
}
......@@ -322,6 +329,11 @@ View3DAttributes::operator == (const View3DAttributes &obj) const
for(int i = 0; i < 3 && axis3DScales_equal; ++i)
axis3DScales_equal = (axis3DScales[i] == obj.axis3DScales[i]);
// Compare the shear arrays.
bool shear_equal = true;
for(int i = 0; i < 3 && shear_equal; ++i)
shear_equal = (shear[i] == obj.shear[i]);
// Create the return value
return (viewNormal_equal &&
focus_equal &&
......@@ -337,7 +349,8 @@ View3DAttributes::operator == (const View3DAttributes &obj) const
(centerOfRotationSet == obj.centerOfRotationSet) &&
centerOfRotation_equal &&
(axis3DScaleFlag == obj.axis3DScaleFlag) &&
axis3DScales_equal);
axis3DScales_equal &&
shear_equal);
}
// ****************************************************************************
......@@ -496,6 +509,7 @@ View3DAttributes::SelectAll()
Select(ID_centerOfRotation, (void *)centerOfRotation, 3);
Select(ID_axis3DScaleFlag, (void *)&axis3DScaleFlag);
Select(ID_axis3DScales, (void *)axis3DScales, 3);
Select(ID_shear, (void *)shear, 3);
}
///////////////////////////////////////////////////////////////////////////////
......@@ -618,6 +632,12 @@ View3DAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool force
node->AddNode(new DataNode("axis3DScales", axis3DScales, 3));
}
if(completeSave || !FieldsEqual(ID_shear, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("shear", shear, 3));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
......@@ -684,6 +704,8 @@ View3DAttributes::SetFromNode(DataNode *parentNode)
SetAxis3DScaleFlag(node->AsBool());
if((node = searchNode->GetNode("axis3DScales")) != 0)
SetAxis3DScales(node->AsDoubleArray());
if((node = searchNode->GetNode("shear")) != 0)
SetShear(node->AsDoubleArray());
}
///////////////////////////////////////////////////////////////////////////////
......@@ -806,6 +828,15 @@ View3DAttributes::SetAxis3DScales(const double *axis3DScales_)
Select(ID_axis3DScales, (void *)axis3DScales, 3);
}
void
View3DAttributes::SetShear(const double *shear_)
{
shear[0] = shear_[0];
shear[1] = shear_[1];
shear[2] = shear_[2];
Select(ID_shear, (void *)shear, 3);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -936,6 +967,18 @@ View3DAttributes::GetAxis3DScales()
return axis3DScales;
}
const double *
View3DAttributes::GetShear() const
{
return shear;
}
double *
View3DAttributes::GetShear()
{
return shear;
}
///////////////////////////////////////////////////////////////////////////////
// Select property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -976,6 +1019,12 @@ View3DAttributes::SelectAxis3DScales()
Select(ID_axis3DScales, (void *)axis3DScales, 3);
}
void
View3DAttributes::SelectShear()
{
Select(ID_shear, (void *)shear, 3);
}
///////////////////////////////////////////////////////////////////////////////
// Keyframing methods
///////////////////////////////////////////////////////////////////////////////
......@@ -1015,6 +1064,7 @@ View3DAttributes::GetFieldName(int index) const
case ID_centerOfRotation: return "centerOfRotation";
case ID_axis3DScaleFlag: return "axis3DScaleFlag";
case ID_axis3DScales: return "axis3DScales";
case ID_shear: return "shear";
default: return "invalid index";
}
}
......@@ -1054,6 +1104,7 @@ View3DAttributes::GetFieldType(int index) const
case ID_centerOfRotation: return FieldType_doubleArray;
case ID_axis3DScaleFlag: return FieldType_bool;
case ID_axis3DScales: return FieldType_doubleArray;
case ID_shear: return FieldType_doubleArray;
default: return FieldType_unknown;
}
}
......@@ -1093,6 +1144,7 @@ View3DAttributes::GetFieldTypeName(int index) const
case ID_centerOfRotation: return "doubleArray";
case ID_axis3DScaleFlag: return "bool";
case ID_axis3DScales: return "doubleArray";
case ID_shear: return "doubleArray";
default: return "invalid index";
}
}
......@@ -1224,6 +1276,16 @@ View3DAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = axis3DScales_equal;
}
break;
case ID_shear:
{ // new scope
// Compare the shear arrays.
bool shear_equal = true;
for(int i = 0; i < 3 && shear_equal; ++i)
shear_equal = (shear[i] == obj.shear[i]);
retval = shear_equal;
}
break;
default: retval = false;
}
......@@ -1549,6 +1611,8 @@ void View3DAttributes::RotateAxis(int axis, double angle)
// Creation: Tue Mar 3 16:21:14 PST 2009
//
// Modifications:
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
void
......@@ -1616,6 +1680,13 @@ View3DAttributes::ResetView(const double *bbox)
view3D.centerOfRotation[1] = view3D.focus[1];
view3D.centerOfRotation[2] = view3D.focus[2];
//
// Reset the shear
//
view3D.shear[0] = 0.;
view3D.shear[1] = 0.;
view3D.shear[2] = 1.;
// Copy the object into this.
*this = view3D;
}
......
......@@ -319,6 +319,8 @@ Definition:
// Creation: Tue Mar 3 16:21:14 PST 2009
//
// Modifications:
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
void
......@@ -386,6 +388,13 @@ View3DAttributes::ResetView(const double *bbox)
view3D.centerOfRotation[1] = view3D.focus[1];
view3D.centerOfRotation[2] = view3D.focus[2];
//
// Reset the shear
//
view3D.shear[0] = 0.;
view3D.shear[1] = 0.;
view3D.shear[2] = 1.;
// Copy the object into this.
*this = view3D;
}
......
......@@ -91,6 +91,7 @@ public:
void SelectImagePan();
void SelectCenterOfRotation();
void SelectAxis3DScales();
void SelectShear();
// Property setting methods
void SetViewNormal(const double *viewNormal_);
......@@ -108,6 +109,7 @@ public:
void SetCenterOfRotation(const double *centerOfRotation_);
void SetAxis3DScaleFlag(bool axis3DScaleFlag_);
void SetAxis3DScales(const double *axis3DScales_);
void SetShear(const double *shear_);
// Property getting methods
const double *GetViewNormal() const;
......@@ -131,6 +133,8 @@ public:
bool GetAxis3DScaleFlag() const;
const double *GetAxis3DScales() const;
double *GetAxis3DScales();
const double *GetShear() const;
double *GetShear();
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
......@@ -164,6 +168,7 @@ public:
ID_centerOfRotation,
ID_axis3DScaleFlag,
ID_axis3DScales,
ID_shear,
ID__LAST
};
......@@ -183,11 +188,12 @@ private:
double centerOfRotation[3];
bool axis3DScaleFlag;
double axis3DScales[3];
double shear[3];
// Static class format string for type map.
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define VIEW3DATTRIBUTES_TMFS "DDDddddDdbdbDbD"
#define VIEW3DATTRIBUTES_TMFS "DDDddddDdbdbDbDD"
#endif
......@@ -56,6 +56,11 @@
1.000000
1.000000
</Field>
<Field name="shear" label="shear" type="doubleArray" length="3">
0.000000
0.000000
1.000000
</Field>
<Function name="RotateAxis" user="true" member="true">
</Function>
<Function name="ResetView" user="true" member="true">
......
......@@ -226,6 +226,9 @@ QvisViewWindow::~QvisViewWindow()
// Jeremy Meredith, Wed May 19 14:15:58 EDT 2010
// Support 3D axis scaling (3D equivalent of full-frame mode).
//
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
void
......@@ -463,6 +466,15 @@ QvisViewWindow::CreateWindowContents()
imageZoomLabel->setBuddy(imageZoomLineEdit);
layout3D->addWidget(imageZoomLabel, 8, 0);
shearLineEdit = new QLineEdit(page3D);
shearLineEdit->setMinimumWidth(MIN_LINEEDIT_WIDTH);
connect(shearLineEdit, SIGNAL(returnPressed()),
this, SLOT(processShearText()));
layout3D->addWidget(shearLineEdit, 9, 1, 1, 2);
QLabel *shearLabel = new QLabel(tr("Shear"), page3D);
shearLabel->setBuddy(shearLineEdit);
layout3D->addWidget(shearLabel, 9, 0);
// portion for modifying the eye angle.
eyeAngleLineEdit = new QNarrowLineEdit(page3D);
connect(eyeAngleLineEdit, SIGNAL(returnPressed()), this,
......@@ -477,15 +489,15 @@ QvisViewWindow::CreateWindowContents()
eyeAngleSlider->setValue(40);
connect(eyeAngleSlider, SIGNAL(valueChanged(int)), this,
SLOT(eyeAngleSliderChanged(int)));
layout3D->addWidget(eyeAngleLabel, 9, 0);
layout3D->addWidget(eyeAngleLineEdit, 9, 1);
layout3D->addWidget(eyeAngleSlider, 9, 2);
layout3D->addWidget(eyeAngleLabel, 10, 0);
layout3D->addWidget(eyeAngleLineEdit, 10, 1);
layout3D->addWidget(eyeAngleSlider, 10, 2);
// Create the check boxes
perspectiveToggle = new QCheckBox(tr("Perspective"), page3D);
connect(perspectiveToggle, SIGNAL(toggled(bool)),
this, SLOT(perspectiveToggled(bool)));
layout3D->addWidget(perspectiveToggle, 10, 1);
layout3D->addWidget(perspectiveToggle, 11, 1);
// Add alignment options
alignComboBox = new QComboBox(page3D);
......@@ -498,22 +510,22 @@ QvisViewWindow::CreateWindowContents()
alignComboBox->addItem("+Z");
connect(alignComboBox, SIGNAL(activated(int)),
this, SLOT(viewButtonClicked(int)));
layout3D->addWidget(alignComboBox, 11, 1);
layout3D->addWidget(alignComboBox, 12, 1);
QLabel *alignLabel = new QLabel(tr("Align to axis"), page3D);
alignLabel->setBuddy(alignComboBox);
layout3D->addWidget(alignLabel, 11, 0);
layout3D->addWidget(alignLabel, 12, 0);
// Create the 3D axis scale check box
axis3DScaleFlagToggle = new QCheckBox(tr("Scale 3D axes"), page3D);
connect(axis3DScaleFlagToggle, SIGNAL(toggled(bool)),
this, SLOT(axis3DScaleFlagToggled(bool)));
layout3D->addWidget(axis3DScaleFlagToggle, 12, 0);
layout3D->addWidget(axis3DScaleFlagToggle, 13, 0);
axis3DScalesLineEdit = new QLineEdit(page3D);
axis3DScalesLineEdit->setMinimumWidth(MIN_LINEEDIT_WIDTH);
connect(axis3DScalesLineEdit, SIGNAL(returnPressed()),
this, SLOT(processAxis3DScalesText()));
layout3D->addWidget(axis3DScalesLineEdit, 12, 1, 1, 2);
layout3D->addWidget(axis3DScalesLineEdit, 13, 1, 1, 2);
//
// Add the controls for the axis array view.
......@@ -985,6 +997,9 @@ QvisViewWindow::Update2D(bool doAll)
// Jeremy Meredith, Wed May 19 14:15:58 EDT 2010
// Support 3D axis scaling (3D equivalent of full-frame mode).
//
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
void
......@@ -1067,6 +1082,10 @@ QvisViewWindow::Update3D(bool doAll)
temp = DoublesToQString(view3d->GetAxis3DScales(), 3);
axis3DScalesLineEdit->setText(temp);
break;
case View3DAttributes::ID_shear:
temp = DoublesToQString(view3d->GetShear(), 3);
shearLineEdit->setText(temp);
break;
}
}
}
......@@ -1605,6 +1624,9 @@ QvisViewWindow::GetCurrentValues2d(int which_widget)
// Make sure axis scales are positive. (Negative and zero have some
// bad consequences.)
//
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// ****************************************************************************
void
......@@ -1794,6 +1816,20 @@ QvisViewWindow::GetCurrentValues3d(int which_widget)
}
}
// Do the shear values.
if(which_widget == View3DAttributes::ID_shear || doAll)
{
double v[3];
if(LineEditGetDoubles(shearLineEdit, v, 3))
view3d->SetShear(v);
else
{
ResettingError(tr("shear"),
DoublesToQString(view3d->GetShear(), 3));
view3d->SetShear(view3d->GetShear());
}
}
}
void
......@@ -2474,6 +2510,13 @@ QvisViewWindow::processImageZoomText()
Apply();
}
void
QvisViewWindow::processShearText()
{
GetCurrentValues3d(View3DAttributes::ID_shear);
Apply();
}
void
QvisViewWindow::processEyeAngleText()
{
......
......@@ -133,6 +133,9 @@ class QPushButton;
// Jeremy Meredith, Wed May 19 14:15:58 EDT 2010
// Account for 3D axis scaling (3D equivalent of full-frame mode).
//
// Jeremy Meredith, Mon Aug 2 13:55:42 EDT 2010
// Added shear support for oblique projections.
//
// ****************************************************************************
class GUI_API QvisViewWindow : public QvisPostableWindowSimpleObserver
......@@ -203,6 +206,7 @@ private slots:
void viewButtonClicked(int index);
void axis3DScaleFlagToggled(bool val);
void processAxis3DScalesText();
void processShearText();
void processEyeAngleText();
void eyeAngleSliderChanged(int val);
......@@ -284,6 +288,7 @@ private:
QComboBox *alignComboBox;
QCheckBox *axis3DScaleFlagToggle;
QLineEdit *axis3DScalesLineEdit;
QLineEdit *shearLineEdit;
// AxisArray widgets
QWidget *pageAxisArray;
......
......@@ -56,7 +56,7 @@ package llnl.visit;
public class View3DAttributes extends AttributeSubject
{
private static int View3DAttributes_numAdditionalAtts = 15;
private static int View3DAttributes_numAdditionalAtts = 16;
public View3DAttributes()
{
......@@ -94,6 +94,10 @@ public class View3DAttributes extends AttributeSubject
axis3DScales[0] = 1;
axis3DScales[1] = 1;
axis3DScales[2] = 1;
shear = new double[3];
shear[0] = 0;
shear[1] = 0;
shear[2] = 1;
}
public View3DAttributes(int nMoreFields)
......@@ -132,6 +136,10 @@ public class View3DAttributes extends AttributeSubject
axis3DScales[0] = 1;
axis3DScales[1] = 1;
axis3DScales[2] = 1;
shear = new double[3];
shear[0] = 0;
shear[1] = 0;
shear[2] = 1;
}
public View3DAttributes(View3DAttributes obj)
......@@ -178,6 +186,11 @@ public class View3DAttributes extends AttributeSubject
axis3DScales[1] = obj.axis3DScales[1];
axis3DScales[2] = obj.axis3DScales[2];
shear = new double[3];
shear[0] = obj.shear[0];
shear[1] = obj.shear[1];
shear[2] = obj.shear[2];
SelectAll();
}
......@@ -226,6 +239,11 @@ public class View3DAttributes extends AttributeSubject
for(i = 0; i < 3 && axis3DScales_equal; ++i)
axis3DScales_equal = (axis3DScales[i] == obj.axis3DScales[i]);
// Compare the shear arrays.
boolean shear_equal = true;
for(i = 0; i < 3 && shear_equal; ++i)
shear_equal = (shear[i] == obj.shear[i]);
// Create the return value
return (viewNormal_equal &&
focus_equal &&
......@@ -241,7 +259,8 @@ public class View3DAttributes extends AttributeSubject
(centerOfRotationSet == obj.centerOfRotationSet) &&
centerOfRotation_equal &&
(axis3DScaleFlag == obj.axis3DScaleFlag) &&
axis3DScales_equal);
axis3DScales_equal &&
shear_equal);
}
// Property setting methods
......@@ -393,6 +412,22 @@ public class View3DAttributes extends AttributeSubject
Select(14);
}
public void SetShear(double[] shear_)
{
shear[0] = shear_[0];
shear[1] = shear_[1];
shear[2] = shear_[2];
Select(15);