- if (theOtherEntity->isExternal()) {
- if (hasExternal()) {
- if (myExternalAndConnected.find(theOtherEntity) == myExternalAndConnected.end())
- myExternalAndConnected[theOtherEntity] = std::set<EntityWrapperPtr>();
- // check whether all external entities are edges
- bool isNewCoinc = true;
- std::map<EntityWrapperPtr, std::set<EntityWrapperPtr> >::iterator
- anIt = myExternalAndConnected.begin();
- for (; anIt != myExternalAndConnected.end() && isNewCoinc; ++anIt)
- isNewCoinc = (anIt->first->type() != ENTITY_POINT);
- return isNewCoinc;
- } else {
- myExternalAndConnected[theOtherEntity] = myExternalAndConnected[EntityWrapperPtr()];
- myExternalAndConnected.erase(EntityWrapperPtr());
- return true;
- }
- }
-
- if (theEntityExist->isExternal()) {
- myExternalAndConnected[theEntityExist].insert(theOtherEntity);
- return true;
- }
+ bool isAdded = true;
+ if (theEntity->type() == ENTITY_POINT) {
+ if (theEntity->isExternal()) {
+ isAdded = !hasSamePoint(myExternalPoints, theEntity);
+ myExternalPoints.insert(theEntity);
+ } else
+ myPoints.insert(theEntity);
+ } else
+ myFeatures.insert(theEntity);
+ return isAdded;
+}