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

Introduce operation manager.

Currently, operators register with both the opManager and the session.
parent 34f17daf
......@@ -37,6 +37,7 @@ simulation domain.
overview.rst
resource/index.rst
attribute/index.rst
operation/index.rst
model/index.rst
mesh/index.rst
simulation/index.rst
......
.. _smtk-resource-sys:
----------------------
SMTK's Resource System
----------------------
Actions that create, modify and destroy resources and resource
components are encapsulated within *operators*.
.. toctree::
:maxdepth: 3
operators.rst
Operators
=========
In SMTK, operations performed on resources are represented
by instances of the :smtk:`Operator <smtk::operation::Operator>` class.
Each operation is a subclass that contains the code to perform the
operation by overriding the operate() and ableToOperate() methods.
These subclasses register themselves (via SMTK's auto-init macros)
with an :smtk:`Manager <smtk::operation::Manager>`.
.. todo:: Describe SMTK's auto-init macros.
The next sections describe in detail: first, how operators specify the inputs they require
and outputs they produce; and second, how operators register themselves for intropspection.
Inputs and Outputs
------------------
The inputs that an operator requires in order to run and
the outputs that an operator may produce are each modeled
as :smtk:`attribute definitions <smtk::attribute::Definition>`.
These definitions reside in an :smtk:`attribute collection <smtk::attribute::Collection>`.
Each operator's inputs are specified by a Definition that inherits a base attribute-definition
named "operator" while the its outputs are specified by a Definition that inherits a
base attribute-definition named "result".
Furthermore, if an operator's input specification is named "foo", its output specification
must be named "result(foo)".
SMTK uses this naming convention to construct results automatically.
Given an instance of an Operator subclass, you can call its
:smtk:`specification() <smtk::operation::Operator::specification>` method to obtain
the Attribute which models its inputs.
When the operator is executed, it returns an Attribute instance that models its result.
Recall that the attribute.Collection holds Definitions which contain ItemDefinitions.
When a Definition is instantiated as an Attribute, all its active ItemDefinitions
are instantiated as Items.
The Definitions themselves specify what types of model-entities may be
associated with their Attributes using a membership mask.
Associations between an operator's Attribute and model entities (i.e., subclasses of EntityRef)
denote the entities that the operator will act upon.
The operator-attribute's Items specify input parameters such as point locations,
geometric distances, etc.
The fact that inputs and outputs are specified using SMTK's own attribute collection
means that one need not construct an instance of the operator's C++ class in order
to obtain information about it;
instead, simply call :smtk:`operatorSystem() <smtk::model::Session::operatorSystem>`
on the session and ask for all the definitions which inherit "operator".
Registration
------------
* How to enumerate operators: ask the session.
* Operators are registered with an operation manager via the operator's use
of the :smtk:`smtkDeclareOperator` and :smtk:`smtkImplementsOperator` macros.
......@@ -21,6 +21,9 @@ These subsystems are:
* The **mesh** system, which can manipulate meshes of geometric models; it provides a way
to propagate simulation attribute information from model entities onto meshes.
It also provides a way to run external mesh creation tools on the model.
* The **operation** system, which provides an interface to
constructing and executing *operators*, which create, modify and delete
resources.
* The **simulation** (also known as the **export**) system, which is a set of utilities
that lets you convert resources (e.g., attribute, model, and mesh collections) into
an input deck for a simulation using Python scripts (or C++ if you wish).
......
......@@ -12,6 +12,9 @@ smtk_source_group(resource)
add_subdirectory(attribute)
smtk_source_group(attribute)
add_subdirectory(operation)
smtk_source_group(operation)
add_subdirectory(mesh)
smtk_source_group(mesh)
......@@ -31,6 +34,7 @@ set(smtk_headers
${commonHeaders}
${resourceHeaders}
${attributeHeaders}
${operationHeaders}
${meshHeaders}
${modelHeaders}
${simulationHeaders}
......@@ -40,6 +44,7 @@ set(smtk_srcs
${commonSrcs}
${resourceSrcs}
${attributeSrcs}
${operationSrcs}
${meshSrcs}
${modelSrcs}
${simulationSrcs}
......
......@@ -77,6 +77,12 @@ class VoidItem;
class VoidItemDefinition;
}
namespace operation
{
class Manager;
class Operator;
}
namespace extension
{
class qtSelectionManager;
......@@ -228,6 +234,12 @@ typedef smtk::shared_ptr<const smtk::resource::Resource> ConstResourcePtr;
typedef smtk::shared_ptr<const smtk::resource::Set> ConstSetPtr;
}
namespace operation
{
typedef smtk::shared_ptr<smtk::operation::Operator> OperatorPtr;
typedef smtk::weak_ptr<smtk::operation::Operator> WeakOperatorPtr;
}
namespace mesh
{
typedef smtk::shared_ptr<smtk::mesh::Manager> ManagerPtr;
......
......@@ -88,7 +88,7 @@ smtk::model::OperatorResult BooleanIntersection::operateInternal()
if (!ok)
{
smtkInfoMacro(log(), "One or more workpiece inputs had no matching CGM entity.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
if (toolIn->numberOfValues() > 0)
......@@ -101,7 +101,7 @@ smtk::model::OperatorResult BooleanIntersection::operateInternal()
smtkInfoMacro(log(), "Tool body specified as " << toolIn->value().name() << " ("
<< toolIn->value().flagSummary() << ")"
<< " but no matching CGM entity exists.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
cgmToolBody = cgmToolBodies[0];
}
......@@ -127,10 +127,11 @@ smtk::model::OperatorResult BooleanIntersection::operateInternal()
if (s != CUBIT_SUCCESS)
{
smtkInfoMacro(log(), "Failed to perform intersection (status " << s << ").");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
this->addEntitiesToResult(cgmBodiesOut, result, MODIFIED);
result->findModelEntity("expunged")->setValues(expunged.begin(), expunged.end());
......
......@@ -70,14 +70,14 @@ smtk::model::OperatorResult BooleanSubtraction::operateInternal()
if (!ok)
{
smtkInfoMacro(log(), "Need at least 1 workpiece, none of the associated entities were valid.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
ok &= this->cgmEntities(*this->findModelEntity("tools").get(), cgmToolsIn, keepInputs, expunged);
if (!ok)
{
smtkInfoMacro(log(), "Need at least 1 tool; none of the specified entities were valid.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
DLIList<RefEntity*> imported;
......@@ -86,10 +86,11 @@ smtk::model::OperatorResult BooleanSubtraction::operateInternal()
if (s != CUBIT_SUCCESS)
{
smtkInfoMacro(log(), "Failed to perform subtraction (status " << s << ").");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
this->addEntitiesToResult(cgmBodiesOut, result, MODIFIED);
result->findModelEntity("expunged")->setValues(expunged.begin(), expunged.end());
......
......@@ -69,7 +69,7 @@ smtk::model::OperatorResult BooleanUnion::operateInternal()
if (cgmBodiesIn.size() < 2)
{
smtkInfoMacro(log(), "Need multiple bodies to union, given " << cgmBodiesIn.size() << ".");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
DLIList<RefEntity*> imported;
......@@ -77,10 +77,11 @@ smtk::model::OperatorResult BooleanUnion::operateInternal()
if (s != CUBIT_SUCCESS)
{
smtkInfoMacro(log(), "Failed to perform union (status " << s << ").");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
this->addEntitiesToResult(cgmBodiesOut, result, MODIFIED);
result->findModelEntity("expunged")->setValues(expunged.begin(), expunged.end());
......
......@@ -58,7 +58,7 @@ smtk::model::OperatorResult Copy::operateInternal()
{
smtkInfoMacro(
log(), "Expected a single entity to copy but was given " << entitiesIn.size() << ".");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
EntityRef entity = entitiesIn[0];
......@@ -69,13 +69,13 @@ smtk::model::OperatorResult Copy::operateInternal()
if (!refBody)
{
smtkInfoMacro(log(), "Unable obtain CGM body from " << entity.name() << ".");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
Body* newBody = GeometryModifyTool::instance()->copy_body(refBody);
if (!newBody)
{
smtkInfoMacro(log(), "Unable to copy body " << refBody << " (" << entity.name() << ").");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
cgmOut = newBody;
}
......@@ -85,13 +85,13 @@ smtk::model::OperatorResult Copy::operateInternal()
if (!refEntity)
{
smtkInfoMacro(log(), "Unable obtain CGM entity from " << entity.name() << ".");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
RefEntity* newEntity = GeometryModifyTool::instance()->copy_refentity(refEntity);
if (!newEntity)
{
smtkInfoMacro(log(), "Unable to copy entity " << refEntity << " (" << entity.name() << ").");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
cgmOut = newEntity;
}
......@@ -99,10 +99,11 @@ smtk::model::OperatorResult Copy::operateInternal()
{
smtkInfoMacro(log(), "Expected a cell (vertex, edge, face, volume) or model but was given "
<< entity.flagSummary(0) << " (named " << entity.name() << ").");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
DLIList<RefEntity*> cgmEntitiesOut;
cgmEntitiesOut.push(cgmOut);
......
......@@ -63,7 +63,7 @@ smtk::model::OperatorResult CreateBody::operateInternal()
*this->specification()->associations().get(), entList, keepInputs, expunged))
{
smtkInfoMacro(log(), "Could not find CGM entities for input cells.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
DLIList<RefEdge*> edgeList;
......@@ -90,7 +90,7 @@ smtk::model::OperatorResult CreateBody::operateInternal()
else
{
smtkInfoMacro(log(), "An input entity was not an edge, face, or volume.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
}
......@@ -104,7 +104,7 @@ smtk::model::OperatorResult CreateBody::operateInternal()
{
smtkInfoMacro(
log(), "Could not create planar sheet-body from " << edgeList.size() << " edge(s).");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
bod->color(color);
cgmBodies.push(bod);
......@@ -121,7 +121,7 @@ smtk::model::OperatorResult CreateBody::operateInternal()
{
smtkInfoMacro(log(), "Could not create planar sheet-body from face "
<< (i + 1) << " of " << edgeList.size() << ".");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
bod->color(color);
cgmBodies.push(bod);
......@@ -132,13 +132,14 @@ smtk::model::OperatorResult CreateBody::operateInternal()
if (!bod)
{
smtkInfoMacro(log(), "Could not create body from " << volumeList.size() << " volume(s).");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
bod->color(color);
cgmBodies.push(bod);
}
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
this->addEntitiesToResult(cgmBodies, result, CREATED);
result->findModelEntity("expunged")->setValues(expunged.begin(), expunged.end());
......
......@@ -110,10 +110,11 @@ smtk::model::OperatorResult CreateBrick::operateInternal()
if (!cgmBody)
{
smtkInfoMacro(log(), "Failed to create body.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
DLIList<Body*> cgmBodiesOut;
cgmBodiesOut.push(cgmBody);
......
......@@ -73,10 +73,11 @@ smtk::model::OperatorResult CreateCylinder::operateInternal()
if (!cgmBody)
{
smtkInfoMacro(log(), "Failed to create body.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
DLIList<Body*> cgmBodiesOut;
cgmBodiesOut.push(cgmBody);
......
......@@ -55,7 +55,7 @@ smtk::model::OperatorResult CreateEdge::operateInternal()
if (vertices.size() != 2)
{
smtkInfoMacro(log(), "Expected 2 vertices, got " << vertices.size() << ".");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
smtk::attribute::DoubleItem::Ptr pointItem = this->findDouble("point");
......@@ -79,27 +79,28 @@ smtk::model::OperatorResult CreateEdge::operateInternal()
break;
default:
smtkInfoMacro(log(), "Bad curve type " << curveType << ".");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
RefVertex* v0 = this->cgmEntityAs<RefVertex*>(vertices[0]);
RefVertex* v1 = this->cgmEntityAs<RefVertex*>(vertices[1]);
if (!v0 || !v1)
{
smtkInfoMacro(log(), "One or more vertices were invalid " << v0 << ", " << v1 << ".");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
RefEdge* cgmEdge = GeometryModifyTool::instance()->make_RefEdge(curveType, v0, v1, &point);
if (!cgmEdge)
{
smtkInfoMacro(log(), "Failed to create edge.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
// Assign color to match vertex API that requires a color.
cgmEdge->color(color);
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
DLIList<RefEdge*> cgmEdgesOut;
cgmEdgesOut.push(cgmEdge);
......
......@@ -63,7 +63,7 @@ smtk::model::OperatorResult CreateFace::operateInternal()
break;
default:
smtkInfoMacro(log(), "Bad surf type " << surfType << ".");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
DLIList<RefEdge*> edgeList;
smtk::model::EntityRefArray expunged;
......@@ -71,7 +71,7 @@ smtk::model::OperatorResult CreateFace::operateInternal()
*this->specification()->associations().get(), edgeList, keepInputs, expunged))
{
smtkInfoMacro(log(), "One or more edges were invalid.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
bool isFree = true;
......@@ -81,13 +81,14 @@ smtk::model::OperatorResult CreateFace::operateInternal()
if (!cgmFace)
{
smtkInfoMacro(log(), "Failed to create face.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
// Assign color to match vertex API that requires a color.
cgmFace->color(color);
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
DLIList<RefFace*> cgmFacesOut;
cgmFacesOut.push(cgmFace);
......
......@@ -73,10 +73,11 @@ smtk::model::OperatorResult CreatePrism::operateInternal()
if (!cgmBody)
{
smtkInfoMacro(log(), "Failed to create body.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
DLIList<Body*> cgmEntitiesOut;
cgmEntitiesOut.push(cgmBody);
......
......@@ -69,7 +69,7 @@ smtk::model::OperatorResult CreateSphere::operateInternal()
if (!cgmBody)
{
smtkInfoMacro(log(), "Failed to create body.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
// Do this separately because CGM's sphere() method is broken (for OCC at a minimum).
......@@ -84,10 +84,11 @@ smtk::model::OperatorResult CreateSphere::operateInternal()
if (status != CUBIT_SUCCESS)
{
smtkInfoMacro(log(), "Failed to translate body.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
DLIList<Body*> cgmEntitiesOut;
cgmEntitiesOut.push(cgmBody);
......
......@@ -58,10 +58,11 @@ smtk::model::OperatorResult CreateVertex::operateInternal()
if (!cgmVert)
{
smtkInfoMacro(log(), "Failed to create vertex.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
DLIList<RefVertex*> cgmEntitiesOut;
cgmEntitiesOut.push(cgmVert);
......
......@@ -114,10 +114,11 @@ smtk::model::OperatorResult Read::operateInternal()
if (s != CUBIT_SUCCESS)
{
smtkInfoMacro(this->manager()->log(), "Failed to import CGM model, status " << s);
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
this->addEntitiesToResult(imported, result, CREATED);
......
......@@ -83,10 +83,11 @@ smtk::model::OperatorResult Reflect::operateInternal()
smtkInfoMacro(log(), "Failed to reflect bodies or wrong number"
<< " (" << cgmEntitiesOut.size() << " != " << nb << ")"
<< " of resulting bodies.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
this->addEntitiesToResult(cgmEntitiesOut, result, MODIFIED);
// Nothing expunged.
......
......@@ -43,18 +43,18 @@ smtk::model::OperatorResult RemoveModel::operateInternal()
{
GeometryQueryTool* gqt = GeometryQueryTool::instance();
if (!gqt)
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
// ableToOperate should have verified that model(s) are set
DLIList<Body*> bodies;
EntityRefArray expunged;
if (!this->cgmEntities(this->associatedEntitiesAs<Models>(), bodies, false, expunged))
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
// This does not return an error code; assume success.
gqt->delete_Body(bodies);
OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
OperatorResult result = this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
result->findModelEntity("expunged")->setValues(expunged.begin(), expunged.end());
return result;
......
......@@ -80,7 +80,7 @@ smtk::model::OperatorResult Rotate::operateInternal()
if (axis.normalize() == 0)
{
smtkInfoMacro(log(), "Ill-defined rotation: given axis of rotation is a zero-length vector.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
double angle = angleItem->value(0);
GeometryQueryTool::instance()->rotate(cgmEntitiesIn, center, axis, angle,
......@@ -91,10 +91,11 @@ smtk::model::OperatorResult Rotate::operateInternal()
smtkInfoMacro(log(), "Failed to rotate bodies or wrong number"
<< " (" << cgmEntitiesOut.size() << " != " << nb << ")"
<< " of resulting bodies.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
this->addEntitiesToResult(cgmEntitiesOut, result, MODIFIED);
// Nothing expunged.
......
......@@ -95,10 +95,11 @@ smtk::model::OperatorResult Scale::operateInternal()
smtkInfoMacro(log(), "Failed to scale bodies or wrong number"
<< " (" << cgmEntitiesOut.size() << " != " << nb << ")"
<< " of resulting bodies.");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
this->addEntitiesToResult(cgmEntitiesOut, result, MODIFIED);
// Nothing expunged.
......
......@@ -70,7 +70,7 @@ smtk::model::OperatorResult Sweep::operateInternal()
*this->findModelEntity("sweep path").get(), cgmSweepPath, keepInputs, expunged);
if (!ok)
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
DLIList<Body*> cgmResults;
CubitStatus s;
......@@ -172,10 +172,11 @@ smtk::model::OperatorResult Sweep::operateInternal()
if (s != CUBIT_SUCCESS)
{
smtkInfoMacro(log(), "Failed to perform sweep (status " << s << ").");
return this->createResult(smtk::model::OPERATION_FAILED);
return this->createResult(smtk::operation::Operator::OPERATION_FAILED);
}
smtk::model::OperatorResult result = this->createResult(smtk::model::OPERATION_SUCCEEDED);
smtk::model::OperatorResult result =
this->createResult(smtk::operation::Operator::OPERATION_SUCCEEDED);
this->addEntitiesToResult(cgmResults, result, CREATED);
result->findModelEntity("expunged")->setValues(expunged.begin(), expunged.end());