1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include <Standard_Stream.hxx>
25 #include <GEOM_Function.hxx>
26 #include <GEOM_Object.hxx>
27 #include <GEOM_Solver.hxx>
28 #include <GEOM_ISubShape.hxx>
30 #include "utilities.h"
33 #include <TDF_Tool.hxx>
34 #include <TDF_Data.hxx>
35 #include <TDF_ChildIterator.hxx>
36 #include <TDF_Reference.hxx>
37 #include <TDataStd_Integer.hxx>
38 #include <TDataStd_IntegerArray.hxx>
39 #include <TDataStd_Real.hxx>
40 #include <TDataStd_RealArray.hxx>
41 #include <TDataStd_Comment.hxx>
42 #include <TDataStd_TreeNode.hxx>
43 #include <TDataStd_UAttribute.hxx>
44 #include <TDataStd_ChildNodeIterator.hxx>
45 #include <TDataStd_ExtStringArray.hxx>
46 #include <TDataStd_ExtStringList.hxx>
47 #include <TDocStd_Owner.hxx>
48 #include <TDocStd_Document.hxx>
49 #include <TFunction_Function.hxx>
50 #include <TNaming_NamedShape.hxx>
51 #include <TNaming_Builder.hxx>
53 #include <TColStd_ListOfInteger.hxx>
54 #include <TColStd_ListIteratorOfListOfInteger.hxx>
55 #include <TColStd_HArray1OfReal.hxx>
56 #include <TColStd_HArray1OfInteger.hxx>
57 #include <TColStd_HSequenceOfTransient.hxx>
58 #include <TCollection_AsciiString.hxx>
59 #include <TCollection_ExtendedString.hxx>
61 #include <Standard_Failure.hxx>
62 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
64 // This modification was introduced in frame of Mantis issue 0021251.
65 // This line allows to keep shape orientation together with the shape itself.
66 // Otherwise orientation can be lost in some cases.
67 #define KEEP_ORIENTATION_0021251
69 #define ARGUMENT_LABEL 1
70 #define RESULT_LABEL 2
71 #define DESCRIPTION_LABEL 3
72 #define HISTORY_LABEL 4
73 #define SUBSHAPES_LABEL 5 // 0020756: GetGroups
74 #define NAMING_LABEL 6 // 0020750: Naming during STEP import
76 #ifdef KEEP_ORIENTATION_0021251
77 #define ORIENTATION_LABEL 7 // 0021251: TNaming_NamedShape doesn't store orientation
80 #define ARGUMENTS _label.FindChild((ARGUMENT_LABEL))
81 #define ARGUMENT(thePosition) _label.FindChild((ARGUMENT_LABEL)).FindChild((thePosition))
82 #define SUB_ARGUMENT(thePos1, thePos2) _label.FindChild((ARGUMENT_LABEL)).FindChild((thePos1)).FindChild((thePos2))
84 //=======================================================================
85 //function : GetFunctionTreeID
87 //=======================================================================
88 const Standard_GUID& GEOM_Function::GetFunctionTreeID()
90 static Standard_GUID aFunctionTreeID("FF1BBB00-5D14-4df2-980B-3A668264EA16");
91 return aFunctionTreeID;
95 //=======================================================================
96 //function : GetDependencyID
98 //=======================================================================
99 const Standard_GUID& GEOM_Function::GetDependencyID()
101 static Standard_GUID aDependencyID("E2620650-2354-41bd-8C2C-210CFCD00948");
102 return aDependencyID;
105 //=============================================================================
109 //=============================================================================
110 Handle(GEOM_Function) GEOM_Function::GetFunction(const TDF_Label& theEntry)
112 if(!theEntry.IsAttribute(TFunction_Function::GetID())) return NULL;
114 return new GEOM_Function(theEntry);
117 //=============================================================================
121 //=============================================================================
122 GEOM_Function::GEOM_Function(const TDF_Label& theEntry, const Standard_GUID& theGUID, int theType)
125 TFunction_Function::Set(theEntry, theGUID);
126 TDataStd_Integer::Set(theEntry, theType);
128 //Add function to a function tree
129 Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(theEntry.Data());
130 Handle(TDataStd_TreeNode) aRoot, aNode;
131 if(!aDoc->Main().FindAttribute(GetFunctionTreeID(), aRoot))
132 aRoot = TDataStd_TreeNode::Set(aDoc->Main(), GetFunctionTreeID());
134 aNode = TDataStd_TreeNode::Set(theEntry, GetFunctionTreeID());
135 aRoot->Append(aNode);
138 //=============================================================================
142 //=============================================================================
143 TDF_Label GEOM_Function::GetOwnerEntry()
145 TDF_Label aFather = _label.Father();
146 while(!aFather.IsRoot()) {
147 if(aFather.IsAttribute(GEOM_Object::GetObjectID())) return aFather;
148 aFather = aFather.Father();
154 //=============================================================================
158 //=============================================================================
159 int GEOM_Function::GetType()
162 Handle(TDataStd_Integer) aType;
163 if(!_label.FindAttribute(TDataStd_Integer::GetID(), aType)) return 0;
168 //=============================================================================
172 //=============================================================================
173 TopoDS_Shape GEOM_Function::GetValue()
178 TDF_Label aLabel = GetOwnerEntry();
179 if (aLabel.IsRoot()) return aShape;
180 Handle(GEOM_Object) anObject = GEOM_Object::GetObject(aLabel);
181 if (anObject.IsNull()) return aShape;
183 if (!anObject->IsMainShape()) {
184 bool isResult = false;
185 TDF_Label aResultLabel = _label.FindChild(RESULT_LABEL);
186 if (!aResultLabel.IsNull()) {
187 Handle(TNaming_NamedShape) aNS;
188 if (aResultLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS))
195 Standard_Integer aTic = anObject->GetTic();
198 GEOM_ISubShape aCI (this);
199 TDF_Label aLabelObjMainSh = aCI.GetMainShape()->GetOwnerEntry();
200 if (aLabelObjMainSh.IsRoot()) return aShape;
201 Handle(GEOM_Object) anObjMainSh = GEOM_Object::GetObject(aLabelObjMainSh);
202 if (anObjMainSh.IsNull()) return aShape;
203 Standard_Integer aTicMainSh = anObjMainSh->GetTic();
206 isResult = ((aTic == aTicMainSh) ? true : false);
211 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
214 GEOM_Solver aSolver(GEOM_Engine::GetEngine());
215 if (!aSolver.ComputeFunction(this)) {
216 MESSAGE("GEOM_Object::GetValue Error : Can't build a sub shape");
220 catch (Standard_Failure) {
221 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
222 MESSAGE("GEOM_Function::GetValue Error: " << aFail->GetMessageString());
228 TDF_Label aResultLabel = _label.FindChild(RESULT_LABEL);
229 Handle(TNaming_NamedShape) aNS;
230 if (!aResultLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS)) return aShape;
234 #ifdef KEEP_ORIENTATION_0021251
235 // 0021251: TNaming_NamedShape doesn't store orientation
236 TDF_Label anOrientationLabel = _label.FindChild(ORIENTATION_LABEL);
237 Handle(TDataStd_Integer) anInteger;
238 if (anOrientationLabel.FindAttribute(TDataStd_Integer::GetID(), anInteger)) {
239 aShape.Orientation((TopAbs_Orientation)anInteger->Get());
247 //=============================================================================
251 //=============================================================================
252 void GEOM_Function::SetValue(TopoDS_Shape& theShape)
255 TDF_Label aResultLabel = _label.FindChild(RESULT_LABEL);
256 TNaming_Builder aBuilder (aResultLabel);
258 aBuilder.Generated(theShape);
260 #ifdef KEEP_ORIENTATION_0021251
261 // 0021251: TNaming_NamedShape doesn't store orientation
262 TDF_Label anOrientationLabel = _label.FindChild(ORIENTATION_LABEL);
263 TDataStd_Integer::Set(anOrientationLabel, (int)theShape.Orientation());
266 // synchronisation between main shape and its sub-shapes
267 TDF_Label aLabel = GetOwnerEntry();
268 if (aLabel.IsRoot()) return;
269 Handle(GEOM_Object) anObject = GEOM_Object::GetObject(aLabel);
270 if (anObject.IsNull()) return;
271 if (anObject->IsMainShape()) {
272 // increase modifications counter of this (main) shape
273 anObject->IncrementTic();
276 // update modifications counter of this (sub-) shape to be the same as on main shape
277 GEOM_ISubShape aCI (this);
278 TDF_Label aLabelObjMainSh = aCI.GetMainShape()->GetOwnerEntry();
279 if (aLabelObjMainSh.IsRoot()) return;
280 Handle(GEOM_Object) anObjMainSh = GEOM_Object::GetObject(aLabelObjMainSh);
281 if (anObjMainSh.IsNull()) return;
283 anObject->SetTic(anObjMainSh->GetTic());
289 //=============================================================================
293 //=============================================================================
294 Standard_GUID GEOM_Function::GetDriverGUID()
296 Handle(TFunction_Function) aFunction;
297 if(!_label.FindAttribute(TFunction_Function::GetID(), aFunction)) {
298 return TDF::LowestID();
301 return aFunction->GetDriverGUID();
304 //=============================================================================
308 //=============================================================================
309 TCollection_AsciiString GEOM_Function::GetDescription()
311 Handle(TDataStd_Comment) aComment;
312 TDF_Label aChild = _label.FindChild(DESCRIPTION_LABEL);
313 if(!aChild.FindAttribute(TDataStd_Comment::GetID(), aComment)) return TCollection_AsciiString();
314 TCollection_AsciiString aDescr(aComment->Get());
318 //=============================================================================
322 //=============================================================================
323 void GEOM_Function::SetDescription(const TCollection_AsciiString& theDescription)
325 TDF_Label aChild = _label.FindChild(DESCRIPTION_LABEL);
326 Handle(TDataStd_Comment) aComment =
327 TDataStd_Comment::Set(aChild, TCollection_ExtendedString(theDescription));
330 //=============================================================================
334 //=============================================================================
335 void GEOM_Function::SetReal(int thePosition, double theValue)
338 if(thePosition <= 0) return;
339 TDF_Label anArgLabel = ARGUMENT(thePosition);
340 TDataStd_Real::Set(anArgLabel, theValue);
344 //=============================================================================
348 //=============================================================================
349 void GEOM_Function::SetRealArray (int thePosition,
350 const Handle(TColStd_HArray1OfReal)& theArray)
353 if(thePosition <= 0) return;
354 TDF_Label anArgLabel = ARGUMENT(thePosition);
355 Handle(TDataStd_RealArray) anAttr =
356 TDataStd_RealArray::Set(anArgLabel, theArray->Lower(), theArray->Upper());
357 anAttr->ChangeArray(theArray);
361 //=============================================================================
365 //=============================================================================
366 double GEOM_Function::GetReal(int thePosition)
369 if(thePosition <= 0) return 0.0;
370 Handle(TDataStd_Real) aReal;
371 TDF_Label anArgLabel = ARGUMENT(thePosition);
372 if(!anArgLabel.FindAttribute(TDataStd_Real::GetID(), aReal)) return 0.0;
378 //=============================================================================
382 //=============================================================================
383 Handle(TColStd_HArray1OfReal) GEOM_Function::GetRealArray(int thePosition)
386 if(thePosition <= 0) return NULL;
387 Handle(TDataStd_RealArray) aRealArray;
388 TDF_Label anArgLabel = ARGUMENT(thePosition);
389 if(!anArgLabel.FindAttribute(TDataStd_RealArray::GetID(), aRealArray)) return NULL;
392 return aRealArray->Array();
395 //=============================================================================
399 //=============================================================================
400 void GEOM_Function::SetInteger(int thePosition, int theValue)
403 if(thePosition <= 0) return;
404 TDF_Label anArgLabel = ARGUMENT(thePosition);
405 TDataStd_Integer::Set(anArgLabel, theValue);
409 //=============================================================================
413 //=============================================================================
414 void GEOM_Function::SetIntegerArray (int thePosition,
415 const Handle(TColStd_HArray1OfInteger)& theArray)
418 if(thePosition <= 0) return;
419 TDF_Label anArgLabel = ARGUMENT(thePosition);
420 Handle(TDataStd_IntegerArray) anAttr =
421 TDataStd_IntegerArray::Set(anArgLabel, theArray->Lower(), theArray->Upper());
422 anAttr->ChangeArray(theArray);
426 //=============================================================================
430 //=============================================================================
431 int GEOM_Function::GetInteger(int thePosition)
434 if(thePosition <= 0) return 0;
435 Handle(TDataStd_Integer) anInteger;
436 TDF_Label anArgLabel = ARGUMENT(thePosition);
437 if(!anArgLabel.FindAttribute(TDataStd_Integer::GetID(), anInteger)) return 0;
440 return anInteger->Get();
443 //=============================================================================
447 //=============================================================================
448 Handle(TColStd_HArray1OfInteger) GEOM_Function::GetIntegerArray(int thePosition)
451 if(thePosition <= 0) return 0;
452 Handle(TDataStd_IntegerArray) anIntegerArray;
453 TDF_Label anArgLabel = ARGUMENT(thePosition);
454 if(!anArgLabel.FindAttribute(TDataStd_IntegerArray::GetID(), anIntegerArray)) return 0;
457 return anIntegerArray->Array();
460 //=============================================================================
464 //=============================================================================
465 void GEOM_Function::SetString(int thePosition, const TCollection_AsciiString& theValue)
468 if(thePosition <= 0) return;
469 TDF_Label anArgLabel = ARGUMENT(thePosition);
470 TDataStd_Comment::Set(anArgLabel, theValue);
474 //=============================================================================
478 //=============================================================================
479 TCollection_AsciiString GEOM_Function::GetString(int thePosition)
482 TCollection_AsciiString aRes;
483 if(thePosition <= 0) return aRes;
484 Handle(TDataStd_Comment) aString;
485 TDF_Label anArgLabel = ARGUMENT(thePosition);
486 if(!anArgLabel.FindAttribute(TDataStd_Comment::GetID(), aString)) return aRes;
489 aRes = TCollection_AsciiString(aString->Get());
493 //=============================================================================
497 //=============================================================================
498 void GEOM_Function::SetReference(int thePosition, Handle(GEOM_Function) theReference)
501 if (thePosition <= 0) return;
502 if (theReference.IsNull()) return;
503 TDF_Label anArgLabel = ARGUMENT(thePosition);
504 TDF_Reference::Set(anArgLabel, theReference->GetEntry());
505 TDataStd_UAttribute::Set(anArgLabel, GetDependencyID());
510 //=============================================================================
514 //=============================================================================
515 Handle(GEOM_Function) GEOM_Function::GetReference(int thePosition)
518 if(thePosition <= 0) return NULL;
519 TDF_Label anArgLabel = ARGUMENT(thePosition);
520 Handle(TDF_Reference) aRef;
521 if(!anArgLabel.FindAttribute(TDF_Reference::GetID(), aRef)) return NULL;
524 return GetFunction(aRef->Get());
528 //=============================================================================
532 //=============================================================================
533 void GEOM_Function::SetStringArray(int thePosition, const Handle(TColStd_HArray1OfExtendedString)& theArray)
536 if(thePosition <= 0 || theArray.IsNull()) return;
537 TDF_Label anArgLabel = ARGUMENT(thePosition);
539 Handle(TDataStd_ExtStringArray) anArray = new TDataStd_ExtStringArray;
540 anArray->ChangeArray(theArray);
541 anArgLabel.AddAttribute(anArray);
547 //=============================================================================
551 //=============================================================================
552 Handle(TColStd_HArray1OfExtendedString) GEOM_Function::GetStringArray(int thePosition)
555 if(thePosition <= 0) return NULL;
556 TDF_Label anArgLabel = ARGUMENT(thePosition);
557 Handle(TDataStd_ExtStringArray) anArray;
558 if(!anArgLabel.FindAttribute(TDataStd_ExtStringArray::GetID(), anArray)) return NULL;
561 return anArray->Array();
564 //=======================================================================
565 //function : GetReferencesTreeID
567 //=======================================================================
568 const Standard_GUID& GEOM_Function::GetReferencesTreeID()
570 static Standard_GUID aReferencesTreeID("FF1BBB10-5D14-4df2-980B-3A668264EA16");
571 return aReferencesTreeID;
574 //=============================================================================
578 //=============================================================================
579 void GEOM_Function::SetReferenceList (int thePosition,
580 const Handle(TColStd_HSequenceOfTransient)& theRefList)
583 if(thePosition <= 0) return;
585 // parent label for the list of references
586 TDF_Label anArgLabel = ARGUMENT(thePosition);
587 anArgLabel.ForgetAllAttributes();
589 // set TreeNode on the parent label
590 Handle(TDataStd_TreeNode) aRoot, aNode;
591 aRoot = TDataStd_TreeNode::Set(anArgLabel, GetReferencesTreeID());
593 // store references on sub-labels of the parent label
594 Handle(GEOM_Function) aFunc;
595 Standard_Integer ind, len = theRefList->Length();
596 for (ind = 1; ind <= len; ind++) {
597 aFunc = Handle(GEOM_Function)::DownCast(theRefList->Value(ind));
598 if (aFunc.IsNull()) continue;
599 TDF_Label anArgLabel_i = SUB_ARGUMENT(thePosition, ind);
600 TDF_Reference::Set(anArgLabel_i, aFunc->GetEntry());
601 TDataStd_UAttribute::Set(anArgLabel_i, GetDependencyID());
603 // set TreeNode on the child label
604 aNode = TDataStd_TreeNode::Set(anArgLabel_i, GetReferencesTreeID());
605 aRoot->Append(aNode);
612 //=============================================================================
616 //=============================================================================
617 Handle(TColStd_HSequenceOfTransient) GEOM_Function::GetReferenceList(int thePosition)
619 Handle(TColStd_HSequenceOfTransient) aResult = new TColStd_HSequenceOfTransient;
621 if(thePosition <= 0) return aResult;
623 // parent label for the list of references
624 TDF_Label anArgLabel = ARGUMENT(thePosition);
625 Handle(TDF_Reference) aRef;
627 // get TreeNode on the parent label
628 Handle(TDataStd_TreeNode) aRoot, aNode;
629 if(!anArgLabel.FindAttribute(GetReferencesTreeID(), aRoot))
632 // get references, stored on sub-labels of the parent label
634 TDataStd_ChildNodeIterator anIter (aRoot);
635 for (; anIter.More(); anIter.Next()) {
636 aNode = anIter.Value();
637 aLabel_i = aNode->Label();
638 if (!aLabel_i.FindAttribute(TDF_Reference::GetID(), aRef)) continue;
639 Handle(GEOM_Function) aFunc_i = GetFunction(aRef->Get());
640 if (aFunc_i.IsNull()) continue;
641 aResult->Append(aFunc_i);
648 //=============================================================================
652 //=============================================================================
653 //void GEOM_Function::SetShape(int thePosition, const TopoDS_Shape& theShape)
656 // if(thePosition <= 0 || theShape.IsNull()) return;
658 // TDF_Label anArgLabel = ARGUMENT(thePosition);
659 // TNaming_Builder aBuilder(anArgLabel);
660 // aBuilder.Generated(theShape);
666 //=============================================================================
670 //=============================================================================
671 //TopoDS_Shape GEOM_Function::GetShape(int thePosition)
674 // TopoDS_Shape aShape;
675 // if(thePosition <= 0) return aShape;
677 // TDF_Label anArgLabel = ARGUMENT(thePosition);
678 // Handle(TNaming_NamedShape) aNS;
679 // if(!anArgLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS)) return aShape;
681 // aShape = aNS->Get();
687 //=============================================================================
691 //=============================================================================
692 void GEOM_Function::GetDependency(TDF_LabelSequence& theSeq)
694 TDF_ChildIterator anIterator(ARGUMENTS, Standard_True);
695 for(; anIterator.More(); anIterator.Next()) {
696 if(anIterator.Value().IsAttribute(GetDependencyID())) theSeq.Append(anIterator.Value());
700 //=============================================================================
702 * AddSubShapeReference
704 //=============================================================================
705 void GEOM_Function::AddSubShapeReference(Handle(GEOM_Function) theSubShape)
709 TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL);
711 Handle(TDataStd_ExtStringList) aList;
712 if (!aSubShapesLabel.FindAttribute(TDataStd_ExtStringList::GetID(), aList)) {
713 aList = new TDataStd_ExtStringList;
714 aSubShapesLabel.AddAttribute(aList);
717 TCollection_AsciiString anEntry;
718 TDF_Tool::Entry(theSubShape->GetOwnerEntry(), anEntry);
719 aList->Append(anEntry);
724 //=============================================================================
726 * RemoveSubShapeReference
728 //=============================================================================
729 void GEOM_Function::RemoveSubShapeReference(Handle(GEOM_Function) theSubShape)
733 TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL);
735 Handle(TDataStd_ExtStringList) aList;
736 if (aSubShapesLabel.FindAttribute(TDataStd_ExtStringList::GetID(), aList)) {
737 TCollection_AsciiString anEntry;
738 TDF_Tool::Entry(theSubShape->GetOwnerEntry(), anEntry);
739 aList->Remove(anEntry);
745 //=============================================================================
747 * HasSubShapeReferences
749 //=============================================================================
750 bool GEOM_Function::HasSubShapeReferences()
754 TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL);
755 return aSubShapesLabel.IsAttribute(TDataStd_ExtStringList::GetID());
758 //=============================================================================
760 * GetSubShapeReferences
762 //=============================================================================
763 const TDataStd_ListOfExtendedString& GEOM_Function::GetSubShapeReferences()
767 TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL);
769 Handle(TDataStd_ExtStringList) aList;
770 if (!aSubShapesLabel.FindAttribute(TDataStd_ExtStringList::GetID(), aList)) {
771 aList = new TDataStd_ExtStringList;
772 aSubShapesLabel.AddAttribute(aList);
776 return aList->List();
779 //=============================================================================
783 //=============================================================================
784 TDF_Label GEOM_Function::GetHistoryEntry (const Standard_Boolean create)
786 return _label.FindChild(HISTORY_LABEL, create);
789 //=============================================================================
791 * GetArgumentHistoryEntry
793 //=============================================================================
794 TDF_Label GEOM_Function::GetArgumentHistoryEntry (const TDF_Label& theArgumentRefEntry,
795 const Standard_Boolean create)
797 TColStd_ListOfInteger anArgumentRefTags;
798 TDF_Tool::TagList(theArgumentRefEntry, anArgumentRefTags);
799 Standard_Integer anArgumentRefLabelPos = anArgumentRefTags.Extent();
801 TDF_Label aHistoryLabel = GetHistoryEntry(create);
802 if (aHistoryLabel.IsNull())
803 return aHistoryLabel;
804 Standard_Integer aHistoryLabelPos = aHistoryLabel.Depth() + 1;
806 Standard_Integer itag;
807 TDF_Label aHistoryCurLabel = aHistoryLabel;
808 TColStd_ListIteratorOfListOfInteger aListIter (anArgumentRefTags);
809 for (itag = 1; itag <= aHistoryLabelPos; itag++) {
812 for (; itag <= anArgumentRefLabelPos; itag++) {
813 aHistoryCurLabel = aHistoryCurLabel.FindChild(aListIter.Value(), create);
814 if (aHistoryCurLabel.IsNull())
815 return aHistoryCurLabel;
819 return aHistoryCurLabel;
822 //=============================================================================
826 //=============================================================================
827 TDF_Label GEOM_Function::GetNamingEntry (const Standard_Boolean create)
829 return _label.FindChild(NAMING_LABEL, create);
832 //=======================================================================
833 //function : GEOM_Function_Type_
835 //=======================================================================
836 Standard_EXPORT Handle_Standard_Type& GEOM_Function_Type_()
839 static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared);
840 if (aType1.IsNull()) aType1 = STANDARD_TYPE(MMgt_TShared);
841 static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient);
842 if (aType2.IsNull()) aType2 = STANDARD_TYPE(Standard_Transient);
844 static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
845 static Handle_Standard_Type _aType = new Standard_Type("GEOM_Function",
846 sizeof(GEOM_Function),
848 (Standard_Address)_Ancestors,
849 (Standard_Address)NULL);
854 //=======================================================================
855 //function : DownCast
857 //=======================================================================
859 const Handle(GEOM_Function) Handle(GEOM_Function)::DownCast(const Handle(Standard_Transient)& AnObject)
861 Handle(GEOM_Function) _anOtherObject;
863 if (!AnObject.IsNull()) {
864 if (AnObject->IsKind(STANDARD_TYPE(GEOM_Function))) {
865 _anOtherObject = Handle(GEOM_Function)((Handle(GEOM_Function)&)AnObject);
869 return _anOtherObject;