Commit ca443980 authored by brugger's avatar brugger

I made several fixes to the 3d the multi resolution data selection
support. Everything should work properly at this point.

The specific changes made were:

   a) I added a view area to the multi resolution data selection
      since the frustum and cell size were insufficient in 3d.
   b) I corrected an issue with the multi resolution operator getting
      the wrong data limit for the first render in 3d.
   c) I enhanced the MRTest reader to provide a 3d mesh.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@22589 18c085ea-50e0-402c-830e-de6fd14e8384
parent f4f681d7
......@@ -78,12 +78,18 @@
// Eric Brugger, Thu Jan 2 15:16:28 PST 2014
// Add support for 3d multi resolution data selections.
//
// Eric Brugger, Wed Jan 8 17:00:23 PST 2014
// I added a ViewArea to the multi resolution data selection since the
// view frustum was insufficient in 3d.
//
// ****************************************************************************
avtMultiresFilter::avtMultiresFilter(double *frust2D, double *frust3D,
double size)
avtMultiresFilter::avtMultiresFilter(double area2D, double area3D,
double *frust2D, double *frust3D, double size)
{
nDims = 3;
viewArea2D = area2D;
viewArea3D = area3D;
for (int i = 0; i < 6; i++)
desiredFrustum2D[i] = frust2D[i];
for (int i = 0; i < 6; i++)
......@@ -185,6 +191,10 @@ avtMultiresFilter::Execute(void)
// Eric Brugger, Thu Jan 2 15:16:28 PST 2014
// Add support for 3d multi resolution data selections.
//
// Eric Brugger, Wed Jan 8 17:00:23 PST 2014
// I added a ViewArea to the multi resolution data selection since the
// view frustum was insufficient in 3d.
//
// ****************************************************************************
avtContract_p avtMultiresFilter::ModifyContract(avtContract_p contract)
......@@ -197,11 +207,13 @@ avtContract_p avtMultiresFilter::ModifyContract(avtContract_p contract)
nDims = dataAtts.GetSpatialDimension();
if (nDims == 2)
{
viewArea = viewArea2D;
for (int i = 0; i < 6; i++)
desiredFrustum[i] = desiredFrustum2D[i];
}
else
{
viewArea = viewArea3D;
for (int i = 0; i < 6; i++)
desiredFrustum[i] = desiredFrustum3D[i];
}
......@@ -217,6 +229,44 @@ avtContract_p avtMultiresFilter::ModifyContract(avtContract_p contract)
desiredFrustum[i] = extents[i];
}
//
// If the view area is invalid, set it from the desiredFrustum
// or extents. Note that those may also be invalid so we need
// to check for validity before calculating the viewArea to
// avoid an arithmetic overflow.
//
if (viewArea == DBL_MAX)
{
if (nDims == 2)
{
if (desiredFrustum[0] != DBL_MAX && desiredFrustum[1] != -DBL_MAX)
{
viewArea = (desiredFrustum[1] - desiredFrustum[0]) *
(desiredFrustum[3] - desiredFrustum[2]);
}
}
else
{
if (extents[0] != DBL_MAX && extents[1] != -DBL_MAX)
{
//
// We don't know the aspect ratio of the window and the
// zoom factor so assume they are both 1.
//
double ratio = 1.;
double imageZoom = 1.;
double parallelScale = 0.5 * sqrt((extents[1]-extents[0]) *
(extents[1]-extents[0]) +
(extents[3]-extents[2]) *
(extents[3]-extents[2]) +
(extents[5]-extents[4]) *
(extents[5]-extents[4]));
viewArea = (parallelScale * parallelScale * ratio) /
(imageZoom * imageZoom);
}
}
}
//
// If the format can do multires then add a multi resolution data
// selection to the contract and return.
......@@ -230,6 +280,7 @@ avtContract_p avtMultiresFilter::ModifyContract(avtContract_p contract)
if (dbmd->GetFormatCanDoMultires())
{
avtMultiresSelection *selection = new avtMultiresSelection;
selection->SetViewArea(viewArea);
selection->SetDesiredFrustum(desiredFrustum);
selection->SetDesiredCellSize(desiredCellSize);
selID = contract->GetDataRequest()->AddDataSelection(selection);
......@@ -291,7 +342,8 @@ avtContract_p avtMultiresFilter::ModifyContract(avtContract_p contract)
std::vector<int> domain_list;
std::back_insert_iterator<std::vector<int> > doms(domain_list);
double maxPatchDiag = 0.;
double viewSize = sqrt(viewArea);
double maxPatchSize = 0.;
int nVisible = 0;
for(int dom=0; dom < max_domain; ++dom)
{
......@@ -300,26 +352,23 @@ avtContract_p avtMultiresFilter::ModifyContract(avtContract_p contract)
std::vector<int> logicalExtents = sdn->GetDomainLogicalExtents(dom);
bool visible = true;
double patchDx, frustumDx;
double patchDiag = 0., frustumDiag = 0.;
double patchDx;
double patchVolume = 1.;
for (int i = 0; i < nDims; ++i)
{
patchDx = (extents[i*2+1] - extents[i*2]) / (topLogicalWidth[i] * ratios[i]);
patchDiag += patchDx * patchDx;
frustumDx = (desiredFrustum[i*2+1] - desiredFrustum[i*2]);
frustumDiag += frustumDx * frustumDx;
patchVolume *= patchDx;
double min, max;
min = double(logicalExtents[i]) * patchDx;
max = (double(logicalExtents[i+3]) + 1.) * patchDx;
if (max < desiredFrustum[i*2] || min > desiredFrustum[i*2+1])
visible = false;
}
patchDiag = sqrt(patchDiag);
frustumDiag = sqrt(frustumDiag);
double ratio = patchDiag / frustumDiag;
double patchSize = pow(patchVolume, 1. / double(nDims));
double ratio = patchSize / viewSize;
if (visible && ratio < desiredCellSize)
{
maxPatchDiag = patchDiag > maxPatchDiag ? patchDiag : maxPatchDiag;
maxPatchSize = patchSize > maxPatchSize ? patchSize : maxPatchSize;
}
if (ratio < desiredCellSize)
visible = false;
......@@ -335,7 +384,7 @@ avtContract_p avtMultiresFilter::ModifyContract(avtContract_p contract)
nVisible++;
}
}
actualCellSize = maxPatchDiag;
actualCellSize = maxPatchSize;
contract->GetDataRequest()->GetRestriction()->RestrictDomains(domain_list);
......
......@@ -68,12 +68,17 @@ class avtMultiresSelection;
// Eric Brugger, Thu Jan 2 15:15:54 PST 2014
// Add support for 3d multi resolution data selections.
//
// Eric Brugger, Wed Jan 8 16:58:34 PST 2014
// I added a ViewArea to the multi resolution data selection since the
// view frustum was insufficient in 3d.
//
// ****************************************************************************
class AVTFILTERS_API avtMultiresFilter : public avtDatasetToDatasetFilter
{
public:
avtMultiresFilter(double *, double *, double);
avtMultiresFilter(double, double,
double *, double *, double);
virtual ~avtMultiresFilter();
virtual const char *GetType(void) {return "avtMultiresFilter";};
......@@ -81,6 +86,9 @@ class AVTFILTERS_API avtMultiresFilter : public avtDatasetToDatasetFilter
protected:
int nDims;
double viewArea2D;
double viewArea3D;
double viewArea;
double desiredFrustum2D[6];
double desiredFrustum3D[6];
double desiredFrustum[6];
......
......@@ -44,7 +44,8 @@ avtMultiresSelection::DescriptionString()
{
char str[1024];
sprintf(str,
"avtMultiresSelection:%f_%f_%f_%f_%f_%f_%f_%f_%f_%f_%f_%f_%f_%f",
"avtMultiresSelection:%f_%f_%f_%f_%f_%f_%f_%f_%f_%f_%f_%f_%f_%f_%f",
viewArea,
desiredFrustum[0], desiredFrustum[1],
desiredFrustum[2], desiredFrustum[3],
desiredFrustum[4], desiredFrustum[5],
......
......@@ -61,6 +61,9 @@
// Creation: December 20, 2013
//
// Modifications:
// Eric Brugger, Wed Jan 8 16:41:12 PST 2014
// I added a ViewArea to the multi resolution data selection since the
// view frustum was insufficient in 3d.
//
// ****************************************************************************
......@@ -74,6 +77,10 @@ class PIPELINE_API avtMultiresSelection : public avtDataSelection
{ return "Multi Resolution Data Selection"; }
virtual std::string DescriptionString(void);
void SetViewArea(double area)
{ viewArea = area; }
double GetViewArea() const
{ return viewArea; }
void SetDesiredFrustum(const double frust[6]);
void GetDesiredFrustum(double frust[6]) const;
void SetActualFrustum(const double frust[6]);
......@@ -88,6 +95,7 @@ class PIPELINE_API avtMultiresSelection : public avtDataSelection
{ return actualCellSize; }
private:
double viewArea;
double desiredFrustum[6];
double actualFrustum[6];
double desiredCellSize;
......
......@@ -89,6 +89,10 @@ avtView3D::avtView3D()
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// Eric Brugger, Wed Jan 8 16:46:42 PST 2014
// I added windowValid to support adding a multi resolution display
// capability.
//
// ****************************************************************************
avtView3D &
......@@ -123,6 +127,7 @@ avtView3D::operator=(const avtView3D &vi)
shear[0] = vi.shear[0];
shear[1] = vi.shear[1];
shear[2] = vi.shear[2];
windowValid = vi.windowValid;
return *this;
}
......@@ -152,6 +157,10 @@ avtView3D::operator=(const avtView3D &vi)
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// Eric Brugger, Wed Jan 8 16:46:42 PST 2014
// I added windowValid to support adding a multi resolution display
// capability.
//
// ****************************************************************************
bool
......@@ -201,7 +210,8 @@ avtView3D::operator==(const avtView3D &vi)
imageZoom != vi.imageZoom || perspective != vi.perspective ||
eyeAngle != vi.eyeAngle ||
centerOfRotationSet != vi.centerOfRotationSet ||
axis3DScaleFlag != vi.axis3DScaleFlag)
axis3DScaleFlag != vi.axis3DScaleFlag ||
windowValid != vi.windowValid)
{
return false;
}
......@@ -239,6 +249,10 @@ avtView3D::operator==(const avtView3D &vi)
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// Eric Brugger, Wed Jan 8 16:46:42 PST 2014
// I added windowValid to support adding a multi resolution display
// capability.
//
// ****************************************************************************
void
......@@ -273,6 +287,7 @@ avtView3D::SetToDefault()
shear[0] = 0.;
shear[1] = 0.;
shear[2] = 1.;
windowValid = false;
}
// ****************************************************************************
......@@ -424,6 +439,10 @@ avtView3D::SetViewInfoFromView(avtViewInfo &viewInfo) const
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// Eric Brugger, Wed Jan 8 16:46:42 PST 2014
// I added windowValid to support adding a multi resolution display
// capability.
//
// ****************************************************************************
void
......@@ -450,6 +469,7 @@ avtView3D::SetFromView3DAttributes(const View3DAttributes *view3DAtts)
eyeAngle = view3DAtts->GetEyeAngle();
centerOfRotationSet = view3DAtts->GetCenterOfRotationSet();
axis3DScaleFlag = view3DAtts->GetAxis3DScaleFlag();
windowValid = view3DAtts->GetWindowValid();
}
// ****************************************************************************
......@@ -480,6 +500,10 @@ avtView3D::SetFromView3DAttributes(const View3DAttributes *view3DAtts)
// Jeremy Meredith, Mon Aug 2 14:23:08 EDT 2010
// Add shear for oblique projection support.
//
// Eric Brugger, Wed Jan 8 16:46:42 PST 2014
// I added windowValid to support adding a multi resolution display
// capability.
//
// ****************************************************************************
void
......@@ -501,6 +525,7 @@ avtView3D::SetToView3DAttributes(View3DAttributes *view3DAtts) const
view3DAtts->SetAxis3DScaleFlag(axis3DScaleFlag);
view3DAtts->SetAxis3DScales(axis3DScales);
view3DAtts->SetShear(shear);
view3DAtts->SetWindowValid(windowValid);
}
// ****************************************************************************
......
......@@ -83,6 +83,10 @@ class View3DAttributes;
// I added GetFrustum to add support for 3d multi resolution data
// selections.
//
// Eric Brugger, Wed Jan 8 16:44:28 PST 2014
// I added windowValid to support adding a multi resolution display
// capability.
//
// ****************************************************************************
struct AVTVIEW_API avtView3D
......@@ -103,6 +107,7 @@ struct AVTVIEW_API avtView3D
bool axis3DScaleFlag;
double axis3DScales[3];
double shear[3];
bool windowValid;
public:
avtView3D();
......
......@@ -86,6 +86,7 @@ void View3DAttributes::Init()
shear[0] = 0;
shear[1] = 0;
shear[2] = 1;
windowValid = false;
View3DAttributes::SelectAll();
}
......@@ -143,6 +144,7 @@ void View3DAttributes::Copy(const View3DAttributes &obj)
shear[1] = obj.shear[1];
shear[2] = obj.shear[2];
windowValid = obj.windowValid;
View3DAttributes::SelectAll();
}
......@@ -350,7 +352,8 @@ View3DAttributes::operator == (const View3DAttributes &obj) const
centerOfRotation_equal &&
(axis3DScaleFlag == obj.axis3DScaleFlag) &&
axis3DScales_equal &&
shear_equal);
shear_equal &&
(windowValid == obj.windowValid));
}
// ****************************************************************************
......@@ -510,6 +513,7 @@ View3DAttributes::SelectAll()
Select(ID_axis3DScaleFlag, (void *)&axis3DScaleFlag);
Select(ID_axis3DScales, (void *)axis3DScales, 3);
Select(ID_shear, (void *)shear, 3);
Select(ID_windowValid, (void *)&windowValid);
}
///////////////////////////////////////////////////////////////////////////////
......@@ -638,6 +642,12 @@ View3DAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool force
node->AddNode(new DataNode("shear", shear, 3));
}
if(completeSave || !FieldsEqual(ID_windowValid, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("windowValid", windowValid));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
......@@ -706,6 +716,8 @@ View3DAttributes::SetFromNode(DataNode *parentNode)
SetAxis3DScales(node->AsDoubleArray());
if((node = searchNode->GetNode("shear")) != 0)
SetShear(node->AsDoubleArray());
if((node = searchNode->GetNode("windowValid")) != 0)
SetWindowValid(node->AsBool());
}
///////////////////////////////////////////////////////////////////////////////
......@@ -837,6 +849,13 @@ View3DAttributes::SetShear(const double *shear_)
Select(ID_shear, (void *)shear, 3);
}
void
View3DAttributes::SetWindowValid(bool windowValid_)
{
windowValid = windowValid_;
Select(ID_windowValid, (void *)&windowValid);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -979,6 +998,12 @@ View3DAttributes::GetShear()
return shear;
}
bool
View3DAttributes::GetWindowValid() const
{
return windowValid;
}
///////////////////////////////////////////////////////////////////////////////
// Select property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -1065,6 +1090,7 @@ View3DAttributes::GetFieldName(int index) const
case ID_axis3DScaleFlag: return "axis3DScaleFlag";
case ID_axis3DScales: return "axis3DScales";
case ID_shear: return "shear";
case ID_windowValid: return "windowValid";
default: return "invalid index";
}
}
......@@ -1105,6 +1131,7 @@ View3DAttributes::GetFieldType(int index) const
case ID_axis3DScaleFlag: return FieldType_bool;
case ID_axis3DScales: return FieldType_doubleArray;
case ID_shear: return FieldType_doubleArray;
case ID_windowValid: return FieldType_bool;
default: return FieldType_unknown;
}
}
......@@ -1145,6 +1172,7 @@ View3DAttributes::GetFieldTypeName(int index) const
case ID_axis3DScaleFlag: return "bool";
case ID_axis3DScales: return "doubleArray";
case ID_shear: return "doubleArray";
case ID_windowValid: return "bool";
default: return "invalid index";
}
}
......@@ -1286,6 +1314,11 @@ View3DAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = shear_equal;
}
break;
case ID_windowValid:
{ // new scope
retval = (windowValid == obj.windowValid);
}
break;
default: retval = false;
}
......
......@@ -110,6 +110,7 @@ public:
void SetAxis3DScaleFlag(bool axis3DScaleFlag_);
void SetAxis3DScales(const double *axis3DScales_);
void SetShear(const double *shear_);
void SetWindowValid(bool windowValid_);
// Property getting methods
const double *GetViewNormal() const;
......@@ -135,6 +136,7 @@ public:
double *GetAxis3DScales();
const double *GetShear() const;
double *GetShear();
bool GetWindowValid() const;
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
......@@ -169,6 +171,7 @@ public:
ID_axis3DScaleFlag,
ID_axis3DScales,
ID_shear,
ID_windowValid,
ID__LAST
};
......@@ -189,11 +192,12 @@ private:
bool axis3DScaleFlag;
double axis3DScales[3];
double shear[3];
bool windowValid;
// Static class format string for type map.
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define VIEW3DATTRIBUTES_TMFS "DDDddddDdbdbDbDD"
#define VIEW3DATTRIBUTES_TMFS "DDDddddDdbdbDbDDb"
#endif
......@@ -61,6 +61,9 @@
0.000000
1.000000
</Field>
<Field name="windowValid" label="windowValid" type="bool">
false
</Field>
<Function name="RotateAxis" user="true" member="true">
</Function>
<Function name="ResetView" user="true" member="true">
......
This diff is collapsed.
......@@ -57,6 +57,10 @@
// Programmer: brugger -- generated by xml2avt
// Creation: Fri Dec 20 12:20:07 PDT 2013
//
// Modifications:
// Eric Brugger, Wed Jan 8 17:08:02 PST 2014
// I modified the reader to also create 3d meshes.
//
// ****************************************************************************
class avtMRTestFileFormat : public avtSTMDFileFormat
......@@ -81,15 +85,23 @@ class avtMRTestFileFormat : public avtSTMDFileFormat
protected:
std::string filename;
int meshNx, meshNy;
double meshXmin, meshXmax, meshYmin, meshYmax;
int coarseNx, coarseNy;
int meshNx, meshNy, meshNz;
double meshXmin, meshXmax, meshYmin, meshYmax,
meshZmin, meshZmax;
int coarseNx, coarseNy, coarseNz;
int maxLevel2d, maxLevel3d;
std::vector<avtDataSelection_p> selectionsList;
std::vector<bool> *selectionsApplied;
void CalculateMesh(double &, double &,
void CalculateMesh2d(double &, double &,
double &, double &, int &, int &);
void CalculateMesh3d(double &, double &,
double &, double &, double &, double &,
int &, int &, int &);
vtkDataSet *GetMesh2d();
vtkDataSet *GetMesh3d();
};
......
......@@ -1038,6 +1038,10 @@ NetworkManager::StartNetwork(const std::string &format,
// Eric Brugger, Thu Jan 2 15:18:21 PST 2014
// I added support for 3d multi resolution data selections.
//
// Eric Brugger, Wed Jan 8 17:03:56 PST 2014
// I added a ViewArea to the multi resolution data selection since the
// view frustum was insufficient in 3d.
//
// ****************************************************************************
void
......@@ -1132,11 +1136,13 @@ NetworkManager::StartNetwork(const std::string &format,
VisWindow *visWin = viswinMap[windowID].viswin;
if (visWin->GetMultiresolutionMode())
{
// Get the 2D frustum.
// Get the 2D view area and frustum.
double area2D;
double frustum2D[6];
const avtView2D view2D = visWin->GetView2D();
if (!view2D.windowValid)
{
area2D = DBL_MAX;
frustum2D[0] = DBL_MAX;
frustum2D[1] = -DBL_MAX;
frustum2D[2] = DBL_MAX;
......@@ -1144,26 +1150,44 @@ NetworkManager::StartNetwork(const std::string &format,
}
else
{
area2D = (view2D.window[1] - view2D.window[0]) *
(view2D.window[3] - view2D.window[2]);
frustum2D[0] = view2D.window[0];
frustum2D[1] = view2D.window[1];
frustum2D[2] = view2D.window[2];
frustum2D[3] = view2D.window[3];
}
// Get the 3D frustum.
// Get the 3D view area and frustum.
double area3D;
double frustum3D[6];
const avtView3D view3D = visWin->GetView3D();
int width, height;
visWin->GetSize(width, height);
double aspect = double(width) / double(height);
view3D.GetFrustum(frustum3D, aspect);
if (!view3D.windowValid)
{
area3D = DBL_MAX;
frustum3D[0] = DBL_MAX;
frustum3D[1] = -DBL_MAX;
frustum3D[2] = DBL_MAX;
frustum3D[3] = -DBL_MAX;
frustum3D[4] = DBL_MAX;
frustum3D[5] = -DBL_MAX;
}
else
{
int width, height;
visWin->GetSize(width, height);
double aspect = double(width) / double(height);
area3D = (view3D.parallelScale * view3D.parallelScale * aspect) /
(view3D.imageZoom * view3D.imageZoom);
view3D.GetFrustum(frustum3D, aspect);
}
// Get the cell size.
double cellSize = visWin->GetMultiresolutionCellSize();
// Add the multires filter.
avtMultiresFilter *f2 = new avtMultiresFilter(frustum2D, frustum3D,
cellSize);
avtMultiresFilter *f2 = new avtMultiresFilter(area2D, area3D,
frustum2D, frustum3D, cellSize);
filt = new NetnodeFilter(f2, "MultiresFilter");
filt->GetInputNodes().push_back(input);
workingNet->AddNode(filt);
......
......@@ -56,7 +56,7 @@ package llnl.visit;
public class View3DAttributes extends AttributeSubject
{
private static int View3DAttributes_numAdditionalAtts = 16;
private static int View3DAttributes_numAdditionalAtts = 17;
public View3DAttributes()
{
......@@ -98,6 +98,7 @@ public class View3DAttributes extends AttributeSubject
shear[0] = 0;
shear[1] = 0;
shear[2] = 1;
windowValid = false;
}
public View3DAttributes(int nMoreFields)
......@@ -140,6 +141,7 @@ public class View3DAttributes extends AttributeSubject
shear[0] = 0;
shear[1] = 0;
shear[2] = 1;
windowValid = false;
}
public View3DAttributes(View3DAttributes obj)
......@@ -191,6 +193,7 @@ public class View3DAttributes extends AttributeSubject
shear[1] = obj.shear[1];
shear[2] = obj.shear[2];
windowValid = obj.windowValid;
SelectAll();
}
......@@ -260,7 +263,8 @@ public class View3DAttributes extends AttributeSubject
centerOfRotation_equal &&
(axis3DScaleFlag == obj.axis3DScaleFlag) &&
axis3DScales_equal &&
shear_equal);
shear_equal &&
(windowValid == obj.windowValid));
}
// Property setting methods
......@@ -428,6 +432,12 @@ public class View3DAttributes extends AttributeSubject
Select(15);
}
public void SetWindowValid(boolean windowValid_)
{
windowValid = windowValid_;
Select(16);
}
// Property getting methods
public double[] GetViewNormal() { return viewNormal; }
public double[] GetFocus() { return focus; }
......@@ -445,6 +455,7 @@ public class View3DAttributes extends AttributeSubject
public boolean GetAxis3DScaleFlag() { return axis3DScaleFlag; }
public double[] GetAxis3DScales() { return axis3DScales; }
public double[] GetShear() { return shear; }
public boolean GetWindowValid() { return windowValid; }
// Write and read methods.
public void WriteAtts(CommunicationBuffer buf)
......@@ -481,6 +492,8 @@ public class View3DAttributes extends AttributeSubject
buf.WriteDoubleArray(axis3DScales);
if(WriteSelect(15, buf))
buf.WriteDoubleArray(shear);
if(WriteSelect(16, buf))
buf.WriteBool(windowValid);
}
public void ReadAtts(int index, CommunicationBuffer buf)
......@@ -535,6 +548,9 @@ public class View3DAttributes extends AttributeSubject
case 15:
SetShear(buf.ReadDoubleArray());
break;
case 16:
SetWindowValid(buf.ReadBool());
break;
}
}
......@@ -557,6 +573,7 @@ public class View3DAttributes extends AttributeSubject
str = str + boolToString("axis3DScaleFlag", axis3DScaleFlag, indent) + "\n";
str = str + doubleArrayToString("axis3DScales", axis3DScales, indent) + "\n";
str = str + doubleArrayToString("shear", shear, indent) + "\n";
str = str + boolToString("windowValid", windowValid, indent) + "\n";
return str;
}
......@@ -578,5 +595,6 @@ public class View3DAttributes extends AttributeSubject
private boolean axis3DScaleFlag;
private double[] axis3DScales;
private double[] shear;
private boolean windowValid;
}
......@@ -10032,6 +10032,10 @@ ViewerPlotList::PermitsLogViewScaling(WINDOW_MODE wm)
// Eric Brugger, Thu Jan 2 15:19:29 PST 2014
// I added support for 3d multi resolution data selections.
//
// Eric Brugger, Wed Jan 8 17:06:16 PST 2014
// I added a ViewArea to the multi resolution data selection since the
// view frustum was insufficient in 3d.
//
// ****************************************************************************
bool
......@@ -10059,10 +10063,13 @@ ViewerPlotList::ShouldRefineData(double smallestCellSize) const
cellSize = atts.GetMultiresCellSize();
}
double viewArea;
double fustrum[6];
if (window->GetWindowMode() == WINMODE_2D)
{
const avtView2D &view2D = window->GetView2D();
viewArea = (view2D.window[1] - view2D.window[0]) *
(view2D.window[3] - view2D.window[2]);
fustrum[0] = view2D.window[0];
fustrum[1] = view2D.window[1];
fustrum[2] = view2D.window[2];
......@@ -10074,6 +10081,8 @@ ViewerPlotList::ShouldRefineData(double smallestCellSize) const
int width, height;
window->GetSize(width, height);
double aspect = double(width) / double(height);
viewArea = (view3D.parallelScale * view3D.parallelScale * aspect) /
(view3D.imageZoom * view3D.imageZoom);
view3D.GetFrustum(fustrum, aspect);
}
else
......@@ -10082,20 +10091,17 @@ ViewerPlotList::ShouldRefineData(double smallestCellSize) const
}