{
TCollection_ExtendedString aPath((const Standard_CString) theFileName);
// remove end-separators
- while(aPath.Length() && (aPath.Value(aPath.Length()) == '\\' || aPath.Value(aPath.Length()) == '/'))
+ while(aPath.Length() &&
+ (aPath.Value(aPath.Length()) == '\\' || aPath.Value(aPath.Length()) == '/'))
aPath.Remove(aPath.Length());
aPath += _separator_;
aPath += theID.c_str();
/// Appenad to the array of references a new referenced label.
/// If theIndex is not -1, removes element at this index, not theReferenced.
/// \returns the index of removed element
-static int RemoveFromRefArray(TDF_Label theArrayLab, TDF_Label theReferenced, const int theIndex =
- -1)
+static int RemoveFromRefArray(TDF_Label theArrayLab, TDF_Label theReferenced,
+ const int theIndex = -1)
{
int aResult = -1; // no returned
Handle(TDataStd_ReferenceArray) aRefs;
static Events_ID aCreateEvent = Events_Loop::eventByName(EVENT_OBJECT_CREATED);
static Events_ID anUpdateEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
- static Events_ID aDeleteEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
+ static Events_ID aDeleteEvent = Events_Loop::eventByName(EVENT_OBJECT_DELETED);
static Events_ID aToHideEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
aLoop->activateFlushes(false);
- // update all objects by checking are they of labels or not
+ // update all objects by checking are they on labels or not
std::set<FeaturePtr> aNewFeatures, aKeptFeatures;
TDF_ChildIDIterator aLabIter(featuresLabel(), TDataStd_Comment::GetID());
for (; aLabIter.More(); aLabIter.Next()) {
if (aFData) {
std::list<std::pair<std::string, std::list<ObjectPtr> > > aRefs;
aFData->referencesToObjects(aRefs);
- std::list<std::pair<std::string, std::list<ObjectPtr> > >::iterator aRefsIter = aRefs.begin();
+ std::list<std::pair<std::string, std::list<ObjectPtr> > >::iterator
+ aRefsIter = aRefs.begin();
for(; aRefsIter != aRefs.end(); aRefsIter++) {
std::list<ObjectPtr>::iterator aRefTo = aRefsIter->second.begin();
for(; aRefTo != aRefsIter->second.end(); aRefTo++) {
theResult->setDoc(aThis);
initData(theResult, resultLabel(theFeatureData, theResultIndex), TAG_FEATURE_ARGUMENTS);
if (theResult->data()->name().empty()) { // if was not initialized, generate event and set a name
- theResult->data()->setName(theFeatureData->name());
+ std::stringstream aNewName;
+ aNewName<<theFeatureData->name();
+ if (theResultIndex > 0) // if there are several results, add unique prefix starting from second
+ aNewName<<"_"<<theResultIndex + 1;
+ theResult->data()->setName(aNewName.str());
}
}