An update will be applied today, Nov30th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit 12245f75 authored by T.J. Corona's avatar T.J. Corona Committed by Kitware Robot
Browse files

Merge topic 'mesh-json-points'

c10e0ac1

 Mesh: ship point information via JSON.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: default avatarRobert Maynard <robert.maynard@kitware.com>
Merge-request: !515
parents a88bc921 c10e0ac1
......@@ -305,10 +305,28 @@ smtk::mesh::HandleRange Interface::getCells(const smtk::mesh::HandleRange& meshs
return cells;
}
//get all cells held by this range handle of a given dimension
smtk::mesh::HandleRange Interface::getPoints(const smtk::mesh::HandleRange&) const
{
return smtk::mesh::HandleRange();
//get all points held by this range handle
smtk::mesh::HandleRange Interface::getPoints(const smtk::mesh::HandleRange& cells) const
{
// We don't support modifying operations via the JSON interface (like meshset
// construction, point merging, etc.); in keeping with this paradigm, the only
// point ranges that can be queried are unions of points associated with mesh
// sets that have already been computed using an alternate backend (e.g.
// Moab). Any queries involving cells that are not the union of cell sets
// contained within the meshInfo vector yield a null return value. This is
// sufficient for relaying server-side information about points to the client.
smtk::mesh::HandleRange points;
smtk::mesh::HandleRange cellsToVisit = cells;
for(const auto& m : this->m_meshInfo)
{
if (cellsToVisit.contains(m.cells()))
{
points.merge(m.points());
cellsToVisit = subtract(cellsToVisit, m.cells());
}
}
return cellsToVisit.empty() ? points : smtk::mesh::HandleRange();
}
bool Interface::getCoordinates(const smtk::mesh::HandleRange&,double*) const
......
......@@ -81,6 +81,11 @@ smtk::mesh::HandleRange MeshInfo::cells(smtk::mesh::DimensionType dim) const
return this->m_cells.subset_by_dimension( static_cast<int>(dim) );
}
smtk::mesh::HandleRange MeshInfo::points() const
{
return this->m_points;
}
bool MeshInfo::has(const smtk::mesh::Domain &d) const
{
return std::find(this->m_domains.begin(),
......
......@@ -44,6 +44,8 @@ public:
smtk::mesh::HandleRange cells(const smtk::mesh::CellTypes& cellTypes) const;
smtk::mesh::HandleRange cells(smtk::mesh::DimensionType dim) const;
smtk::mesh::HandleRange points() const;
bool has(const smtk::mesh::Domain &d) const;
bool has(const smtk::mesh::Dirichlet &bc) const;
bool has(const smtk::mesh::Neumann &bc) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment