Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2899 Problems switching barb or flow renderer between 2D and 3D variables #2960

Merged
merged 8 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/vaporgui/PRegionSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void PRegionSelector1D::sliderValueChanged(float v0, float v1)
{
Box *box = getBox();

vector<double> min, max;
CoordType min, max;
box->GetExtents(min, max);
min[_dim] = v0;
max[_dim] = v1;
Expand Down
1 change: 1 addition & 0 deletions include/vapor/Box.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class PARAMS_API Box : public ParamsBase {
//!
//
virtual void SetExtents(const vector<double> &minExt, const vector<double> &maxExt);
virtual void SetExtents(const VAPoR::CoordType &minExt, const VAPoR::CoordType &maxExt);

//! Get the box min and max extents
//!
Expand Down
12 changes: 11 additions & 1 deletion lib/params/Box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ void Box::SetExtents(const vector<double> &minExt, const vector<double> &maxExt)
SetValueDoubleVec(m_extentsTag, "Set box extents", exts);
}

void Box::SetExtents(const VAPoR::CoordType &minExt, const VAPoR::CoordType &maxExt)
{
vector<double> mind(3, 0), maxd(3, 0);
for (int i = 0; i < minExt.size(); i++) {
mind[i] = minExt[i];
maxd[i] = maxExt[i];
}
SetExtents(mind, maxd);
}

void Box::GetExtents(vector<double> &minExt, vector<double> &maxExt) const
{
minExt.clear();
Expand Down Expand Up @@ -112,7 +122,7 @@ void Box::GetExtents(VAPoR::CoordType &minExt, VAPoR::CoordType &maxExt) const
//
vector<double> exts = GetValueDoubleVec(m_extentsTag, defaultv);

int n = IsPlanar() ? 2 : 3;
int n = 3;
for (int i = 0; i < n; i++) minExt[i] = exts[i];
for (int i = 0; i < n; i++) maxExt[i] = exts[i + 3];
}
Expand Down
3 changes: 0 additions & 3 deletions lib/vdc/DataMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1041,12 +1041,10 @@ void DataMgr::_setupCoordVecsHelper(string data_varname, const DimsType &data_di
VAssert(order >= 0 && order <= 1);

if (coord_dims.size() == 1) {

coord_dimlens[0] = (data_dimlens[order]);
coord_bmin[0] = (data_bmin[order]);
coord_bmax[0] = (data_bmax[order]);
} else {

coord_dimlens[0] = (data_dimlens[0]);
coord_bmin[0] = (data_bmin[0]);
coord_bmax[0] = (data_bmax[0]);
Expand All @@ -1059,7 +1057,6 @@ void DataMgr::_setupCoordVecsHelper(string data_varname, const DimsType &data_di
VAssert(order >= 0 && order <= 2);

if (coord_dims.size() == 1) {

coord_dimlens[0] = (data_dimlens[order]);
coord_bmin[0] = (data_bmin[order]);
coord_bmax[0] = (data_bmax[order]);
Expand Down