Commit e80a524f authored by T.J. Corona's avatar T.J. Corona

Use mesh::Component for mesh operations

parent 3671e1eb
......@@ -10,13 +10,15 @@
#include "smtk/mesh/operators/DeleteMesh.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/mesh/core/Component.h"
#include "smtk/mesh/core/MeshSet.h"
#include "smtk/model/Session.h"
#include "smtk/model/Session.h"
#include "smtk/attribute/Attribute.h"
#include "smtk/attribute/MeshItem.h"
#include "smtk/attribute/ComponentItem.h"
#include "smtk/attribute/IntItem.h"
#include "smtk/mesh/DeleteMesh_xml.h"
......@@ -27,23 +29,28 @@ namespace mesh
smtk::mesh::DeleteMesh::Result DeleteMesh::operateInternal()
{
// ableToOperate should have verified that mesh(s) are set
smtk::attribute::MeshItem::Ptr meshItem = this->parameters()->findMesh("mesh");
Result result = this->createResult(smtk::operation::Operation::Outcome::SUCCEEDED);
smtk::mesh::MeshSets expunged;
bool success = true;
for (attribute::MeshItem::const_mesh_it mit = meshItem->begin(); mit != meshItem->end(); ++mit)
smtk::attribute::ReferenceItem::Ptr meshItem = this->parameters()->associations();
bool allRemoved = true;
for (std::size_t i = 0; i < meshItem->numberOfValues(); i++)
{
// all mesh items are guaranteed to have a valid associated collection by ableToOperate
smtk::mesh::CollectionPtr collec = mit->collection();
}
smtk::mesh::Component::Ptr meshComponent = meshItem->valueAs<smtk::mesh::Component>(i);
smtk::mesh::MeshSet meshset = meshComponent->mesh();
bool removed = meshset.collection()->removeMeshes(meshset);
if (removed)
{
result->findComponent("expunged")->appendValue(meshComponent);
}
Result result = this->createResult(success ? smtk::operation::Operation::Outcome::SUCCEEDED
: smtk::operation::Operation::Outcome::FAILED);
allRemoved &= removed;
}
if (success)
if (allRemoved == false)
{
result->findMesh("mesh_expunged")->appendValues(expunged);
result->findInt("outcome")->setValue(
0, static_cast<int>(smtk::operation::Operation::Outcome::FAILED));
}
return result;
}
......
......@@ -4,9 +4,9 @@
<Definitions>
<include href="smtk/operation/Operation.xml"/>
<AttDef Type="delete mesh" BaseType="operation" Label="Mesh - Delete">
<ItemDefinitions>
<MeshEntity Name="mesh" NumberOfRequiredValues="1" Extensible="true" />
</ItemDefinitions>
<AssociationsDef Name="mesh" NumberOfRequiredValues="1" Extensible="false">
<Accepts><Resource Name="smtk::mesh::Collection" Filter="meshset"/></Accepts>
</AssociationsDef>
<BriefDescription>
Remove a mesh from the model instance.
</BriefDescription>
......@@ -20,7 +20,6 @@
<include href="smtk/operation/Result.xml"/>
<AttDef Type="result(delete mesh)" BaseType="result">
<ItemDefinitions>
<MeshEntity Name="mesh_expunged" NumberOfRequiredValues="0" Extensible="true" AdvanceLevel="11"/>
</ItemDefinitions>
</AttDef>
</Definitions>
......
......@@ -20,6 +20,7 @@
#include "smtk/mesh/ExportMesh_xml.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/mesh/core/Component.h"
#include "smtk/mesh/core/MeshSet.h"
#include "smtk/model/Resource.h"
......@@ -58,28 +59,27 @@ bool ExportMesh::ableToOperate()
{
return false;
}
smtk::attribute::MeshItem::Ptr meshItem = this->parameters()->findMesh("mesh");
return meshItem && meshItem->numberOfValues() > 0;
return true;
}
ExportMesh::Result ExportMesh::operateInternal()
{
std::string outputfile = this->parameters()->findFile("filename")->value();
// ableToOperate should have verified that mesh(s) are set
smtk::attribute::MeshItem::Ptr meshItem = this->parameters()->findMesh("mesh");
smtk::attribute::ReferenceItem::Ptr meshItem = this->parameters()->associations();
// for multiple meshes, we suffix the file name root with ascending integers
std::string root = outputfile.substr(0, outputfile.find_last_of("."));
std::string ext = outputfile.substr(outputfile.find_last_of("."));
int index = 0;
smtk::mesh::MeshSets written;
std::vector<std::string> generatedFiles;
for (attribute::MeshItem::const_mesh_it mit = meshItem->begin(); mit != meshItem->end(); ++mit)
for (std::size_t i = 0; i < meshItem->numberOfValues(); i++)
{
smtk::mesh::CollectionPtr collection = mit->collection();
smtk::mesh::Component::Ptr meshComponent = meshItem->valueAs<smtk::mesh::Component>(i);
smtk::mesh::CollectionPtr collection =
std::dynamic_pointer_cast<smtk::mesh::Collection>(meshComponent->resource());
bool fileExportSuccess = false;
if (collection)
......@@ -98,7 +98,6 @@ ExportMesh::Result ExportMesh::operateInternal()
{
++index;
generatedFiles.push_back(outputfile);
written.insert(*mit);
}
}
......
......@@ -15,8 +15,10 @@
mesh is not guaranteed to contain all of the information from
the original mesh.
</DetailedDescription>
<AssociationsDef Name="mesh" NumberOfRequiredValues="1" Extensible="false">
<Accepts><Resource Name="smtk::mesh::Collection" Filter="meshset"/></Accepts>
</AssociationsDef>
<ItemDefinitions>
<MeshEntity Name="mesh" NumberOfRequiredValues="1" Extensible="true" />
<File Name="filename" NumberOfRequiredValues="1" ShouldExist="false"
FileFilters="AdH 2D Mesh file (*.2dm);;AdH 3D Mesh file (*.3dm)">
</File>
......
......@@ -21,6 +21,7 @@
#include "smtk/mesh/GenerateHotStartData_xml.h"
#include "smtk/mesh/core/CellField.h"
#include "smtk/mesh/core/Component.h"
#include "smtk/mesh/core/MeshSet.h"
#include "smtk/mesh/core/PointField.h"
......@@ -188,20 +189,13 @@ bool GenerateHotStartData::ableToOperate()
{
return false;
}
smtk::attribute::MeshItem::Ptr meshItem = this->parameters()->findMesh("mesh");
if (!meshItem || meshItem->numberOfValues() == 0)
{
return false;
}
return true;
}
GenerateHotStartData::Result GenerateHotStartData::operateInternal()
{
// Access the mesh to elevate
smtk::attribute::MeshItem::Ptr meshItem = this->parameters()->findMesh("mesh");
smtk::attribute::ReferenceItem::Ptr meshItem = this->parameters()->associations();
// Access the data set type
smtk::attribute::StringItem::Ptr typeItem = this->parameters()->findString("dstype");
......@@ -249,7 +243,7 @@ GenerateHotStartData::Result GenerateHotStartData::operateInternal()
bool meshIsContainedByPointCloud = true;
for (std::size_t i = 0; i < meshItem->numberOfValues(); i++)
{
smtk::mesh::MeshSet mesh = meshItem->value(i);
smtk::mesh::MeshSet mesh = meshItem->valueAs<smtk::mesh::Component>(i)->mesh();
std::array<double, 6> mesh_bounds = bounds(mesh);
for (std::size_t j = 0; j < 3; j++)
......@@ -271,10 +265,8 @@ GenerateHotStartData::Result GenerateHotStartData::operateInternal()
// Construct an instance of our interpolator and set its parameters
smtk::mesh::InverseDistanceWeighting interpolator(pointcloud, powerItem->value());
// Access the attribute associated with the modified meshes
// Construct a result object to hold our output
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");
......@@ -310,11 +302,11 @@ GenerateHotStartData::Result GenerateHotStartData::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);
smtk::mesh::Component::Ptr meshComponent = meshItem->valueAs<smtk::mesh::Component>(i);
smtk::mesh::MeshSet mesh = meshComponent->mesh();
smtk::mesh::utility::applyScalarPointField(fn, name, mesh);
modifiedMeshes->appendValue(mesh);
modified->appendValue(meshComponent);
smtk::model::EntityRefArray entities;
bool entitiesAreValid = mesh.modelEntities(entities);
......
......@@ -18,11 +18,12 @@
onto either the points or the cells of the mesh. The input
points can be inserted manually or read from a CSV file.
</DetailedDescription>
<ItemDefinitions>
<MeshEntity Name="mesh" Label="Mesh" NumberOfRequiredValues="1" Extensible="true" >
<BriefDescription>The mesh to elevate.</BriefDescription>
</MeshEntity>
<AssociationsDef Name="mesh" NumberOfRequiredValues="1" Extensible="false">
<Accepts><Resource Name="smtk::mesh::Collection" Filter="meshset"/></Accepts>
</AssociationsDef>
<ItemDefinitions>
<String Name="dstype" Label="Data Type" NumberOfRequiredValues="1">
<BriefDescription>The name of the data set.</BriefDescription>
<DiscreteInfo DefaultIndex="0">
......
......@@ -16,13 +16,13 @@
#include "smtk/attribute/FileItem.h"
#include "smtk/attribute/GroupItem.h"
#include "smtk/attribute/IntItem.h"
#include "smtk/attribute/MeshItem.h"
#include "smtk/attribute/StringItem.h"
#include "smtk/attribute/VoidItem.h"
#include "smtk/mesh/InterpolateOntoMesh_xml.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"
......@@ -130,12 +130,6 @@ bool InterpolateOntoMesh::ableToOperate()
return false;
}
smtk::attribute::MeshItem::Ptr meshItem = this->parameters()->findMesh("mesh");
if (!meshItem || meshItem->numberOfValues() == 0)
{
return false;
}
return true;
}
......@@ -145,7 +139,9 @@ InterpolateOntoMesh::Result InterpolateOntoMesh::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 =
......@@ -220,7 +216,7 @@ InterpolateOntoMesh::Result InterpolateOntoMesh::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")
{
......@@ -244,7 +240,7 @@ InterpolateOntoMesh::Result InterpolateOntoMesh::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")
{
......@@ -286,8 +282,7 @@ InterpolateOntoMesh::Result InterpolateOntoMesh::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 +359,6 @@ InterpolateOntoMesh::Result InterpolateOntoMesh::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");
......@@ -388,7 +381,8 @@ InterpolateOntoMesh::Result InterpolateOntoMesh::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);
smtk::mesh::Component::Ptr meshComponent = meshItem->valueAs<smtk::mesh::Component>(i);
smtk::mesh::MeshSet mesh = meshComponent->mesh();
if (modeItem->value(0) == CELL_FIELD)
{
......@@ -399,7 +393,7 @@ InterpolateOntoMesh::Result InterpolateOntoMesh::operateInternal()
smtk::mesh::utility::applyScalarPointField(fn, nameItem->value(), mesh);
}
modifiedMeshes->appendValue(mesh);
modified->appendValue(meshComponent);
smtk::model::EntityRefArray entities;
bool entitiesAreValid = mesh.modelEntities(entities);
......
......@@ -17,6 +17,11 @@
Shepard's method for interpolation. The input points can be
inserted manually or read from a CSV file.
</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">
......@@ -111,10 +116,6 @@
</DiscreteInfo>
</String>
<MeshEntity Name="mesh" Label="Mesh" NumberOfRequiredValues="1" Extensible="true" >
<BriefDescription>The mesh onto which the data is interpolated.</BriefDescription>
</MeshEntity>
<String Name="interpolation scheme" Label="Interpolation Scheme">
<BriefDescription>The interpolation scheme to apply to the input data</BriefDescription>
......@@ -274,7 +275,6 @@
<include href="smtk/operation/Result.xml"/>
<AttDef Type="result(interpolate onto 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>
......
......@@ -17,6 +17,7 @@
#include "smtk/io/Logger.h"
#include "smtk/mesh/UndoElevateMesh_xml.h"
#include "smtk/mesh/core/Component.h"
#include "smtk/mesh/core/MeshSet.h"
#include "smtk/mesh/core/PointField.h"
#include "smtk/mesh/utility/ApplyToMesh.h"
......@@ -35,7 +36,7 @@ bool UndoElevateMesh::ableToOperate()
return false;
}
smtk::attribute::MeshItem::Ptr meshItem = this->parameters()->findMesh("mesh");
smtk::attribute::ReferenceItem::Ptr meshItem = this->parameters()->associations();
if (!meshItem || meshItem->numberOfValues() == 0)
{
return false;
......@@ -43,7 +44,7 @@ bool UndoElevateMesh::ableToOperate()
for (std::size_t i = 0; i < meshItem->numberOfValues(); i++)
{
smtk::mesh::MeshSet mesh = meshItem->value(i);
smtk::mesh::MeshSet mesh = meshItem->valueAs<smtk::mesh::Component>(i)->mesh();
smtk::mesh::PointField prior = mesh.pointField("_prior");
if (!prior.isValid())
{
......@@ -57,12 +58,10 @@ bool UndoElevateMesh::ableToOperate()
UndoElevateMesh::Result UndoElevateMesh::operateInternal()
{
// Access the mesh
smtk::attribute::MeshItem::Ptr meshItem = this->parameters()->findMesh("mesh");
smtk::attribute::ReferenceItem::Ptr meshItem = this->parameters()->associations();
// 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");
......@@ -74,7 +73,8 @@ UndoElevateMesh::Result UndoElevateMesh::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);
smtk::mesh::Component::Ptr meshComponent = meshItem->valueAs<smtk::mesh::Component>(i);
smtk::mesh::MeshSet mesh = meshComponent->mesh();
bool success = smtk::mesh::utility::undoWarp(mesh);
......@@ -84,7 +84,7 @@ UndoElevateMesh::Result UndoElevateMesh::operateInternal()
return this->createResult(smtk::operation::Operation::Outcome::FAILED);
}
modifiedMeshes->appendValue(mesh);
modified->appendValue(meshComponent);
smtk::model::EntityRefArray entities;
bool entitiesAreValid = mesh.modelEntities(entities);
......
......@@ -15,17 +15,16 @@
(e.g. Mesh - Elevate). This operator removes the elevateing
applied by these operators.
</DetailedDescription>
<AssociationsDef Name="mesh" NumberOfRequiredValues="1" Extensible="false">
<Accepts><Resource Name="smtk::mesh::Collection" Filter="meshset"/></Accepts>
</AssociationsDef>
<ItemDefinitions>
<MeshEntity Name="mesh" Label="Mesh" NumberOfRequiredValues="1" Extensible="true" >
<BriefDescription>The mesh to restore.</BriefDescription>
</MeshEntity>
</ItemDefinitions>
</AttDef>
<!-- Result -->
<include href="smtk/operation/Result.xml"/>
<AttDef Type="result(undo 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>
</Component>
......
......@@ -13,13 +13,13 @@
#include "smtk/attribute/Attribute.h"
#include "smtk/attribute/FileItem.h"
#include "smtk/attribute/IntItem.h"
#include "smtk/attribute/MeshItem.h"
#include "smtk/io/WriteMesh.h"
#include "smtk/io/mesh/MeshIO.h"
#include "smtk/mesh/WriteMesh_xml.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/mesh/core/Component.h"
#include "smtk/mesh/core/MeshSet.h"
#include "smtk/model/Resource.h"
......@@ -58,8 +58,7 @@ bool WriteMesh::ableToOperate()
{
return false;
}
smtk::attribute::MeshItem::Ptr meshItem = this->parameters()->findMesh("mesh");
return meshItem && meshItem->numberOfValues() > 0;
return true;
}
WriteMesh::Result WriteMesh::operateInternal()
......@@ -69,20 +68,20 @@ WriteMesh::Result WriteMesh::operateInternal()
smtk::io::mesh::Subset componentToWrite =
static_cast<smtk::io::mesh::Subset>(this->parameters()->findInt("write-component")->value());
// ableToOperate should have verified that mesh(s) are set
smtk::attribute::MeshItem::Ptr meshItem = this->parameters()->findMesh("mesh");
smtk::attribute::ReferenceItem::Ptr meshItem = this->parameters()->associations();
// for multiple meshes, we suffix the file name root with ascending integers
std::string root = outputfile.substr(0, outputfile.find_last_of("."));
std::string ext = outputfile.substr(outputfile.find_last_of("."));
int index = 0;
smtk::mesh::MeshSets written;
std::vector<std::string> generatedFiles;
for (attribute::MeshItem::const_mesh_it mit = meshItem->begin(); mit != meshItem->end(); ++mit)
for (std::size_t i = 0; i < meshItem->numberOfValues(); i++)
{
smtk::mesh::CollectionPtr collection = mit->collection();
smtk::mesh::Component::Ptr meshComponent = meshItem->valueAs<smtk::mesh::Component>(i);
smtk::mesh::CollectionPtr collection =
std::dynamic_pointer_cast<smtk::mesh::Collection>(meshComponent->resource());
bool fileWriteSuccess = false;
if (collection)
......@@ -101,7 +100,6 @@ WriteMesh::Result WriteMesh::operateInternal()
{
++index;
generatedFiles.push_back(outputfile);
written.insert(*mit);
}
}
......@@ -115,16 +113,7 @@ WriteMesh::Result WriteMesh::operateInternal()
}
}
// We mark the written meshes as "modified" so that the containing collection's URL can
// be properly updated.
Result result = this->createResult(smtk::operation::Operation::Outcome::SUCCEEDED);
smtk::attribute::MeshItem::Ptr modifiedMeshes = result->findMesh("mesh_modified");
modifiedMeshes->setNumberOfValues(written.size());
for (auto& mesh : written)
{
modifiedMeshes->appendValue(mesh);
}
return result;
}
......
......@@ -16,8 +16,10 @@
mesh is guaranteed to contain all of the information from
the original mesh.
</DetailedDescription>
<AssociationsDef Name="mesh" NumberOfRequiredValues="1" Extensible="false">
<Accepts><Resource Name="smtk::mesh::Collection" Filter="meshset"/></Accepts>
</AssociationsDef>
<ItemDefinitions>
<MeshEntity Name="mesh" NumberOfRequiredValues="1" Extensible="true" />
<File Name="filename" NumberOfRequiredValues="1" ShouldExist="false"
FileFilters="MOAB native file (*.h5m *.mhdf);;Exodus II file (*.exo *.exoII *.exo2 *.g *.gen);;Kitware VTK file (*.vtk);;SLAC file (*.slac);;General Mesh Viewer (GMV) file (*.gmv);;Ansys file (*.ans);;Gmsh file (*.msh *.gmsh);;Stereo Lithography file (*.stl)">
</File>
......
......@@ -269,7 +269,7 @@ int TestElevateMesh(int argc, char* argv[])
return 1;
}
undoElevateMesh->parameters()->findMesh("mesh")->appendValue(mesh);
undoElevateMesh->parameters()->associate(smtk::mesh::Component::create(mesh));
smtk::operation::Operation::Result result = undoElevateMesh->operate();
if (result->findInt("outcome")->value() !=
......
......@@ -260,7 +260,7 @@ int TestElevateMeshOnStructuredGrid(int argc, char* argv[])
return 1;
}
undoElevateMesh->parameters()->findMesh("mesh")->appendValue(mesh);
undoElevateMesh->parameters()->associate(smtk::mesh::Component::create(mesh));
smtk::operation::Operation::Result result = undoElevateMesh->operate();
if (result->findInt("outcome")->value() !=
......
......@@ -15,7 +15,6 @@
#include "smtk/attribute/FileItem.h"
#include "smtk/attribute/GroupItem.h"
#include "smtk/attribute/IntItem.h"
#include "smtk/attribute/MeshItem.h"
#include "smtk/attribute/StringItem.h"
#include "smtk/io/ModelToMesh.h"
......@@ -23,6 +22,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/core/PointField.h"
#include "smtk/mesh/operators/GenerateHotStartData.h"
......@@ -170,7 +170,7 @@ int main(int argc, char* argv[])
// Set the operator's input mesh
smtk::mesh::MeshSet mesh = collection->meshes();
valueSet = generateHotStartDataOp->parameters()->findMesh("mesh")->setValue(mesh);
valueSet = generateHotStartDataOp->parameters()->associate(smtk::mesh::Component::create(mesh));
if (!valueSet)
{
......
......@@ -15,7 +15,6 @@
#include "smtk/attribute/FileItem.h"
#include "smtk/attribute/GroupItem.h"
#include "smtk/attribute/IntItem.h"
#include "smtk/attribute/MeshItem.h"
#include "smtk/attribute/StringItem.h"
#include "smtk/io/ModelToMesh.h"
......@@ -26,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/core/PointField.h"
#include "smtk/mesh/operators/InterpolateOntoMesh.h"
......@@ -194,7 +194,7 @@ int main(int argc, char* argv[])
// Set the operator's input mesh
smtk::mesh::MeshSet mesh = collection->meshes();
valueSet = interpolateOntoMeshOp->parameters()->findMesh("mesh")->setValue(mesh);
valueSet = interpolateOntoMeshOp->parameters()->associate(smtk::mesh::Component::create(mesh));
if (!valueSet)
{
......
......@@ -21,6 +21,7 @@
#include "smtk/model/json/jsonResource.h"
#include "smtk/mesh/core/Collection.h"
#include "smtk/mesh/core/Component.h"
#include "smtk/mesh/operators/ExportMesh.h"
#include "smtk/model/Resource.h"
......@@ -107,7 +108,8 @@ int main(int argc, char* argv[])
std::string export_path = std::string(write_root + "/testmesh.2dm");
exportMeshOp->parameters()->findFile("filename")->setValue(export_path);
bool valueSet = exportMeshOp->parameters()->findMesh("mesh")->setValue(collection->meshes());
bool valueSet =
exportMeshOp->parameters()->associate(smtk::mesh::Component::create(collection->meshes()));
if (!valueSet)
{
......
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