if (aObjects.size() == 1) {
std::set<ObjectPtr>::const_iterator aIt;
for (aIt = aObjects.cbegin(); aIt != aObjects.cend(); aIt++) {
- std::shared_ptr<SketchPlugin_Feature> aFeature =
- std::dynamic_pointer_cast<SketchPlugin_Feature>(*aIt);
+ CompositeFeaturePtr aFeature =
+ std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(*aIt);
if (aFeature) {
SketchGroupPtr aGroup = findGroup(aFeature);
aFeatures.push_back(*aIt);
}
- // TODO: send features to GUI
+ // send features to GUI
static const Events_ID anEvent = Events_Loop::eventByName(EVENT_DOF_OBJECTS);
ModelAPI_EventCreator::get()->sendUpdated(aFeatures, anEvent);
Events_Loop::loop()->flush(anEvent);
// Purpose: search groups of entities interacting with given feature
// ============================================================================
SketchGroupPtr SketchSolver_Manager::findGroup(
- std::shared_ptr<SketchPlugin_Feature> theFeature)
+ std::shared_ptr<SketchPlugin_Feature> theFeature)
{
if (!isFeatureValid(theFeature))
return SketchGroupPtr(); // do not process wrong features
break;
}
}
+ return findGroup(aSketch);
+}
- if (!aSketch)
+SketchGroupPtr SketchSolver_Manager::findGroup(CompositeFeaturePtr theSketch)
+{
+ if (!theSketch)
return SketchGroupPtr(); // not a sketch's feature
std::list<SketchGroupPtr>::const_iterator aGroupIt;
for (aGroupIt = myGroups.begin(); aGroupIt != myGroups.end(); ++aGroupIt)
- if ((*aGroupIt)->getWorkplane() == aSketch)
+ if ((*aGroupIt)->getWorkplane() == theSketch)
return *aGroupIt;
// group for the sketch does not created yet
- SketchGroupPtr aNewGroup = SketchGroupPtr(new SketchSolver_Group(aSketch));
+ SketchGroupPtr aNewGroup = SketchGroupPtr(new SketchSolver_Group(theSketch));
myGroups.push_back(aNewGroup);
return aNewGroup;
}