{
return TDF_LabelMapHasher::IsEqual(theLab1, theLab2);
}
+
+void Model_Document::addNamingName(const TDF_Label theLabel, std::string theName)
+{
+ myNamingNames[theName] = theLabel;
+}
+
+TDF_Label Model_Document::findNamingName(std::string theName)
+{
+ std::map<std::string, TDF_Label>::iterator aFind = myNamingNames.find(theName);
+ if (aFind == myNamingNames.end())
+ return TDF_Label(); // not found
+ return aFind->second;
+}
///! On abort, undo or redo it is not necessary: results in document are updated automatically
bool executeFeatures() {return myExecuteFeatures;}
+ //! Registers the name of the shape for the topological naming needs
+ void addNamingName(const TDF_Label theLabel, std::string theName);
+ //! Returns the label, keeper of the name for the topological naming needs
+ TDF_Label findNamingName(std::string theName);
+
protected:
//! Returns (creates if needed) the features label
/// All features managed by this document (not only in history of OB)
/// For optimization mapped by labels
NCollection_DataMap<TDF_Label, FeaturePtr> myObjs;
+ /// Optimization for finding the shape-label by topological naming names
+ std::map<std::string, TDF_Label> myNamingNames;
///< set of identifiers of sub-documents of this document
std::set<std::string> mySubs;
template<class T1, class T2> std::shared_ptr<T1> shared_ptr_cast(std::shared_ptr<T2> theObject);
%template(modelAPI_CompositeFeature) shared_ptr_cast<ModelAPI_CompositeFeature, ModelAPI_Feature>;
+%template(modelAPI_Feature) shared_ptr_cast<ModelAPI_Feature, ModelAPI_Object>;
%template(modelAPI_ResultConstruction) shared_ptr_cast<ModelAPI_ResultConstruction, ModelAPI_Result>;
%template(modelAPI_ResultBody) shared_ptr_cast<ModelAPI_ResultBody, ModelAPI_Result>;
%template(modelAPI_ResultPart) shared_ptr_cast<ModelAPI_ResultPart, ModelAPI_Result>;
-
-
+%template(modelAPI_ResultGroup) shared_ptr_cast<ModelAPI_ResultPart, ModelAPI_ResultGroup>;