#include <ModelAPI_Document.h>
#include <ModelAPI_Entity.h>
#include <ModelAPI_Feature.h>
+#include <ModelAPI_FiltersFeature.h>
#include <ModelAPI_Folder.h>
#include <ModelAPI_Result.h>
#include <ModelAPI_ResultBody.h>
#include <ModelAPI_ResultConstruction.h>
+#include <ModelAPI_ResultGroup.h>
#include <ModelAPI_ResultPart.h>
#include <ModelAPI_Session.h>
#include <ModelAPI_Tools.h>
if (!aFile.is_open())
return false;
- // standard header (encoding + imported modules)
- aFile << "# -*- coding: utf-8 -*-" << std::endl << std::endl;
+ // standard header imported modules
for (ModulesSet::const_iterator aModIt = theUsedModules.begin();
aModIt != theUsedModules.end(); ++aModIt) {
aFile << "from " << *aModIt << " import *" << std::endl;
if (theAttrSelect->isGeometricalSelection() &&
theShape.get() && theShape->shapeType() == GeomAPI_Shape::COMPOUND &&
theContext.get() && !theShape->isEqual(theContext->shape()) &&
- theContext->groupName() != ModelAPI_ResultPart::group()) {
+ theContext->groupName() != ModelAPI_ResultPart::group() &&
+ theContext->groupName() != ModelAPI_ResultGroup::group()) {
GeomAPI_ShapeIterator anIt(theShape);
theShape = anIt.current();
}
return *this;
}
+ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(const std::list<ResultPtr>& theResults)
+{
+ *this << "[";
+ for (std::list<ResultPtr>::const_iterator anIt = theResults.begin();
+ anIt != theResults.end(); ++anIt) {
+ if (anIt != theResults.begin())
+ *this << ", ";
+ *this << *anIt;
+ }
+ *this << "]";
+ return *this;
+}
+
ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(const ObjectPtr& theObject)
{
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theObject);
// Check the attribute belongs to copied (in multi-translation or multi-rotation) feature.
// In this case we need to cast explicitly feature to appropriate type.
AttributeBooleanPtr isCopy = anOwner->boolean("Copy");
- if (isCopy.get() && isCopy->value()) {
+ AttributeReferencePtr hasParent = anOwner->reference("ParentFeature");
+ if ((isCopy.get() && isCopy->value()) || (hasParent && hasParent->value())) {
aWrapperPrefix = featureWrapper(anOwner) + "(";
aWrapperSuffix = ")";
importModule("SketchAPI");
*this << anAttribute;
}
+ // check selection list is obtained by filters
+ FiltersFeaturePtr aFilters = theAttrSelList->filters();
+ if (aFilters) {
+ if (theAttrSelList->size() > 0)
+ *myDumpStorage << ", ";
+ dumpFeature(aFilters, true);
+ }
+
*myDumpStorage << "]";
} else {
// obtain name of list (the feature may contain several selection lists)