std::size_t aPartEnd = aSubShapeName.find('/');
if (aPartEnd != std::string::npos && aPartEnd != aSubShapeName.rfind('/')) {
std::string aNameInPart = aSubShapeName.substr(aPartEnd + 1);
- int anIndex;
+ int anInd;
std::string aType; // to reuse already existing selection the type is not needed
- return aPart->shapeInPart(aNameInPart, aType, anIndex);
+ return aPart->shapeInPart(aNameInPart, aType, anInd);
}
}
}
aSubSh->setImpl(new TopoDS_Shape(aSub.Value()));
setValue(theContext, aSubSh);
for(aSub.Next(); aSub.More(); aSub.Next()) {
- GeomShapePtr aSubSh(new GeomAPI_Shape);
+ aSubSh.reset(new GeomAPI_Shape);
aSubSh->setImpl(new TopoDS_Shape(aSub.Value()));
myParent->append(theContext, aSubSh);
}
std::string Model_AttributeSelection::namingName(const std::string& theDefaultName)
{
- std::string aName("");
+ std::string aName;
if(!this->isInitialized())
return !theDefaultName.empty() ? theDefaultName : aName;
GeomShapePtr aShape = value();
if (!aShape.get() && context().get())
aShape = context()->shape();
- std::string aName;
if (aShape.get()) {
aName = aShape->shapeTypeStr();
if (myParent) {
NCollection_DataMap<TopoDS_Shape, TopTools_MapOfShape, TopTools_ShapeMapHasher> aSubs;
TopTools_DataMapOfShapeShape::Iterator aContIter(aNewToOld);
for(; aContIter.More(); aContIter.Next()) {
- TopExp_Explorer aSubExp(aContIter.Key(), aValType);
- for(; aSubExp.More(); aSubExp.Next()) {
+ for(aSubExp.Init(aContIter.Key(), aValType); aSubExp.More(); aSubExp.Next()) {
if (!aSubs.IsBound(aSubExp.Current())) {
aSubs.Bind(aSubExp.Current(), TopTools_MapOfShape());
}
TopTools_ListOfShape aValShapes;
if (searchNewContext(aDoc, aNewCShape, aContext, aValShape, aContLab, aNewContexts, aValShapes))
{
- std::set<ResultPtr> allContexts, aSkippedContext;
- std::list<ResultPtr>::iterator aNewContext = aNewContexts.begin();
- for(; aNewContext != aNewContexts.end(); aNewContext++)
- allContexts.insert(*aNewContext);
+ std::set<ResultPtr> allContexts(aNewContexts.begin(), aNewContexts.end());
+ std::set<ResultPtr> aSkippedContext;
// if there exist context composite and sub-result(s), leave only sub(s)
std::set<ResultPtr>::iterator aResIter = allContexts.begin();
if (theName.find(aDoc->kind()) == 0) { // remove the document identifier from name if exists
aSubShapeName = theName.substr(aDoc->kind().size() + 1);
aName = aSubShapeName;
- std::string::size_type n = aName.find('/');
+ n = aName.find('/');
if (n != std::string::npos) {
aName = aName.substr(0, n);
}