Commit 3671e1eb authored by T.J. Corona's avatar T.J. Corona

Introduce smtk::mesh::Component

The current pattern in SMTK is to have resources and components. To
retrofit smtk::mesh to fit this pattern, we introduce
smtk::mesh::Component, a lightweight, shared object that provides
access to a meshset.
parent f20ed63d
# Introduce smtk::mesh::Component
To adhere to the Resource/Component paradigm in SMTK 3.0, we have
introduced the lightweight class smtk::mesh::Component, which
facilitates the ability to pass meshsets as component items in an
attribute.
### User-facing changes
`smtk::mesh::Component` is now used to send/retrieve meshsets to/from
attributes.
......@@ -4,6 +4,7 @@ set(meshSrcs
core/CellField.cxx
core/CellTypes.cxx
core/Collection.cxx
core/Component.cxx
core/ForEachTypes.cxx
core/Handle.cxx
core/MeshSet.cxx
......@@ -46,7 +47,6 @@ set(meshSrcs
operators/UndoElevateMesh.cxx
operators/WriteMesh.cxx
resource/MeshComponent.cxx
resource/Registrar.cxx
utility/ApplyToMesh.cxx
......@@ -63,6 +63,7 @@ set(meshHeaders
core/CellTraits.h
core/CellTypes.h
core/Collection.h
core/Component.h
core/DimensionTypes.h
core/FieldTypes.h
core/ForEachTypes.h
......@@ -101,7 +102,6 @@ set(meshHeaders
operators/UndoElevateMesh.h
operators/WriteMesh.h
resource/MeshComponent.h
resource/PropertyData.h
resource/Registrar.h
......
......@@ -10,7 +10,7 @@
#include "smtk/mesh/core/Collection.h"
#include "smtk/mesh/resource/MeshComponent.h"
#include "smtk/mesh/core/Component.h"
#include "smtk/mesh/moab/Interface.h"
......@@ -105,14 +105,8 @@ Collection::~Collection()
smtk::resource::ComponentPtr Collection::find(const smtk::common::UUID& compId) const
{
const smtk::mesh::InterfacePtr& iface = m_internals->mesh_iface();
smtk::mesh::Handle handle;
if (iface->findById(m_internals->mesh_root_handle(), compId, handle))
{
return smtk::mesh::MeshComponent::create(this->shared_from_this(), handle);
}
return smtk::resource::ComponentPtr();
return std::static_pointer_cast<smtk::resource::Component>(
Component::create(std::const_pointer_cast<smtk::mesh::Collection>(shared_from_this()), compId));
}
std::function<bool(const resource::ComponentPtr&)> Collection::queryOperation(
......
//=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
#include "smtk/mesh/core/Component.h"
#include "smtk/common/UUIDGenerator.h"
namespace smtk
{
namespace mesh
{
Component::Component(const smtk::mesh::CollectionPtr& collection, const smtk::common::UUID& id)
: m_collection(collection)
, m_id(id)
{
}
Component::Component(const smtk::mesh::MeshSet& meshset)
: Component(meshset.collection(), meshset.id())
{
if (m_id == smtk::common::UUID::null())
{
m_id = smtk::common::UUIDGenerator::instance().random();
const_cast<smtk::mesh::MeshSet&>(meshset).setId(m_id);
}
}
std::shared_ptr<Component> Component::create(
const smtk::mesh::CollectionPtr& collection, const smtk::common::UUID& id)
{
std::shared_ptr<smtk::resource::Component> shared(new Component(collection, id));
return std::static_pointer_cast<smtk::mesh::Component>(shared);
}
std::shared_ptr<Component> Component::create(const smtk::mesh::MeshSet& meshset)
{
std::shared_ptr<smtk::resource::Component> shared(new Component(meshset));
return std::static_pointer_cast<smtk::mesh::Component>(shared);
}
const smtk::resource::ResourcePtr Component::resource() const
{
return std::static_pointer_cast<smtk::resource::Resource>(m_collection.lock());
}
const smtk::mesh::MeshSet Component::mesh() const
{
if (auto collection = m_collection.lock())
{
const smtk::mesh::InterfacePtr& iface = collection->interface();
smtk::mesh::Handle handle;
if (iface->findById(iface->getRoot(), m_id, handle))
{
return smtk::mesh::MeshSet(collection, handle);
}
}
return smtk::mesh::MeshSet();
}
smtk::mesh::MeshSet Component::mesh()
{
if (auto collection = m_collection.lock())
{
const smtk::mesh::InterfacePtr& iface = collection->interface();
smtk::mesh::Handle handle;
if (iface->findById(iface->getRoot(), m_id, handle))
{
return smtk::mesh::MeshSet(collection, handle);
}
}
return smtk::mesh::MeshSet();
}
}
}
//=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
#ifndef __smtk_mesh_Component_h
#define __smtk_mesh_Component_h
#include "smtk/CoreExports.h"
#include "smtk/PublicPointerDefs.h"
#include "smtk/TupleTraits.h"
#include "smtk/resource/Component.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/mesh/core/MeshSet.h"
namespace smtk
{
namespace mesh
{
class Component;
typedef std::vector<smtk::mesh::Component> ComponentList;
typedef std::set<smtk::mesh::Component> Components;
/// A lightweight object for representing meshset information as a resource
/// component. This is useful for constructing links between meshsets and other
/// resources/components and for representing meshsets within smtk's attribute
/// system.
class SMTKCORE_EXPORT Component : public smtk::resource::Component
{
protected:
Component(const smtk::mesh::CollectionPtr&, const smtk::common::UUID&);
Component(const smtk::mesh::MeshSet&);
public:
smtkTypeMacro(Component);
smtkSharedFromThisMacro(smtk::resource::Component);
/// Construct a mesh component corresponding to a meshset from the input
/// collection and id. No checking is performed that the collection has a
/// meshset with this id; if this is the case, the resolved mesh() will return
/// a default-constructed (and invalid) mesh.
static std::shared_ptr<Component> create(
const smtk::mesh::CollectionPtr&, const smtk::common::UUID&);
/// Construct a mesh component correpsonding to the input meshset.
static std::shared_ptr<Component> create(const smtk::mesh::MeshSet&);
/// Access the component's resource.
const smtk::resource::ResourcePtr resource() const override;
/// Access the component's id.
const smtk::common::UUID& id() const override { return m_id; }
/// Set the component's id. No checking is performed that the collection has a
/// meshset with this id; if this is the case, the resolved mesh() will return
/// a default-constructed (and invalid) mesh.
bool setId(const smtk::common::UUID& myID) override
{
m_id = myID;
return true;
}
/// Access the meshset represented by this component.
const smtk::mesh::MeshSet mesh() const;
smtk::mesh::MeshSet mesh();
private:
std::weak_ptr<smtk::mesh::Collection> m_collection;
smtk::common::UUID m_id;
};
} // namespace mesh
} // namespace smtk
#endif
......@@ -1026,10 +1026,22 @@ bool Interface::findById(
tag::QueryIdTag mtag(id, this->moabInterface());
::moab::ErrorCode rval;
rval = m_iface->get_entities_by_type_and_tag(
root, ::moab::MBENTITYSET, mtag.moabTagPtr(), mtag.moabTagValuePtr(), 1, result);
if (rval != ::moab::MB_SUCCESS || result.size() != 1)
{
// The above call does not check the root if it has the tag value. Let's do
// that before we give up.
smtk::common::UUID rootId =
detail::computeDenseOpaqueTagValue<smtk::common::UUID>(mtag, root, this->moabInterface());
if (rootId != smtk::common::UUID::null())
{
meshset = root;
return true;
}
return false;
}
meshset = *result.begin();
......
......@@ -17,11 +17,13 @@
#include "smtk/attribute/GroupItem.h"
#include "smtk/attribute/IntItem.h"
#include "smtk/attribute/MeshItem.h"
#include "smtk/attribute/ReferenceItem.h"
#include "smtk/attribute/StringItem.h"
#include "smtk/attribute/VoidItem.h"
#include "smtk/mesh/core/CellField.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/mesh/core/Component.h"
#include "smtk/mesh/core/MeshSet.h"
#include "smtk/mesh/core/PointField.h"
......@@ -122,13 +124,6 @@ bool ElevateMesh::ableToOperate()
{
return false;
}
smtk::attribute::MeshItem::Ptr meshItem = this->parameters()->findMesh("mesh");
if (!meshItem || meshItem->numberOfValues() == 0)
{
return false;
}
return true;
}
......@@ -138,7 +133,9 @@ ElevateMesh::Result ElevateMesh::operateInternal()
smtk::attribute::StringItem::Ptr inputDataItem = this->parameters()->findString("input data");
// Access the mesh to elevate
smtk::attribute::MeshItem::Ptr meshItem = this->parameters()->findMesh("mesh");
smtk::attribute::ReferenceItem::Ptr meshItem = this->parameters()->associations();
smtk::mesh::MeshSet meshset = meshItem->valueAs<smtk::mesh::Component>()->mesh();
smtk::mesh::Collection::Ptr collection = meshset.collection();
// Access the string describing the interpolation scheme
smtk::attribute::StringItem::Ptr interpolationSchemeItem =
......@@ -207,7 +204,7 @@ ElevateMesh::Result ElevateMesh::operateInternal()
{
// Compute the radial average function
interpolation = radialAverageFrom<smtk::model::AuxiliaryGeometry>(
auxGeo, radiusItem->value(), prefilter, meshItem->value().collection()->interface());
auxGeo, radiusItem->value(), prefilter, collection->interface());
}
else if (interpolationSchemeItem->value() == "inverse distance weighting")
{
......@@ -231,7 +228,7 @@ ElevateMesh::Result ElevateMesh::operateInternal()
{
// Compute the radial average function
interpolation = radialAverageFrom<std::string>(
fileName, radiusItem->value(), prefilter, meshItem->value().collection()->interface());
fileName, radiusItem->value(), prefilter, collection->interface());
}
else if (interpolationSchemeItem->value() == "inverse distance weighting")
{
......@@ -273,8 +270,7 @@ ElevateMesh::Result ElevateMesh::operateInternal()
if (interpolationSchemeItem->value() == "radial average")
{
interpolation = smtk::mesh::RadialAverage(
smtk::mesh::Collection::create(meshItem->value().collection()->interface()), pointcloud,
radiusItem->value());
smtk::mesh::Collection::create(collection->interface()), pointcloud, radiusItem->value());
}
else if (interpolationSchemeItem->value() == "inverse distance weighting")
{
......@@ -364,8 +360,6 @@ ElevateMesh::Result ElevateMesh::operateInternal()
// Access the attribute associated with the modified meshes
Result result = this->createResult(smtk::operation::Operation::Outcome::SUCCEEDED);
smtk::attribute::MeshItem::Ptr modifiedMeshes = result->findMesh("mesh_modified");
modifiedMeshes->setNumberOfValues(meshItem->numberOfValues());
// Access the attribute associated with the modified model
smtk::attribute::ComponentItem::Ptr modified = result->findComponent("modified");
......@@ -377,11 +371,12 @@ ElevateMesh::Result ElevateMesh::operateInternal()
// apply the interpolator to the meshes and populate the result attributes
for (std::size_t i = 0; i < meshItem->numberOfValues(); i++)
{
smtk::mesh::MeshSet mesh = meshItem->value(i);
auto meshComponent = meshItem->valueAs<smtk::mesh::Component>(i);
auto mesh = meshComponent->mesh();
smtk::mesh::utility::applyWarp(fn, mesh, true);
modifiedMeshes->appendValue(mesh);
modified->appendObjectValue(meshComponent);
smtk::model::EntityRefArray entities;
bool entitiesAreValid = mesh.modelEntities(entities);
......
......@@ -16,6 +16,11 @@
data set, and it computes new z-coordinates at each mesh node
as a radial average of the scalar values in the external data set.
</DetailedDescription>
<AssociationsDef Name="mesh" NumberOfRequiredValues="1" Extensible="false">
<Accepts><Resource Name="smtk::mesh::Collection" Filter="meshset"/></Accepts>
</AssociationsDef>
<ItemDefinitions>
<String Name="input data" Label="Input Data">
......@@ -110,10 +115,6 @@
</DiscreteInfo>
</String>
<MeshEntity Name="mesh" Label="Mesh" NumberOfRequiredValues="1" Extensible="true" >
<BriefDescription>The mesh to elevate.</BriefDescription>
</MeshEntity>
<String Name="interpolation scheme" Label="Interpolation Scheme">
<BriefDescription>The interpolation scheme to apply to the input data</BriefDescription>
......@@ -260,7 +261,6 @@
<include href="smtk/operation/Result.xml"/>
<AttDef Type="result(elevate mesh)" BaseType="result">
<ItemDefinitions>
<MeshEntity Name="mesh_modified" NumberOfRequiredValues="0" Extensible="true" AdvanceLevel="11"/>
<Component Name="tess_changed" NumberOfRequiredValues="0"
Extensible="true" AdvanceLevel="11">
<Accepts><Resource Name="smtk::model::Resource" Filter=""/></Accepts>
......
//=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
#ifndef pybind_smtk_mesh_Component_h
#define pybind_smtk_mesh_Component_h
#include <pybind11/pybind11.h>
#include "smtk/mesh/core/Component.h"
#include "smtk/common/UUID.h"
#include "smtk/common/pybind11/PybindUUIDTypeCaster.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/resource/Component.h"
namespace py = pybind11;
PySharedPtrClass< smtk::mesh::Component, smtk::resource::Component > pybind11_init_smtk_mesh_Component(py::module &m)
{
PySharedPtrClass< smtk::mesh::Component, smtk::resource::Component > instance(m, "Component");
instance
.def(py::init<::smtk::mesh::Component const &>())
.def("deepcopy", (smtk::mesh::Component & (smtk::mesh::Component::*)(::smtk::mesh::Component const &)) &smtk::mesh::Component::operator=)
.def("shared_from_this", (std::shared_ptr<smtk::mesh::Component> (smtk::mesh::Component::*)()) &smtk::mesh::Component::shared_from_this)
.def("shared_from_this", (std::shared_ptr<const smtk::mesh::Component> (smtk::mesh::Component::*)() const) &smtk::mesh::Component::shared_from_this)
.def_static("create", (std::shared_ptr<smtk::mesh::Component> (*)(const smtk::mesh::CollectionPtr&, const smtk::common::UUID&)) &smtk::mesh::Component::create, py::arg("collection"), py::arg("id"))
.def_static("create", (std::shared_ptr<smtk::mesh::Component> (*)(const smtk::mesh::MeshSet&)) &smtk::mesh::Component::create, py::arg("meshset"))
.def("resource", &smtk::mesh::Component::resource)
.def("mesh", (smtk::mesh::MeshSet (smtk::mesh::Component::*)()) &smtk::mesh::Component::mesh)
.def_static("CastTo", [](const std::shared_ptr<smtk::resource::Component> i) {
return std::dynamic_pointer_cast<smtk::mesh::Component>(i);
})
;
return instance;
}
#endif
......@@ -27,6 +27,7 @@ using PySharedPtrClass = py::class_<T, std::shared_ptr<T>, Args...>;
#include "PybindCellSet.h"
#include "PybindCellTypes.h"
#include "PybindCollection.h"
#include "PybindComponent.h"
#include "PybindDimensionTypes.h"
#include "PybindExtractMeshConstants.h"
#include "PybindExtractTessellation.h"
......@@ -156,6 +157,7 @@ PYBIND11_MODULE(_smtkPybindMesh, mesh)
PySharedPtrClass< smtk::mesh::Neumann > smtk_mesh_Neumann = pybind11_init_smtk_mesh_Neumann(mesh, smtk_mesh_IntegerTag);
PySharedPtrClass< smtk::mesh::UUIDTag > smtk_mesh_UUIDTag = pybind11_init_smtk_mesh_UUIDTag(mesh, smtk_mesh_OpaqueTag_16_);
PySharedPtrClass< smtk::mesh::Model > smtk_mesh_Model = pybind11_init_smtk_mesh_Model(mesh, smtk_mesh_UUIDTag);
PySharedPtrClass< smtk::mesh::Component > smtk_mesh_Component = pybind11_init_smtk_mesh_Component(mesh);
PySharedPtrClass< smtk::mesh::DeleteMesh, smtk::operation::XMLOperation > smtk_mesh_DeleteMesh = pybind11_init_smtk_mesh_DeleteMesh(mesh);
PySharedPtrClass< smtk::mesh::ElevateMesh, smtk::operation::XMLOperation > smtk_mesh_ElevateMesh = pybind11_init_smtk_mesh_ElevateMesh(mesh);
......
//=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
#include "smtk/mesh/resource/MeshComponent.h"
#include "smtk/mesh/core/Collection.h"
namespace smtk
{
namespace mesh
{
MeshComponent::MeshComponent(smtk::mesh::MeshSet meshset)
: smtk::resource::Component()
, m_meshset(meshset)
{
}
MeshComponent::MeshComponent(const smtk::common::UUID& id, smtk::mesh::MeshSet meshset)
: smtk::resource::Component()
, m_meshset(meshset)
{
this->setId(id);
}
const smtk::resource::ResourcePtr MeshComponent::resource() const
{
return std::dynamic_pointer_cast<smtk::resource::Resource>(m_meshset.collection());
}
/**\brief Return an array of model entity UUIDs associated with meshset members.
*
*/
smtk::common::UUIDArray MeshComponent::modelEntityIds() const
{
if (!m_meshset.collection())
{
return smtk::common::UUIDArray();
}
const smtk::mesh::InterfacePtr& iface = m_meshset.collection()->interface();
return iface->computeModelEntities(m_meshset.range());
}
/**\brief Return the model entities associated with meshset members.
*
* warning Note that the parent collection of the meshset must have
* its model resource set to a valid value or the result will
* be an array of invalid entries.
*/
bool MeshComponent::modelEntities(smtk::model::EntityRefArray& array) const
{
if (!m_meshset.collection())
{
return false;
}
smtk::model::ResourcePtr resource = m_meshset.collection()->modelResource();
smtk::common::UUIDArray uids = this->modelEntityIds();
for (smtk::common::UUIDArray::const_iterator it = uids.begin(); it != uids.end(); ++it)
{
array.push_back(smtk::model::EntityRef(resource, *it));
}
return (resource != nullptr);
}
/**\brief Set the model entity for each meshset member to \a ent.
*
*/
bool MeshComponent::setModelEntity(const smtk::model::EntityRef& ent)
{
if (!m_meshset.collection())
{
return false;
}
const smtk::mesh::InterfacePtr& iface = m_meshset.collection()->interface();
return iface->setAssociation(ent.entity(), m_meshset.range());
}
/**\brief Set the model entity for each meshset member to \a ent.
*
*/
bool MeshComponent::setModelEntityId(const smtk::common::UUID& id)
{
if (!m_meshset.collection())
{
return false;
}
const smtk::mesh::InterfacePtr& iface = m_meshset.collection()->interface();
return iface->setAssociation(id, m_meshset.range());
}
}
}
//=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
#ifndef __smtk_mesh_MeshComponent_h
#define __smtk_mesh_MeshComponent_h
#include "smtk/CoreExports.h"
#include "smtk/PublicPointerDefs.h"
#include "smtk/resource/Component.h"
#include "smtk/mesh/core/MeshSet.h"
namespace smtk
{
namespace mesh
{
class MeshComponent;
typedef std::vector<smtk::mesh::MeshComponent> MeshComponentList;
typedef std::set<smtk::mesh::MeshComponent> MeshComponents;
class SMTKCORE_EXPORT MeshComponent : public smtk::resource::Component
{
protected:
MeshComponent(smtk::mesh::MeshSet meshset = smtk::mesh::MeshSet());
MeshComponent(const smtk::common::UUID& id, smtk::mesh::MeshSet ms = smtk::mesh::MeshSet());
// Expose all MeshSet constructors
template <typename... T>
MeshComponent(T&&... all)
: MeshComponent(MeshSet(std::forward<T>(all)...))
{
}
template <typename... T>
MeshComponent(const smtk::common::UUID& id, T&&... all)
: MeshComponent(id, MeshSet(std::forward<T>(all)...))
{
}
public:
typedef smtk::shared_ptr<MeshComponent> MeshComponentPtr;
smtkTypeMacro(MeshComponent);
smtkSharedPtrCreateMacro(smtk::resource::Component);
// Expose all constructors as static create methods
template <typename... T>
static MeshComponentPtr create(T&&... all)
{
return MeshComponentPtr(new MeshComponent(std::forward<T>(all)...));
}
const smtk::resource::ResourcePtr resource() const override;
smtk::common::UUIDArray modelEntityIds() const;
// Append the passed EntityRefArray with the model entities associated with
// this meshset, and return true on success. If the MeshSet's parent collection
// does not have its ModelManager set, this method will fail even though
// modelEntityIds() will still be valid.
bool modelEntities(smtk::model::EntityRefArray&) const;
bool setModelEntityId(const smtk::common::UUID&);
bool setModelEntity(const smtk::model::EntityRef&);
const smtk::common::UUID& id() const override { return m_meshset.id(); }
bool setId(const smtk::common::UUID& id) override
{
m_meshset.setId(id);
return true;
}
smtk::mesh::MeshSet meshes() const { return m_meshset; }
private:
smtk::mesh::MeshSet m_meshset;
};
} // namespace mesh
} // namespace smtk
#endif
......@@ -29,6 +29,7 @@
#include "smtk/io/ExportMesh.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/mesh/core/Component.h"
#include "smtk/mesh/core/ForEachTypes.h"
#include "smtk/mesh/operators/ElevateMesh.h"
#include "smtk/mesh/operators/UndoElevateMesh.h"
......@@ -223,13 +224,19 @@ int TestElevateMesh(int argc, char* argv[])
}
// set input values for the elevate mesh operator
elevateMesh->parameters()->associate(smtk::mesh::Component::create(mesh));
elevateMesh->parameters()->findString("input data")->setToDefault();
elevateMesh->parameters()
->findComponent("auxiliary geometry")
->setObjectValue(auxGeo2dm.component());
elevateMesh->parameters()->findString("interpolation scheme")->setToDefault();
elevateMesh->parameters()->findDouble("radius")->setValue(7.);
elevateMesh->parameters()->findMesh("mesh")->appendValue(mesh);
if (elevateMesh->ableToOperate() == false)
{
std::cerr << "Elevate mesh operator could not operate\n";
return 1;
}
smtk::operation::Operation::Result bathyResult = elevateMesh->operate();
if (bathyResult->findInt("outcome")->value() !=
......
......@@ -29,6 +29,7 @@
#include "smtk/io/ExportMesh.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/mesh/core/Component.h"
#include "smtk/mesh/core/ForEachTypes.h"
#include "smtk/mesh/operators/ElevateMesh.h"
#include "smtk/mesh/operators/UndoElevateMesh.h"
......@@ -215,6 +216,7 @@ int TestElevateMeshOnStructuredGrid(int argc, char* argv[])
}
// set input values for the elevate mesh operator
elevateMesh->parameters()->associate(smtk::mesh::Component::create(mesh));
elevateMesh->parameters()->findString("input data")->setToDefault();
elevateMesh->parameters()
->findComponent("auxiliary geometry")
......@@ -223,7 +225,6 @@ int TestElevateMeshOnStructuredGrid(int argc, char* argv[])
elevateMesh->parameters()->findDouble("radius")->setValue(7.);
elevateMesh->parameters()->findString("external point values")->setValue("set to value");
elevateMesh->parameters()->findDouble("external point value")->setValue(-1.);
elevateMesh->parameters()->findMesh("mesh")->appendValue(mesh);
smtk::operation::Operation::Result bathyResult = elevateMesh->operate();
if (bathyResult->findInt("outcome")->value() !=
......
......@@ -25,6 +25,7 @@
#include "smtk/mesh/core/CellField.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/mesh/core/Component.h"
#include "smtk/mesh/core/ForEachTypes.h"
#include "smtk/mesh/operators/ElevateMesh.h"
......@@ -146,7 +147,7 @@ int main(int argc, char* argv[])
// Set the operator's input mesh
smtk::mesh::MeshSet mesh = collection->meshes();
bool valueSet = elevateMeshOp->parameters()->findMesh("mesh")->appendValue(mesh);
bool valueSet = elevateMeshOp->parameters()->associate(smtk::mesh::Component::create(mesh));
if (!valueSet)
{
......
......@@ -128,7 +128,7 @@ class ElevateMeshOnStructuredGrid(smtk.testing.TestCase):
op.parameters().find("external point values").setToDefault()
# Set the mesh
op.parameters().find("mesh").appendValue(self.mesh)
op.parameters().associate(smtk.mesh.Component.create(self.mesh))
# Clamp the elevation values between -/+ 2
outputFilter = op.parameters().find("output filter")
......