myIsProcessed = true;
}
+void ModelAPI_ParameterEvalMessage::setVolumes(
+ const std::list<std::shared_ptr<ModelAPI_ResultParameter> >& theParamsList,
+ const double theResult, const std::string& theError)
+{
+ myParamsList = theParamsList;
+ myResult = theResult;
+ myError = theError;
+ myIsProcessed = true;
+}
+
bool ModelAPI_ParameterEvalMessage::isProcessed()
{
return myIsProcessed;
myError = theError;
myIsProcessed = true;
}
+void ModelAPI_BuildEvalMessage::setVolumes(
+ const std::list<std::shared_ptr<ModelAPI_ResultParameter> >& theParamsList,
+ const std::string& theError)
+{
+ myParamsList = theParamsList;
+ myError = theError;
+ myIsProcessed = true;
+}
const std::list<std::shared_ptr<ModelAPI_ResultParameter> >&
ModelAPI_BuildEvalMessage::params() const
MODELAPI_EXPORT void setResults(
const std::list<std::shared_ptr<ModelAPI_ResultParameter> >& theParamsList,
const double theResult, const std::string& theError);
+ MODELAPI_EXPORT void setVolumes(
+ const std::list<std::shared_ptr<ModelAPI_ResultParameter> >& theParamsList,
+ const double theResult, const std::string& theError);
/// Returns true if the expression is processed
MODELAPI_EXPORT bool isProcessed();
/// Returns the results of processing: list of parameters found in the expression
MODELAPI_EXPORT void setResults(
const std::list<std::shared_ptr<ModelAPI_ResultParameter> >& theParamsList,
const std::string& theError);
+ /// Sets the results of processing
+ MODELAPI_EXPORT void setVolumes(
+ const std::list<std::shared_ptr<ModelAPI_ResultParameter> >& theParamsList,
+ const std::string& theError);
/// Returns the results of processing: list of parameters found in the expression
MODELAPI_EXPORT const std::list<std::shared_ptr<ModelAPI_ResultParameter> >& params() const;
/// Returns true if the expression is processed
theResult->setDisabled(theResult, false);
}
+void ModelAPI_Feature::setVolume(const std::shared_ptr<ModelAPI_Result>& theResult,
+ const int theIndex)
+{
+ std::list<std::shared_ptr<ModelAPI_Result> >::iterator aResIter = myVolumes.begin();
+ for (int anIndex = 0; anIndex < theIndex; anIndex++) {
+ aResIter++;
+ }
+ if (aResIter == myVolumes.end()) { // append
+ myVolumes.push_back(theResult);
+ } else { // update
+ *aResIter = theResult;
+ }
+ theResult->setDisabled(theResult, false);
+}
+
void ModelAPI_Feature::eraseResultFromList(const std::shared_ptr<ModelAPI_Result>& theResult)
{
std::list<std::shared_ptr<ModelAPI_Result> >::iterator aResIter = myResults.begin();
{
///< list of current results of this feature
std::list<std::shared_ptr<ModelAPI_Result> > myResults;
+ std::list<std::shared_ptr<ModelAPI_Result> > myVolumes;
///< is feature disabled or not
bool myIsDisabled;
///< is feature is stable (not editing)
/// removes the result from the list of feature (not doing in disabled): normally this
/// method is not used from features. only internally
MODELAPI_EXPORT void eraseResultFromList(const std::shared_ptr<ModelAPI_Result>& theResult);
+
+ /// sets the alone volume
+ MODELAPI_EXPORT void setVolume(const std::shared_ptr<ModelAPI_Result>& theResult);
+ /// sets the result by index (zero based), results before this must be set before
+ MODELAPI_EXPORT void setVolume(const std::shared_ptr<ModelAPI_Result>& theResult,
+ const int theIndex);
/// Returns true if result is persistent (stored in document) and on undo-redo, save-open
/// it is not needed to recompute it.
return QObject::tr("Fields");
case GroupsFolder:
return QObject::tr("Groups");
+ case VolumesFolder:
+ return QObject::tr("Volumes");
}
return "NoName";
}
return aConstrIco;
case GroupsFolder:
return aConstrIco;
+ case VolumesFolder:
+ return aConstrIco;
}
}
}
return ModelAPI_ResultField::group();
case GroupsFolder:
return ModelAPI_ResultGroup::group();
+ case VolumesFolder:
+ return ModelAPI_ResultBody::group();
}
return "";
}
myResultsFolder = new PartSet_FolderNode(this, PartSet_FolderNode::ResultsFolder);
myFieldsFolder = new PartSet_FolderNode(this, PartSet_FolderNode::FieldsFolder);
myGroupsFolder = new PartSet_FolderNode(this, PartSet_FolderNode::GroupsFolder);
+ myVolumesFolder = new PartSet_FolderNode(this, PartSet_FolderNode::VolumesFolder);
myChildren.append(myParamsFolder);
myChildren.append(myConstrFolder);
myChildren.append(myResultsFolder);
+ myChildren.append(myVolumesFolder);
update();
}
myResultsFolder->update();
myFieldsFolder->update();
myGroupsFolder->update();
+ myVolumesFolder->update();
bool aHasFields = myFieldsFolder->childrenCount() > 0;
bool aHasGroups = myGroupsFolder->childrenCount() > 0;
PartsFolder,
ResultsFolder,
FieldsFolder,
- GroupsFolder
+ GroupsFolder,
+ VolumesFolder
};
PartSet_FolderNode(ModuleBase_ITreeNode* theParent, FolderType theType);
PartSet_FolderNode* myResultsFolder;
PartSet_FolderNode* myFieldsFolder;
PartSet_FolderNode* myGroupsFolder;
+ PartSet_FolderNode* myVolumesFolder;
ObjectPtr myObject;
};
ResultBodyPtr aResultBox = document()->createBody(data(), aResultIndex);
loadNamingDS(aBoxAlgo, aResultBox);
setResult(aResultBox, aResultIndex);
+ setVolume(aResultBox, aResultIndex);
}
//=================================================================================================