Skip to content

Commit

Permalink
fix bug due to cleaning of vertex height info by storing height in attr
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Commandeur committed Nov 2, 2018
1 parent a521631 commit 5e0411a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/TopoFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ bool Flat::add_elevation_point(Point2& p, double z, float radius, int lasclass,
}

int Flat::get_height() {
return get_vertex_elevation(0, 0);
return _height_top;
}

bool Flat::lift_percentile(float percentile) {
Expand All @@ -1185,6 +1185,7 @@ if (_zvaluesinside.empty() == false) {
std::nth_element(_zvaluesinside.begin(), _zvaluesinside.begin() + (_zvaluesinside.size() * percentile), _zvaluesinside.end());
z = _zvaluesinside[_zvaluesinside.size() * percentile];
}
this->_height_top = z;
this->lift_all_boundary_vertices_same_height(z);
return true;
}
Expand Down
1 change: 1 addition & 0 deletions src/TopoFeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class Flat: public TopoFeature {
virtual void cleanup_elevations() = 0;
protected:
std::vector<int> _zvaluesinside;
int _height_top;
bool lift_percentile(float percentile);
};

Expand Down

0 comments on commit 5e0411a

Please sign in to comment.