+ if (_coordsEnfVertexMap.count(coords) > 0)
+ return _coordsEnfVertexMap[coords];
+
+ std::ostringstream msg;
+ msg << "No enforced vertex with coords (" << coords[0] << ", " << coords[1] << ", " << coords[2] << ")";
+ throw std::invalid_argument(msg.str());
+}
+
+//=======================================================================
+//function : GetEnfVertex(const TEntry& theEnfVertexEntry)
+//=======================================================================
+
+BLSURFPlugin_Hypothesis::TEnfVertex* BLSURFPlugin_Hypothesis::GetEnfVertex(const TEntry& theEnfVertexEntry)
+ throw (std::invalid_argument) {
+
+ if (_enfVertexEntryEnfVertexMap.count(theEnfVertexEntry) > 0)
+ return _enfVertexEntryEnfVertexMap[theEnfVertexEntry];
+
+ std::ostringstream msg;
+ msg << "No enforced vertex with entry " << theEnfVertexEntry;
+ throw std::invalid_argument(msg.str());
+}
+
+//=======================================================================
+//function : ClearEnforcedVertex
+//=======================================================================
+
+bool BLSURFPlugin_Hypothesis::ClearEnforcedVertex(const TEntry& theFaceEntry, double x, double y, double z,
+ const TEntry& theVertexEntry) throw (std::invalid_argument) {
+
+ bool toNotify = false;
+ std::ostringstream msg;
+ TEnfVertex *oldEnfVertex;
+ TEnfVertexCoords coords;
+ coords.clear();
+ coords.push_back(x);
+ coords.push_back(y);
+ coords.push_back(z);
+
+ // check that enf vertex with given enf vertex entry exists
+ TEnfVertexEntryEnfVertexMap::iterator it_enfVertexEntry = _enfVertexEntryEnfVertexMap.find(theVertexEntry);
+ if (it_enfVertexEntry != _enfVertexEntryEnfVertexMap.end()) {
+ // Success
+ MESSAGE("Found enforced vertex with geom entry " << theVertexEntry);
+ oldEnfVertex = it_enfVertexEntry->second;
+
+ _enfVertexEntryEnfVertexMap.erase(it_enfVertexEntry);
+
+ TEntryList& enfVertexEntryList = _faceEntryEnfVertexEntryListMap[theFaceEntry];
+ enfVertexEntryList.erase(theVertexEntry);
+ if (enfVertexEntryList.size() == 0)
+ _faceEntryEnfVertexEntryListMap.erase(theFaceEntry);
+ // TFaceEntryEnfVertexEntryListMap::iterator it_entry_entry = _faceEntryEnfVertexEntryListMap.find(theFaceEntry);
+ // TEntryList::iterator it_entryList = it_entry_entry->second.find(theVertexEntry);
+ // it_entry_entry->second.erase(it_entryList);
+ // if (it_entry_entry->second.size() == 0)
+ // _faceEntryEnfVertexEntryListMap.erase(it_entry_entry);
+ } else {
+ // Fail
+ MESSAGE("Enforced vertex with geom entry " << theVertexEntry << " not found");
+ msg << "No enforced vertex with geom entry " << theVertexEntry;
+ // check that enf vertex with given coords exists
+ TCoordsEnfVertexMap::iterator it_coords_enf = _coordsEnfVertexMap.find(coords);
+ if (it_coords_enf != _coordsEnfVertexMap.end()) {
+ // Success
+ MESSAGE("Found enforced vertex with coords " << x << ", " << y << ", " << z);
+ oldEnfVertex = it_coords_enf->second;
+
+ _coordsEnfVertexMap.erase(it_coords_enf);
+
+ TEnfVertexCoordsList& enfVertexCoordsList = _faceEntryCoordsListMap[theFaceEntry];
+ enfVertexCoordsList.erase(coords);
+ if (enfVertexCoordsList.size() == 0)
+ _faceEntryCoordsListMap.erase(theFaceEntry);
+ // TFaceEntryCoordsListMap::iterator it_entry_coords = _faceEntryCoordsListMap.find(theFaceEntry);
+ // TEnfVertexCoordsList::iterator it_coordsList = it_entry_coords->second.find(coords);
+ // it_entry_coords->second.erase(it_coordsList);
+ // if (it_entry_coords->second.size() == 0)
+ // _faceEntryCoordsListMap.erase(it_entry_coords);
+ } else {
+ // Fail
+ MESSAGE("Enforced vertex with coords " << x << ", " << y << ", " << z << " not found");
+ msg << std::endl;
+ msg << "No enforced vertex at " << x << ", " << y << ", " << z;
+ throw std::invalid_argument(msg.str());