1 // Copyright (C) 2007-2010 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
22 #include <Standard_Stream.hxx>
24 #include <GEOM_Function.hxx>
25 #include <GEOM_Object.hxx>
26 #include <GEOM_Solver.hxx>
27 #include <GEOM_ISubShape.hxx>
29 #include "utilities.h"
32 #include <TDF_Tool.hxx>
33 #include <TDF_Data.hxx>
34 #include <TDF_ChildIterator.hxx>
35 #include <TDF_Reference.hxx>
36 #include <TDataStd_Integer.hxx>
37 #include <TDataStd_IntegerArray.hxx>
38 #include <TDataStd_Real.hxx>
39 #include <TDataStd_RealArray.hxx>
40 #include <TDataStd_Comment.hxx>
41 #include <TDataStd_TreeNode.hxx>
42 #include <TDataStd_UAttribute.hxx>
43 #include <TDataStd_ChildNodeIterator.hxx>
44 #include <TDataStd_ExtStringArray.hxx>
45 #include <TDataStd_ExtStringList.hxx>
46 #include <TDocStd_Owner.hxx>
47 #include <TDocStd_Document.hxx>
48 #include <TFunction_Function.hxx>
49 #include <TNaming_NamedShape.hxx>
50 #include <TNaming_Builder.hxx>
52 #include <TColStd_ListOfInteger.hxx>
53 #include <TColStd_ListIteratorOfListOfInteger.hxx>
54 #include <TColStd_HArray1OfReal.hxx>
55 #include <TColStd_HArray1OfInteger.hxx>
56 #include <TColStd_HSequenceOfTransient.hxx>
57 #include <TCollection_AsciiString.hxx>
58 #include <TCollection_ExtendedString.hxx>
60 #include <Standard_Failure.hxx>
61 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
63 // This modification was introduced in frame of Mantis issue 0021251.
64 // This line allows to keep shape orientation together with the shape itself.
65 // Otherwise orientation can be lost in some cases.
66 #define KEEP_ORIENTATION_0021251
68 #define ARGUMENT_LABEL 1
69 #define RESULT_LABEL 2
70 #define DESCRIPTION_LABEL 3
71 #define HISTORY_LABEL 4
72 #define SUBSHAPES_LABEL 5 // 0020756: GetGroups
73 #define NAMING_LABEL 6 // 0020750: Naming during STEP import
75 #ifdef KEEP_ORIENTATION_0021251
76 #define ORIENTATION_LABEL 7 // 0021251: TNaming_NamedShape doesn't store orientation
79 #define ARGUMENTS _label.FindChild((ARGUMENT_LABEL))
80 #define ARGUMENT(thePosition) _label.FindChild((ARGUMENT_LABEL)).FindChild((thePosition))
81 #define SUB_ARGUMENT(thePos1, thePos2) _label.FindChild((ARGUMENT_LABEL)).FindChild((thePos1)).FindChild((thePos2))
83 //=======================================================================
84 //function : GetFunctionTreeID
86 //=======================================================================
87 const Standard_GUID& GEOM_Function::GetFunctionTreeID()
89 static Standard_GUID aFunctionTreeID("FF1BBB00-5D14-4df2-980B-3A668264EA16");
90 return aFunctionTreeID;
94 //=======================================================================
95 //function : GetDependencyID
97 //=======================================================================
98 const Standard_GUID& GEOM_Function::GetDependencyID()
100 static Standard_GUID aDependencyID("E2620650-2354-41bd-8C2C-210CFCD00948");
101 return aDependencyID;
104 //=============================================================================
108 //=============================================================================
109 Handle(GEOM_Function) GEOM_Function::GetFunction(const TDF_Label& theEntry)
111 if(!theEntry.IsAttribute(TFunction_Function::GetID())) return NULL;
113 return new GEOM_Function(theEntry);
116 //=============================================================================
120 //=============================================================================
121 GEOM_Function::GEOM_Function(const TDF_Label& theEntry, const Standard_GUID& theGUID, int theType)
124 TFunction_Function::Set(theEntry, theGUID);
125 TDataStd_Integer::Set(theEntry, theType);
127 //Add function to a function tree
128 Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(theEntry.Data());
129 Handle(TDataStd_TreeNode) aRoot, aNode;
130 if(!aDoc->Main().FindAttribute(GetFunctionTreeID(), aRoot))
131 aRoot = TDataStd_TreeNode::Set(aDoc->Main(), GetFunctionTreeID());
133 aNode = TDataStd_TreeNode::Set(theEntry, GetFunctionTreeID());
134 aRoot->Append(aNode);
137 //=============================================================================
141 //=============================================================================
142 TDF_Label GEOM_Function::GetOwnerEntry()
144 TDF_Label aFather = _label.Father();
145 while(!aFather.IsRoot()) {
146 if(aFather.IsAttribute(GEOM_Object::GetObjectID())) return aFather;
147 aFather = aFather.Father();
153 //=============================================================================
157 //=============================================================================
158 int GEOM_Function::GetType()
161 Handle(TDataStd_Integer) aType;
162 if(!_label.FindAttribute(TDataStd_Integer::GetID(), aType)) return 0;
167 //=============================================================================
171 //=============================================================================
172 TopoDS_Shape GEOM_Function::GetValue()
177 TDF_Label aLabel = GetOwnerEntry();
178 if (aLabel.IsRoot()) return aShape;
179 Handle(GEOM_Object) anObject = GEOM_Object::GetObject(aLabel);
180 if (anObject.IsNull()) return aShape;
182 if (!anObject->IsMainShape()) {
183 bool isResult = false;
184 TDF_Label aResultLabel = _label.FindChild(RESULT_LABEL);
185 if (!aResultLabel.IsNull()) {
186 Handle(TNaming_NamedShape) aNS;
187 if (aResultLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS))
194 Standard_Integer aTic = anObject->GetTic();
197 GEOM_ISubShape aCI (this);
198 TDF_Label aLabelObjMainSh = aCI.GetMainShape()->GetOwnerEntry();
199 if (aLabelObjMainSh.IsRoot()) return aShape;
200 Handle(GEOM_Object) anObjMainSh = GEOM_Object::GetObject(aLabelObjMainSh);
201 if (anObjMainSh.IsNull()) return aShape;
202 Standard_Integer aTicMainSh = anObjMainSh->GetTic();
205 isResult = ((aTic == aTicMainSh) ? true : false);
210 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
213 GEOM_Solver aSolver(GEOM_Engine::GetEngine());
214 if (!aSolver.ComputeFunction(this)) {
215 MESSAGE("GEOM_Object::GetValue Error : Can't build a sub shape");
219 catch (Standard_Failure) {
220 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
221 MESSAGE("GEOM_Function::GetValue Error: " << aFail->GetMessageString());
227 TDF_Label aResultLabel = _label.FindChild(RESULT_LABEL);
228 Handle(TNaming_NamedShape) aNS;
229 if (!aResultLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS)) return aShape;
233 #ifdef KEEP_ORIENTATION_0021251
234 // 0021251: TNaming_NamedShape doesn't store orientation
235 TDF_Label anOrientationLabel = _label.FindChild(ORIENTATION_LABEL);
236 Handle(TDataStd_Integer) anInteger;
237 if (anOrientationLabel.FindAttribute(TDataStd_Integer::GetID(), anInteger)) {
238 aShape.Orientation((TopAbs_Orientation)anInteger->Get());
246 //=============================================================================
250 //=============================================================================
251 void GEOM_Function::SetValue(TopoDS_Shape& theShape)
254 TDF_Label aResultLabel = _label.FindChild(RESULT_LABEL);
255 TNaming_Builder aBuilder (aResultLabel);
257 aBuilder.Generated(theShape);
259 #ifdef KEEP_ORIENTATION_0021251
260 // 0021251: TNaming_NamedShape doesn't store orientation
261 TDF_Label anOrientationLabel = _label.FindChild(ORIENTATION_LABEL);
262 TDataStd_Integer::Set(anOrientationLabel, (int)theShape.Orientation());
265 // synchronisation between main shape and its sub-shapes
266 TDF_Label aLabel = GetOwnerEntry();
267 if (aLabel.IsRoot()) return;
268 Handle(GEOM_Object) anObject = GEOM_Object::GetObject(aLabel);
269 if (anObject.IsNull()) return;
270 if (anObject->IsMainShape()) {
271 // increase modifications counter of this (main) shape
272 anObject->IncrementTic();
275 // update modifications counter of this (sub-) shape to be the same as on main shape
276 GEOM_ISubShape aCI (this);
277 TDF_Label aLabelObjMainSh = aCI.GetMainShape()->GetOwnerEntry();
278 if (aLabelObjMainSh.IsRoot()) return;
279 Handle(GEOM_Object) anObjMainSh = GEOM_Object::GetObject(aLabelObjMainSh);
280 if (anObjMainSh.IsNull()) return;
282 anObject->SetTic(anObjMainSh->GetTic());
288 //=============================================================================
292 //=============================================================================
293 Standard_GUID GEOM_Function::GetDriverGUID()
295 Handle(TFunction_Function) aFunction;
296 if(!_label.FindAttribute(TFunction_Function::GetID(), aFunction)) {
297 return TDF::LowestID();
300 return aFunction->GetDriverGUID();
303 //=============================================================================
307 //=============================================================================
308 TCollection_AsciiString GEOM_Function::GetDescription()
310 Handle(TDataStd_Comment) aComment;
311 TDF_Label aChild = _label.FindChild(DESCRIPTION_LABEL);
312 if(!aChild.FindAttribute(TDataStd_Comment::GetID(), aComment)) return TCollection_AsciiString();
313 TCollection_AsciiString aDescr(aComment->Get());
317 //=============================================================================
321 //=============================================================================
322 void GEOM_Function::SetDescription(const TCollection_AsciiString& theDescription)
324 TDF_Label aChild = _label.FindChild(DESCRIPTION_LABEL);
325 Handle(TDataStd_Comment) aComment =
326 TDataStd_Comment::Set(aChild, TCollection_ExtendedString(theDescription));
329 //=============================================================================
333 //=============================================================================
334 void GEOM_Function::SetReal(int thePosition, double theValue)
337 if(thePosition <= 0) return;
338 TDF_Label anArgLabel = ARGUMENT(thePosition);
339 TDataStd_Real::Set(anArgLabel, theValue);
343 //=============================================================================
347 //=============================================================================
348 void GEOM_Function::SetRealArray (int thePosition,
349 const Handle(TColStd_HArray1OfReal)& theArray)
352 if(thePosition <= 0) return;
353 TDF_Label anArgLabel = ARGUMENT(thePosition);
354 Handle(TDataStd_RealArray) anAttr =
355 TDataStd_RealArray::Set(anArgLabel, theArray->Lower(), theArray->Upper());
356 anAttr->ChangeArray(theArray);
360 //=============================================================================
364 //=============================================================================
365 double GEOM_Function::GetReal(int thePosition)
368 if(thePosition <= 0) return 0.0;
369 Handle(TDataStd_Real) aReal;
370 TDF_Label anArgLabel = ARGUMENT(thePosition);
371 if(!anArgLabel.FindAttribute(TDataStd_Real::GetID(), aReal)) return 0.0;
377 //=============================================================================
381 //=============================================================================
382 Handle(TColStd_HArray1OfReal) GEOM_Function::GetRealArray(int thePosition)
385 if(thePosition <= 0) return NULL;
386 Handle(TDataStd_RealArray) aRealArray;
387 TDF_Label anArgLabel = ARGUMENT(thePosition);
388 if(!anArgLabel.FindAttribute(TDataStd_RealArray::GetID(), aRealArray)) return NULL;
391 return aRealArray->Array();
394 //=============================================================================
398 //=============================================================================
399 void GEOM_Function::SetInteger(int thePosition, int theValue)
402 if(thePosition <= 0) return;
403 TDF_Label anArgLabel = ARGUMENT(thePosition);
404 TDataStd_Integer::Set(anArgLabel, theValue);
408 //=============================================================================
412 //=============================================================================
413 void GEOM_Function::SetIntegerArray (int thePosition,
414 const Handle(TColStd_HArray1OfInteger)& theArray)
417 if(thePosition <= 0) return;
418 TDF_Label anArgLabel = ARGUMENT(thePosition);
419 Handle(TDataStd_IntegerArray) anAttr =
420 TDataStd_IntegerArray::Set(anArgLabel, theArray->Lower(), theArray->Upper());
421 anAttr->ChangeArray(theArray);
425 //=============================================================================
429 //=============================================================================
430 int GEOM_Function::GetInteger(int thePosition)
433 if(thePosition <= 0) return 0;
434 Handle(TDataStd_Integer) anInteger;
435 TDF_Label anArgLabel = ARGUMENT(thePosition);
436 if(!anArgLabel.FindAttribute(TDataStd_Integer::GetID(), anInteger)) return 0;
439 return anInteger->Get();
442 //=============================================================================
446 //=============================================================================
447 Handle(TColStd_HArray1OfInteger) GEOM_Function::GetIntegerArray(int thePosition)
450 if(thePosition <= 0) return 0;
451 Handle(TDataStd_IntegerArray) anIntegerArray;
452 TDF_Label anArgLabel = ARGUMENT(thePosition);
453 if(!anArgLabel.FindAttribute(TDataStd_IntegerArray::GetID(), anIntegerArray)) return 0;
456 return anIntegerArray->Array();
459 //=============================================================================
463 //=============================================================================
464 void GEOM_Function::SetString(int thePosition, const TCollection_AsciiString& theValue)
467 if(thePosition <= 0) return;
468 TDF_Label anArgLabel = ARGUMENT(thePosition);
469 TDataStd_Comment::Set(anArgLabel, theValue);
473 //=============================================================================
477 //=============================================================================
478 TCollection_AsciiString GEOM_Function::GetString(int thePosition)
481 TCollection_AsciiString aRes;
482 if(thePosition <= 0) return aRes;
483 Handle(TDataStd_Comment) aString;
484 TDF_Label anArgLabel = ARGUMENT(thePosition);
485 if(!anArgLabel.FindAttribute(TDataStd_Comment::GetID(), aString)) return aRes;
488 aRes = TCollection_AsciiString(aString->Get());
492 //=============================================================================
496 //=============================================================================
497 void GEOM_Function::SetReference(int thePosition, Handle(GEOM_Function) theReference)
500 if (thePosition <= 0) return;
501 if (theReference.IsNull()) return;
502 TDF_Label anArgLabel = ARGUMENT(thePosition);
503 TDF_Reference::Set(anArgLabel, theReference->GetEntry());
504 TDataStd_UAttribute::Set(anArgLabel, GetDependencyID());
509 //=============================================================================
513 //=============================================================================
514 Handle(GEOM_Function) GEOM_Function::GetReference(int thePosition)
517 if(thePosition <= 0) return NULL;
518 TDF_Label anArgLabel = ARGUMENT(thePosition);
519 Handle(TDF_Reference) aRef;
520 if(!anArgLabel.FindAttribute(TDF_Reference::GetID(), aRef)) return NULL;
523 return GetFunction(aRef->Get());
527 //=============================================================================
531 //=============================================================================
532 void GEOM_Function::SetStringArray(int thePosition, const Handle(TColStd_HArray1OfExtendedString)& theArray)
535 if(thePosition <= 0 || theArray.IsNull()) return;
536 TDF_Label anArgLabel = ARGUMENT(thePosition);
538 Handle(TDataStd_ExtStringArray) anArray = new TDataStd_ExtStringArray;
539 anArray->ChangeArray(theArray);
540 anArgLabel.AddAttribute(anArray);
546 //=============================================================================
550 //=============================================================================
551 Handle(TColStd_HArray1OfExtendedString) GEOM_Function::GetStringArray(int thePosition)
554 if(thePosition <= 0) return NULL;
555 TDF_Label anArgLabel = ARGUMENT(thePosition);
556 Handle(TDataStd_ExtStringArray) anArray;
557 if(!anArgLabel.FindAttribute(TDataStd_ExtStringArray::GetID(), anArray)) return NULL;
560 return anArray->Array();
563 //=======================================================================
564 //function : GetReferencesTreeID
566 //=======================================================================
567 const Standard_GUID& GEOM_Function::GetReferencesTreeID()
569 static Standard_GUID aReferencesTreeID("FF1BBB10-5D14-4df2-980B-3A668264EA16");
570 return aReferencesTreeID;
573 //=============================================================================
577 //=============================================================================
578 void GEOM_Function::SetReferenceList (int thePosition,
579 const Handle(TColStd_HSequenceOfTransient)& theRefList)
582 if(thePosition <= 0) return;
584 // parent label for the list of references
585 TDF_Label anArgLabel = ARGUMENT(thePosition);
586 anArgLabel.ForgetAllAttributes();
588 // set TreeNode on the parent label
589 Handle(TDataStd_TreeNode) aRoot, aNode;
590 aRoot = TDataStd_TreeNode::Set(anArgLabel, GetReferencesTreeID());
592 // store references on sub-labels of the parent label
593 Handle(GEOM_Function) aFunc;
594 Standard_Integer ind, len = theRefList->Length();
595 for (ind = 1; ind <= len; ind++) {
596 aFunc = Handle(GEOM_Function)::DownCast(theRefList->Value(ind));
597 if (aFunc.IsNull()) continue;
598 TDF_Label anArgLabel_i = SUB_ARGUMENT(thePosition, ind);
599 TDF_Reference::Set(anArgLabel_i, aFunc->GetEntry());
600 TDataStd_UAttribute::Set(anArgLabel_i, GetDependencyID());
602 // set TreeNode on the child label
603 aNode = TDataStd_TreeNode::Set(anArgLabel_i, GetReferencesTreeID());
604 aRoot->Append(aNode);
611 //=============================================================================
615 //=============================================================================
616 Handle(TColStd_HSequenceOfTransient) GEOM_Function::GetReferenceList(int thePosition)
618 Handle(TColStd_HSequenceOfTransient) aResult = new TColStd_HSequenceOfTransient;
620 if(thePosition <= 0) return aResult;
622 // parent label for the list of references
623 TDF_Label anArgLabel = ARGUMENT(thePosition);
624 Handle(TDF_Reference) aRef;
626 // get TreeNode on the parent label
627 Handle(TDataStd_TreeNode) aRoot, aNode;
628 if(!anArgLabel.FindAttribute(GetReferencesTreeID(), aRoot))
631 // get references, stored on sub-labels of the parent label
633 TDataStd_ChildNodeIterator anIter (aRoot);
634 for (; anIter.More(); anIter.Next()) {
635 aNode = anIter.Value();
636 aLabel_i = aNode->Label();
637 if (!aLabel_i.FindAttribute(TDF_Reference::GetID(), aRef)) continue;
638 Handle(GEOM_Function) aFunc_i = GetFunction(aRef->Get());
639 if (aFunc_i.IsNull()) continue;
640 aResult->Append(aFunc_i);
647 //=============================================================================
651 //=============================================================================
652 //void GEOM_Function::SetShape(int thePosition, const TopoDS_Shape& theShape)
655 // if(thePosition <= 0 || theShape.IsNull()) return;
657 // TDF_Label anArgLabel = ARGUMENT(thePosition);
658 // TNaming_Builder aBuilder(anArgLabel);
659 // aBuilder.Generated(theShape);
665 //=============================================================================
669 //=============================================================================
670 //TopoDS_Shape GEOM_Function::GetShape(int thePosition)
673 // TopoDS_Shape aShape;
674 // if(thePosition <= 0) return aShape;
676 // TDF_Label anArgLabel = ARGUMENT(thePosition);
677 // Handle(TNaming_NamedShape) aNS;
678 // if(!anArgLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS)) return aShape;
680 // aShape = aNS->Get();
686 //=============================================================================
690 //=============================================================================
691 void GEOM_Function::GetDependency(TDF_LabelSequence& theSeq)
693 TDF_ChildIterator anIterator(ARGUMENTS, Standard_True);
694 for(; anIterator.More(); anIterator.Next()) {
695 if(anIterator.Value().IsAttribute(GetDependencyID())) theSeq.Append(anIterator.Value());
699 //=============================================================================
701 * AddSubShapeReference
703 //=============================================================================
704 void GEOM_Function::AddSubShapeReference(Handle(GEOM_Function) theSubShape)
708 TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL);
710 Handle(TDataStd_ExtStringList) aList;
711 if (!aSubShapesLabel.FindAttribute(TDataStd_ExtStringList::GetID(), aList)) {
712 aList = new TDataStd_ExtStringList;
713 aSubShapesLabel.AddAttribute(aList);
716 TCollection_AsciiString anEntry;
717 TDF_Tool::Entry(theSubShape->GetOwnerEntry(), anEntry);
718 aList->Append(anEntry);
723 //=============================================================================
725 * RemoveSubShapeReference
727 //=============================================================================
728 void GEOM_Function::RemoveSubShapeReference(Handle(GEOM_Function) theSubShape)
732 TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL);
734 Handle(TDataStd_ExtStringList) aList;
735 if (aSubShapesLabel.FindAttribute(TDataStd_ExtStringList::GetID(), aList)) {
736 TCollection_AsciiString anEntry;
737 TDF_Tool::Entry(theSubShape->GetOwnerEntry(), anEntry);
738 aList->Remove(anEntry);
744 //=============================================================================
746 * HasSubShapeReferences
748 //=============================================================================
749 bool GEOM_Function::HasSubShapeReferences()
753 TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL);
754 return aSubShapesLabel.IsAttribute(TDataStd_ExtStringList::GetID());
757 //=============================================================================
759 * GetSubShapeReferences
761 //=============================================================================
762 const TDataStd_ListOfExtendedString& GEOM_Function::GetSubShapeReferences()
766 TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL);
768 Handle(TDataStd_ExtStringList) aList;
769 if (!aSubShapesLabel.FindAttribute(TDataStd_ExtStringList::GetID(), aList)) {
770 aList = new TDataStd_ExtStringList;
771 aSubShapesLabel.AddAttribute(aList);
775 return aList->List();
778 //=============================================================================
782 //=============================================================================
783 TDF_Label GEOM_Function::GetHistoryEntry (const Standard_Boolean create)
785 return _label.FindChild(HISTORY_LABEL, create);
788 //=============================================================================
790 * GetArgumentHistoryEntry
792 //=============================================================================
793 TDF_Label GEOM_Function::GetArgumentHistoryEntry (const TDF_Label& theArgumentRefEntry,
794 const Standard_Boolean create)
796 TColStd_ListOfInteger anArgumentRefTags;
797 TDF_Tool::TagList(theArgumentRefEntry, anArgumentRefTags);
798 Standard_Integer anArgumentRefLabelPos = anArgumentRefTags.Extent();
800 TDF_Label aHistoryLabel = GetHistoryEntry(create);
801 if (aHistoryLabel.IsNull())
802 return aHistoryLabel;
803 Standard_Integer aHistoryLabelPos = aHistoryLabel.Depth() + 1;
805 Standard_Integer itag;
806 TDF_Label aHistoryCurLabel = aHistoryLabel;
807 TColStd_ListIteratorOfListOfInteger aListIter (anArgumentRefTags);
808 for (itag = 1; itag <= aHistoryLabelPos; itag++) {
811 for (; itag <= anArgumentRefLabelPos; itag++) {
812 aHistoryCurLabel = aHistoryCurLabel.FindChild(aListIter.Value(), create);
813 if (aHistoryCurLabel.IsNull())
814 return aHistoryCurLabel;
818 return aHistoryCurLabel;
821 //=============================================================================
825 //=============================================================================
826 TDF_Label GEOM_Function::GetNamingEntry (const Standard_Boolean create)
828 return _label.FindChild(NAMING_LABEL, create);
831 //=======================================================================
832 //function : GEOM_Function_Type_
834 //=======================================================================
835 Standard_EXPORT Handle_Standard_Type& GEOM_Function_Type_()
838 static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared);
839 if (aType1.IsNull()) aType1 = STANDARD_TYPE(MMgt_TShared);
840 static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient);
841 if (aType2.IsNull()) aType2 = STANDARD_TYPE(Standard_Transient);
843 static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
844 static Handle_Standard_Type _aType = new Standard_Type("GEOM_Function",
845 sizeof(GEOM_Function),
847 (Standard_Address)_Ancestors,
848 (Standard_Address)NULL);
853 //=======================================================================
854 //function : DownCast
856 //=======================================================================
858 const Handle(GEOM_Function) Handle(GEOM_Function)::DownCast(const Handle(Standard_Transient)& AnObject)
860 Handle(GEOM_Function) _anOtherObject;
862 if (!AnObject.IsNull()) {
863 if (AnObject->IsKind(STANDARD_TYPE(GEOM_Function))) {
864 _anOtherObject = Handle(GEOM_Function)((Handle(GEOM_Function)&)AnObject);
868 return _anOtherObject;