-// Copyright (C) 2014-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
return SketchAPI_SketchEntity::wrap(anIntermediate);
}
+std::list<std::shared_ptr<SketchAPI_SketchEntity> > SketchAPI_Rotation::rotatedList() const
+{
+ std::list<ObjectPtr> aList = rotationList()->list();
+ std::set<ObjectPtr> anOriginalObjects;
+ anOriginalObjects.insert(aList.begin(), aList.end());
+ // remove all initial features
+ std::list<FeaturePtr> anIntermediate;
+ aList = rotatedObjects()->list();
+ std::list<ObjectPtr>::const_iterator anIt = aList.begin();
+ for (; anIt != aList.end(); ++anIt) {
+ if (anOriginalObjects.find(*anIt) != anOriginalObjects.end())
+ continue; // skip initial object
+ FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt);
+ AttributeBooleanPtr isCopy = aFeature->boolean(SketchPlugin_SketchEntity::COPY_ID());
+ if (isCopy.get() && isCopy->value())
+ anIntermediate.push_back(aFeature);
+ }
+ return SketchAPI_SketchEntity::wrap(anIntermediate);
+}
+
//--------------------------------------------------------------------------------------
void SketchAPI_Rotation::dump(ModelHighAPI_Dumper& theDumper) const
// Dump variables for a list of rotated features
theDumper << "[";
- std::list<std::shared_ptr<SketchAPI_SketchEntity> > aList = rotated();
+ std::list<std::shared_ptr<SketchAPI_SketchEntity> > aList = rotatedList();
std::list<std::shared_ptr<SketchAPI_SketchEntity> >::const_iterator anIt = aList.begin();
for (size_t anIndex = 0; anIndex < aFirstNotDumped; ++anIndex)
for (int i = 1; i < aNbCopies->value() && anIt != aList.end(); ++i, ++anIt) {
theDumper << ", ";
theDumper << (*anIt)->feature();
}
- theDumper << "] = " << theDumper.name(aBase) << ".rotated()" << std::endl;
+ theDumper << "] = " << theDumper.name(aBase) << ".rotatedList()" << std::endl;
if (theDumper.isDumped(aRotObjects)) {
aNbDumpedArguments.erase(aBase);