+//=============================================================================
+/*!
+ * GetHistoryEntry
+ */
+//=============================================================================
+TDF_Label GEOM_Function::GetHistoryEntry (const Standard_Boolean create)
+{
+ return _label.FindChild(HISTORY_LABEL, create);
+}
+
+//=============================================================================
+/*!
+ * GetArgumentHistoryEntry
+ */
+//=============================================================================
+TDF_Label GEOM_Function::GetArgumentHistoryEntry (const TDF_Label& theArgumentRefEntry,
+ const Standard_Boolean create)
+{
+ TColStd_ListOfInteger anArgumentRefTags;
+ TDF_Tool::TagList(theArgumentRefEntry, anArgumentRefTags);
+ Standard_Integer anArgumentRefLabelPos = anArgumentRefTags.Extent();
+
+ TDF_Label aHistoryLabel = GetHistoryEntry(create);
+ if (aHistoryLabel.IsNull())
+ return aHistoryLabel;
+ Standard_Integer aHistoryLabelPos = aHistoryLabel.Depth() + 1;
+
+ Standard_Integer itag;
+ TDF_Label aHistoryCurLabel = aHistoryLabel;
+ TColStd_ListIteratorOfListOfInteger aListIter (anArgumentRefTags);
+ for (itag = 1; itag <= aHistoryLabelPos; itag++) {
+ aListIter.Next();
+ }
+ for (; itag <= anArgumentRefLabelPos; itag++) {
+ aHistoryCurLabel = aHistoryCurLabel.FindChild(aListIter.Value(), create);
+ if (aHistoryCurLabel.IsNull())
+ return aHistoryCurLabel;
+ aListIter.Next();
+ }
+
+ return aHistoryCurLabel;
+}
+