1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModelAPI_Tools.cpp
4 // Created: 06 Aug 2014
5 // Author: Vitaly Smetannikov
7 #include "ModelAPI_Tools.h"
8 #include <ModelAPI_Session.h>
9 #include <ModelAPI_Document.h>
10 #include <ModelAPI_Object.h>
11 #include <ModelAPI_AttributeDouble.h>
12 #include <ModelAPI_ResultParameter.h>
13 #include <ModelAPI_ResultPart.h>
14 #include <ModelAPI_AttributeDocRef.h>
19 #include <Events_Loop.h>
20 #include <ModelAPI_Events.h>
22 #define RECURSE_TOP_LEVEL 50
24 //#define DEBUG_REMOVE_FEATURES
25 //#define DEBUG_REMOVE_FEATURES_RECURSE
26 //#define DEBUG_CYCLING_1550
28 #ifdef DEBUG_REMOVE_FEATURES_RECURSE
30 std::string getFeatureInfo(FeaturePtr theFeature)
32 if (!theFeature.get())
34 //std::ostringstream aPtrStr;
35 //aPtrStr << "[" << theFeature.get() << "] ";
36 std::string aFeatureInfo = /*aPtrStr.str() + */theFeature->name();
37 CompositeFeaturePtr aComposite = ModelAPI_Tools::compositeOwner(theFeature);
38 if (aComposite.get()) {
39 aFeatureInfo = aFeatureInfo + "[in " + aComposite->name() + "]";
45 #ifdef DEBUG_REMOVE_FEATURES
46 void printMapInfo(const std::map<FeaturePtr, std::set<FeaturePtr> >& theMainList,
47 const std::string& thePrefix)
49 std::map<FeaturePtr, std::set<FeaturePtr> >::const_iterator aMainIt = theMainList.begin(),
50 aMainLast = theMainList.end();
52 for (; aMainIt != aMainLast; aMainIt++) {
53 FeaturePtr aMainListFeature = aMainIt->first;
54 std::set<FeaturePtr> aMainRefList = aMainIt->second;
55 std::set<FeaturePtr>::const_iterator anIt = aMainRefList.begin(), aLast = aMainRefList.end();
56 std::string aRefsInfo;
57 for (; anIt != aLast; anIt++) {
58 aRefsInfo += (*anIt)->name().c_str();
62 if (!aRefsInfo.empty()) {
63 anInfo = anInfo + aMainListFeature->name().c_str() + ": " + aRefsInfo + "\n";
66 std::cout << thePrefix.c_str() << " [feature: references to]: \n" << anInfo.c_str() << std::endl;
69 void printListInfo(const std::set<FeaturePtr>& theMainList,
70 const std::string& thePrefix)
72 std::set<FeaturePtr>::const_iterator aMainIt = theMainList.begin(),
73 aMainLast = theMainList.end();
75 for (; aMainIt != aMainLast; aMainIt++) {
76 FeaturePtr aRefFeature = *aMainIt;
77 anInfo += aRefFeature->name().c_str();
78 if (aMainIt != aMainLast)
81 std::cout << thePrefix.c_str() << ": " << anInfo.c_str() << std::endl;
85 namespace ModelAPI_Tools {
87 std::shared_ptr<GeomAPI_Shape> shape(const ResultPtr& theResult)
89 return theResult->shape();
92 const char* toString(ModelAPI_ExecState theExecState)
94 #define TO_STRING(__NAME__) case __NAME__: return #__NAME__;
95 switch (theExecState) {
96 TO_STRING(ModelAPI_StateDone)
97 TO_STRING(ModelAPI_StateMustBeUpdated)
98 TO_STRING(ModelAPI_StateExecFailed)
99 TO_STRING(ModelAPI_StateInvalidArgument)
100 TO_STRING(ModelAPI_StateNothing)
101 default: return "Unknown ExecState.";
106 std::string getFeatureError(const FeaturePtr& theFeature)
109 if (!theFeature.get() || !theFeature->data()->isValid() || theFeature->isAction())
112 // to be removed later, this error should be got from the feature
113 if (theFeature->data()->execState() == ModelAPI_StateDone ||
114 theFeature->data()->execState() == ModelAPI_StateMustBeUpdated)
117 // set error indication
118 anError = theFeature->error();
119 if (anError.empty()) {
120 bool isDone = ( theFeature->data()->execState() == ModelAPI_StateDone
121 || theFeature->data()->execState() == ModelAPI_StateMustBeUpdated );
123 anError = toString(theFeature->data()->execState());
124 // If the feature is Composite and error is StateInvalidArgument,
125 // error text should include error of first invalid sub-feature. Otherwise
126 // it is not clear what is the reason of the invalid argument.
127 if (theFeature->data()->execState() == ModelAPI_StateInvalidArgument) {
128 CompositeFeaturePtr aComposite =
129 std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(theFeature);
131 for (int i = 0, aSize = aComposite->numberOfSubs(); i < aSize; i++) {
132 FeaturePtr aSubFeature = aComposite->subFeature(i);
133 std::string aSubFeatureError = getFeatureError(aSubFeature);
134 if (!aSubFeatureError.empty()) {
135 anError = anError + " in " + aSubFeature->getKind() + ".\n" + aSubFeatureError;
147 ObjectPtr objectByName(const DocumentPtr& theDocument, const std::string& theGroup, const std::string& theName)
149 for (int anIndex = 0; anIndex < theDocument->size(theGroup); ++anIndex) {
150 ObjectPtr anObject = theDocument->object(theGroup, anIndex);
151 if (anObject->data()->name() == theName)
158 bool findVariable(const DocumentPtr& theDocument, FeaturePtr theSearcher,
159 const std::string& theName, double& outValue, ResultParameterPtr& theParam)
161 ObjectPtr aParamObj = objectByName(theDocument, ModelAPI_ResultParameter::group(), theName);
162 theParam = std::dynamic_pointer_cast<ModelAPI_ResultParameter>(aParamObj);
165 // avoid usage of parameters created later than the initial parameter
166 if (theSearcher.get() && theDocument->isLater(theDocument->feature(theParam), theSearcher))
168 AttributeDoublePtr aValueAttribute = theParam->data()->real(ModelAPI_ResultParameter::VALUE());
169 outValue = aValueAttribute->value();
173 bool findVariable(FeaturePtr theSearcher, const std::string& theName, double& outValue, ResultParameterPtr& theParam,
174 const DocumentPtr& theDocument)
176 SessionPtr aSession = ModelAPI_Session::get();
177 std::list<DocumentPtr> aDocList;
178 DocumentPtr aDocument = theDocument.get() ? theDocument : aSession->activeDocument();
179 if (findVariable(aDocument, theSearcher, theName, outValue, theParam))
181 DocumentPtr aRootDocument = aSession->moduleDocument();
182 if (aDocument != aRootDocument) {
183 // any parameters in PartSet is okindependently on the Part position (issu #1504)
184 if (findVariable(aRootDocument, FeaturePtr(), theName, outValue, theParam))
190 static std::map<int, std::vector<int> > myColorMap;
192 void appendValues(std::vector<int>& theRGB, const int theRed, const int theGreen, const int theBlue)
194 theRGB.push_back(theRed);
195 theRGB.push_back(theGreen);
196 theRGB.push_back(theBlue);
199 bool containsValues(std::map<int, std::vector<int> >& theColorMap, std::vector<int>& theValues)
201 std::map<int, std::vector<int> >::const_iterator anIt = theColorMap.begin(), aLast = theColorMap.end();
202 bool isFound = false;
203 for (; anIt != aLast && !isFound; anIt++) {
204 std::vector<int> aValues = anIt->second;
205 isFound = aValues[0] == theValues[0] &&
206 aValues[1] == theValues[1] &&
207 aValues[2] == theValues[2];
212 std::vector<int> HSVtoRGB(int theH, int theS, int theV)
214 std::vector<int> aRGB;
215 if (theH < 0 || theH > 360 ||
216 theS < 0 || theS > 100 ||
217 theV < 0 || theV > 100)
220 int aHi = (int)theH/60;
223 double aVmin = (100 - theS)*theV/100;
225 double anA = (theV - aVmin)* (theH % 60) / 60;
227 double aVinc = aVmin + anA;
228 double aVdec = theV - anA;
230 double aPercentToValue = 255./100;
231 int aV_int = (int)(aV*aPercentToValue);
232 int aVinc_int = (int)(aVinc*aPercentToValue);
233 int aVmin_int = (int)(aVmin*aPercentToValue);
234 int aVdec_int = (int)(aVdec*aPercentToValue);
237 case 0: appendValues(aRGB, aV_int, aVinc_int, aVmin_int); break;
238 case 1: appendValues(aRGB, aVdec_int, aV_int, aVmin_int); break;
239 case 2: appendValues(aRGB, aVmin_int, aV_int, aVinc_int); break;
240 case 3: appendValues(aRGB, aVmin_int, aVdec_int, aV_int); break;
241 case 4: appendValues(aRGB, aVinc_int, aVmin_int, aV_int); break;
242 case 5: appendValues(aRGB, aV_int, aVmin_int, aVdec_int); break;
251 if (!myColorMap.empty())
255 for (int s = 100; s > 0; s = s - 50)
257 for (int v = 100; v >= 40; v = v - 20)
259 for (int h = 0; h < 359 ; h = h + 60)
261 std::vector<int> aColor = HSVtoRGB(h, s, v);
262 if (containsValues(myColorMap, aColor))
264 myColorMap[i] = aColor;
271 void findRandomColor(std::vector<int>& theValues)
274 if (myColorMap.empty()) {
278 size_t aSize = myColorMap.size();
279 int anIndex = rand() % aSize;
280 if (myColorMap.find(anIndex) != myColorMap.end()) {
281 theValues = myColorMap.at(anIndex);
285 ResultPtr findPartResult(const DocumentPtr& theMain, const DocumentPtr& theSub)
287 if (theMain != theSub) { // to optimize and avoid of crash on partset document close (don't touch the sub-document structure)
288 for (int a = theMain->size(ModelAPI_ResultPart::group()) - 1; a >= 0; a--) {
289 ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(
290 theMain->object(ModelAPI_ResultPart::group(), a));
291 if (aPart && aPart->data()->document(ModelAPI_ResultPart::DOC_REF())->value() == theSub) {
299 FeaturePtr findPartFeature(const DocumentPtr& theMain, const DocumentPtr& theSub)
301 if (theMain != theSub) { // to optimize and avoid of crash on partset document close (don't touch the sub-document structure)
302 for (int a = theMain->size(ModelAPI_Feature::group()) - 1; a >= 0; a--) {
303 FeaturePtr aPartFeat = std::dynamic_pointer_cast<ModelAPI_Feature>(
304 theMain->object(ModelAPI_Feature::group(), a));
305 if (aPartFeat.get()) {
306 const std::list<std::shared_ptr<ModelAPI_Result> >& aResList = aPartFeat->results();
307 std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRes = aResList.begin();
308 for(; aRes != aResList.end(); aRes++) {
309 ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(*aRes);
311 if (aPart->isActivated() && aPart->partDoc() == theSub)
313 } else break; // if the first is not Part, others are also not
321 CompositeFeaturePtr compositeOwner(const FeaturePtr& theFeature)
323 if (theFeature.get() && theFeature->data()->isValid()) {
324 const std::set<std::shared_ptr<ModelAPI_Attribute> >& aRefs = theFeature->data()->refsToMe();
325 std::set<std::shared_ptr<ModelAPI_Attribute> >::const_iterator aRefIter = aRefs.begin();
326 for(; aRefIter != aRefs.end(); aRefIter++) {
327 CompositeFeaturePtr aComp = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>
328 ((*aRefIter)->owner());
329 if (aComp.get() && aComp->data()->isValid() && aComp->isSub(theFeature))
333 return CompositeFeaturePtr(); // not found
336 ResultCompSolidPtr compSolidOwner(const ResultPtr& theSub)
338 ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(theSub);
340 FeaturePtr aFeatureOwner = aBody->document()->feature(aBody);
341 if (aFeatureOwner.get()) {
342 std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aResIter =
343 aFeatureOwner->results().cbegin();
344 for(; aResIter != aFeatureOwner->results().cend(); aResIter++) {
345 ResultCompSolidPtr aComp = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(*aResIter);
346 if (aComp && aComp->isSub(aBody))
351 return ResultCompSolidPtr(); // not found
354 bool hasSubResults(const ResultPtr& theResult)
356 ResultCompSolidPtr aCompSolid = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(theResult);
357 return aCompSolid.get() && aCompSolid->numberOfSubs() > 0;
360 void allResults(const FeaturePtr& theFeature, std::list<ResultPtr>& theResults)
362 const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = theFeature->results();
363 std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRIter = aResults.begin();
364 for (; aRIter != aResults.cend(); aRIter++) {
365 theResults.push_back(*aRIter);
366 // iterate sub-bodies of compsolid
367 ResultCompSolidPtr aComp = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(*aRIter);
369 int aNumSub = aComp->numberOfSubs();
370 for(int a = 0; a < aNumSub; a++) {
371 theResults.push_back(aComp->subResult(a));
377 //******************************************************************
378 bool allDocumentsActivated(std::string& theNotActivatedNames)
380 theNotActivatedNames = "";
381 bool anAllPartActivated = true;
383 DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
384 int aSize = aRootDoc->size(ModelAPI_ResultPart::group());
385 for (int i = 0; i < aSize; i++) {
386 ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultPart::group(), i);
387 ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aObject);
388 if (!aPart->isActivated()) {
389 anAllPartActivated = false;
390 if (!theNotActivatedNames.empty())
391 theNotActivatedNames += ", ";
392 theNotActivatedNames += aObject->data()->name().c_str();
395 return anAllPartActivated;
398 bool removeFeaturesAndReferences(const std::set<FeaturePtr>& theFeatures,
399 const bool theFlushRedisplay,
400 const bool theUseComposite,
401 const bool theUseRecursion)
403 #ifdef DEBUG_REMOVE_FEATURES
404 printListInfo(theFeatures, "selection: ");
407 std::map<FeaturePtr, std::set<FeaturePtr> > aReferences;
408 ModelAPI_Tools::findAllReferences(theFeatures, aReferences, theUseComposite, theUseRecursion);
409 #ifdef DEBUG_REMOVE_FEATURES
410 printMapInfo(aReferences, "allDependencies: ");
413 std::set<FeaturePtr> aFeaturesRefsTo;
414 ModelAPI_Tools::findRefsToFeatures(theFeatures, aReferences, aFeaturesRefsTo);
415 #ifdef DEBUG_REMOVE_FEATURES
416 printListInfo(aFeaturesRefsTo, "references: ");
419 std::set<FeaturePtr> aFeatures = theFeatures;
420 if (!aFeaturesRefsTo.empty())
421 aFeatures.insert(aFeaturesRefsTo.begin(), aFeaturesRefsTo.end());
422 #ifdef DEBUG_REMOVE_FEATURES
423 printListInfo(aFeatures, "removeFeatures: ");
426 return ModelAPI_Tools::removeFeatures(aFeatures, false);
429 bool removeFeatures(const std::set<FeaturePtr>& theFeatures,
430 const bool theFlushRedisplay)
433 std::set<FeaturePtr>::const_iterator anIt = theFeatures.begin(),
434 aLast = theFeatures.end();
435 for (; anIt != aLast; anIt++) {
436 FeaturePtr aFeature = *anIt;
437 if (aFeature.get()) {
438 DocumentPtr aDoc = aFeature->document();
439 // flush REDISPLAY signal after remove feature
440 aDoc->removeFeature(aFeature);
444 if (isDone && theFlushRedisplay) {
445 // the redisplay signal should be flushed in order to erase the feature presentation in the viewer
446 // if should be done after removeFeature() of document
447 Events_Loop::loop()->flush(Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
452 // Fills the references list by all references of the feature from the references map.
453 // This is a recusive method to find references by next found feature in the map of references.
454 // \param theFeature a feature to find references
455 // \param theReferencesMap a map of references
456 // \param theReferences an out container of references
457 void addRefsToFeature(const FeaturePtr& theFeature,
458 const std::map<FeaturePtr, std::set<FeaturePtr> >& theReferencesMap,
459 std::map<FeaturePtr, std::set<FeaturePtr> >& theProcessedReferences,
461 std::set<FeaturePtr>& theReferences)
463 if (theRecLevel > RECURSE_TOP_LEVEL)
467 // if the feature is already processed, get the ready references from the map
468 if (theProcessedReferences.find(theFeature) != theProcessedReferences.end()) {
469 std::set<FeaturePtr> aReferences = theProcessedReferences.at(theFeature);
470 theReferences.insert(aReferences.begin(), aReferences.end());
474 if (theReferencesMap.find(theFeature) == theReferencesMap.end())
475 return; // this feature is not in the selection list, so exists without references to it
476 std::set<FeaturePtr> aMainReferences = theReferencesMap.at(theFeature);
478 std::set<FeaturePtr>::const_iterator anIt = aMainReferences.begin(),
479 aLast = aMainReferences.end();
480 #ifdef DEBUG_REMOVE_FEATURES_RECURSE
481 std::string aSpacing;
482 for (int i = 0; i < theRecLevel; i++)
483 aSpacing.append(" ");
486 for (; anIt != aLast; anIt++) {
487 FeaturePtr aRefFeature = *anIt;
488 #ifdef DEBUG_REMOVE_FEATURES_RECURSE
489 std::cout << aSpacing << " Ref: " << getFeatureInfo(aRefFeature) << std::endl;
491 if (theReferences.find(aRefFeature) == theReferences.end())
492 theReferences.insert(aRefFeature);
493 addRefsToFeature(aRefFeature, theReferencesMap, theProcessedReferences, theRecLevel, theReferences);
497 // For each feature from the feature list it searches references to the feature and append them
498 // to the references map. This is a recusive method.
499 // \param theFeature a feature to find references
500 // \param theReferencesMap a map of references
501 // \param theReferences an out container of references
502 void findReferences(const std::set<FeaturePtr>& theFeatures,
503 std::map<FeaturePtr, std::set<FeaturePtr> >& theReferences,
504 const bool theUseComposite, const bool theUseRecursion, int theRecLevel)
506 if (theRecLevel > RECURSE_TOP_LEVEL)
509 std::set<FeaturePtr>::const_iterator anIt = theFeatures.begin(),
510 aLast = theFeatures.end();
511 for (; anIt != aLast; anIt++) {
512 FeaturePtr aFeature = *anIt;
513 if (aFeature.get() && theReferences.find(aFeature) == theReferences.end()) {
514 DocumentPtr aSelFeatureDoc = aFeature->document();
515 std::set<FeaturePtr> aSelRefFeatures;
516 aSelFeatureDoc->refsToFeature(aFeature, aSelRefFeatures, false/*do not emit signals*/);
517 if (theUseComposite) { // do not filter selection
518 theReferences[aFeature] = aSelRefFeatures;
520 else { // filter references to skip composition features of the current feature
521 std::set<FeaturePtr> aFilteredFeatures;
522 std::set<FeaturePtr>::const_iterator anIt = aSelRefFeatures.begin(),
523 aLast = aSelRefFeatures.end();
524 for (; anIt != aLast; anIt++) {
525 FeaturePtr aCFeature = *anIt;
526 CompositeFeaturePtr aComposite = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aCFeature);
527 if (aComposite.get() && aComposite->isSub(aFeature))
528 continue; /// composite of the current feature should be skipped
529 aFilteredFeatures.insert(aCFeature);
531 theReferences[aFeature] = aFilteredFeatures;
533 if (theUseRecursion) {
534 #ifdef DEBUG_CYCLING_1550
535 findReferences(aSelRefFeatures, theReferences, theUseComposite, theUseRecursion, theRecLevel);
537 findReferences(theReferences[aFeature], theReferences, theUseComposite, theUseRecursion,
545 void findAllReferences(const std::set<FeaturePtr>& theFeatures,
546 std::map<FeaturePtr, std::set<FeaturePtr> >& theReferences,
547 const bool theUseComposite,
548 const bool theUseRecursion)
550 // For dependencies, find main_list:
551 // sk_1(ext_1, vertex_1)
552 // ext_1(bool_1, sk_3)
557 // Information: bool_1 is not selected, ext_2(bool_2) exists
558 // find all referenced features
559 std::map<FeaturePtr, std::set<FeaturePtr> > aMainList;
561 findReferences(theFeatures, aMainList, theUseComposite, theUseRecursion, aRecLevel);
563 #ifdef DEBUG_REMOVE_FEATURES
564 printMapInfo(aMainList, "firstDependencies");
566 // find all dependencies for each object:
567 // sk_1(ext_1, vertex_1) + (sk_3, bool_1)
568 // ext_1(bool_1, sk_3)
570 // sk_2(ext_2) + (bool_1)
573 std::map<FeaturePtr, std::set<FeaturePtr> >::const_iterator aMainIt = aMainList.begin(),
574 aMainLast = aMainList.end();
575 for (; aMainIt != aMainLast; aMainIt++) {
576 FeaturePtr aMainListFeature = aMainIt->first;
578 //std::string aName = aMainListFeature->name();
579 std::set<FeaturePtr> aMainRefList = aMainIt->second;
581 #ifdef DEBUG_REMOVE_FEATURES_RECURSE
583 int n = sprintf(aBuf, "%d", aMainRefList.size());
584 std::string aSize(aBuf);
585 std::cout << "_findAllReferences for the Feature: " << getFeatureInfo(aMainListFeature)
586 << ", references size = " << aSize << std::endl;
588 std::set<FeaturePtr>::const_iterator anIt = aMainRefList.begin(),
589 aLast = aMainRefList.end();
590 std::set<FeaturePtr> aResultRefList;
591 aResultRefList.insert(aMainRefList.begin(), aMainRefList.end());
592 for (; anIt != aLast; anIt++) {
593 FeaturePtr aFeature = *anIt;
595 #ifdef DEBUG_REMOVE_FEATURES_RECURSE
596 std::cout << " Ref: " << getFeatureInfo(aFeature) << std::endl;
599 addRefsToFeature(aFeature, aMainList, theReferences, aRecLevel, aResultRefList/*aMainRefList*/);
601 theReferences[aMainListFeature] = aResultRefList;
603 #ifdef DEBUG_REMOVE_FEATURES_RECURSE
604 std::cout << std::endl;
607 #ifdef DEBUG_REMOVE_FEATURES
608 printMapInfo(theReferences, "allDependencies");
612 void findRefsToFeatures(const std::set<FeaturePtr>& theFeatures,
613 const std::map<FeaturePtr, std::set<FeaturePtr> >& theReferences,
614 std::set<FeaturePtr>& theFeaturesRefsTo)
616 std::set<FeaturePtr>::const_iterator anIt = theFeatures.begin(),
617 aLast = theFeatures.end();
618 for (; anIt != aLast; anIt++) {
619 FeaturePtr aFeature = *anIt;
620 if (theReferences.find(aFeature) == theReferences.end())
622 std::set<FeaturePtr> aRefList = theReferences.at(aFeature);
623 std::set<FeaturePtr>::const_iterator aRefIt = aRefList.begin(), aRefLast = aRefList.end();
624 for (; aRefIt != aRefLast; aRefIt++) {
625 FeaturePtr aRefFeature = *aRefIt;
626 CompositeFeaturePtr aComposite = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aRefFeature);
627 if (aComposite.get() && aComposite->isSub(aFeature))
628 continue; /// composite of the current feature should not be removed
630 if (theFeatures.find(aRefFeature) == theFeatures.end() && // it is not selected
631 theFeaturesRefsTo.find(aRefFeature) == theFeaturesRefsTo.end()) // it is not added
632 theFeaturesRefsTo.insert(aRefFeature);
637 } // namespace ModelAPI_Tools