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 #define ARGUMENT_LABEL 1
64 #define RESULT_LABEL 2
65 #define DESCRIPTION_LABEL 3
66 #define HISTORY_LABEL 4
67 #define SUBSHAPES_LABEL 5 // 0020756: GetGroups
68 #define NAMING_LABEL 6 // 002020750: Naming during STEP import
70 #define ARGUMENTS _label.FindChild((ARGUMENT_LABEL))
71 #define ARGUMENT(thePosition) _label.FindChild((ARGUMENT_LABEL)).FindChild((thePosition))
72 #define SUB_ARGUMENT(thePos1, thePos2) _label.FindChild((ARGUMENT_LABEL)).FindChild((thePos1)).FindChild((thePos2))
74 //=======================================================================
75 //function : GetFunctionTreeID
77 //=======================================================================
78 const Standard_GUID& GEOM_Function::GetFunctionTreeID()
80 static Standard_GUID aFunctionTreeID("FF1BBB00-5D14-4df2-980B-3A668264EA16");
81 return aFunctionTreeID;
85 //=======================================================================
86 //function : GetDependencyID
88 //=======================================================================
89 const Standard_GUID& GEOM_Function::GetDependencyID()
91 static Standard_GUID aDependencyID("E2620650-2354-41bd-8C2C-210CFCD00948");
95 //=============================================================================
99 //=============================================================================
100 Handle(GEOM_Function) GEOM_Function::GetFunction(const TDF_Label& theEntry)
102 if(!theEntry.IsAttribute(TFunction_Function::GetID())) return NULL;
104 return new GEOM_Function(theEntry);
107 //=============================================================================
111 //=============================================================================
112 GEOM_Function::GEOM_Function(const TDF_Label& theEntry, const Standard_GUID& theGUID, int theType)
115 TFunction_Function::Set(theEntry, theGUID);
116 TDataStd_Integer::Set(theEntry, theType);
118 //Add function to a function tree
119 Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(theEntry.Data());
120 Handle(TDataStd_TreeNode) aRoot, aNode;
121 if(!aDoc->Main().FindAttribute(GetFunctionTreeID(), aRoot))
122 aRoot = TDataStd_TreeNode::Set(aDoc->Main(), GetFunctionTreeID());
124 aNode = TDataStd_TreeNode::Set(theEntry, GetFunctionTreeID());
125 aRoot->Append(aNode);
128 //=============================================================================
132 //=============================================================================
133 TDF_Label GEOM_Function::GetOwnerEntry()
135 TDF_Label aFather = _label.Father();
136 while(!aFather.IsRoot()) {
137 if(aFather.IsAttribute(GEOM_Object::GetObjectID())) return aFather;
138 aFather = aFather.Father();
144 //=============================================================================
148 //=============================================================================
149 int GEOM_Function::GetType()
152 Handle(TDataStd_Integer) aType;
153 if(!_label.FindAttribute(TDataStd_Integer::GetID(), aType)) return 0;
158 //=============================================================================
162 //=============================================================================
163 TopoDS_Shape GEOM_Function::GetValue()
168 TDF_Label aLabel = GetOwnerEntry();
169 if (aLabel.IsRoot()) return aShape;
170 Handle(GEOM_Object) anObject = GEOM_Object::GetObject(aLabel);
171 if (anObject.IsNull()) return aShape;
173 if (!anObject->IsMainShape()) {
174 bool isResult = false;
175 TDF_Label aResultLabel = _label.FindChild(RESULT_LABEL);
176 if (!aResultLabel.IsNull()) {
177 Handle(TNaming_NamedShape) aNS;
178 if (aResultLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS))
185 Standard_Integer aTic = anObject->GetTic();
188 GEOM_ISubShape aCI (this);
189 TDF_Label aLabelObjMainSh = aCI.GetMainShape()->GetOwnerEntry();
190 if (aLabelObjMainSh.IsRoot()) return aShape;
191 Handle(GEOM_Object) anObjMainSh = GEOM_Object::GetObject(aLabelObjMainSh);
192 if (anObjMainSh.IsNull()) return aShape;
193 Standard_Integer aTicMainSh = anObjMainSh->GetTic();
196 isResult = ((aTic == aTicMainSh) ? true : false);
201 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
204 GEOM_Solver aSolver(GEOM_Engine::GetEngine());
205 if (!aSolver.ComputeFunction(this)) {
206 MESSAGE("GEOM_Object::GetValue Error : Can't build a sub shape");
210 catch (Standard_Failure) {
211 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
212 MESSAGE("GEOM_Function::GetValue Error: " << aFail->GetMessageString());
218 TDF_Label aResultLabel = _label.FindChild(RESULT_LABEL);
219 Handle(TNaming_NamedShape) aNS;
220 if (!aResultLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS)) return aShape;
228 //=============================================================================
232 //=============================================================================
233 void GEOM_Function::SetValue(TopoDS_Shape& theShape)
236 TDF_Label aResultLabel = _label.FindChild(RESULT_LABEL);
237 TNaming_Builder aBuilder(aResultLabel);
239 aBuilder.Generated(theShape);
241 // synchronisation between main shape and its sub-shapes
242 TDF_Label aLabel = GetOwnerEntry();
243 if (aLabel.IsRoot()) return;
244 Handle(GEOM_Object) anObject = GEOM_Object::GetObject(aLabel);
245 if (anObject.IsNull()) return;
246 if (anObject->IsMainShape()) {
247 // increase modifications counter of this (main) shape
248 anObject->IncrementTic();
251 // update modifications counter of this (sub-) shape to be the same as on main shape
252 GEOM_ISubShape aCI (this);
253 TDF_Label aLabelObjMainSh = aCI.GetMainShape()->GetOwnerEntry();
254 if (aLabelObjMainSh.IsRoot()) return;
255 Handle(GEOM_Object) anObjMainSh = GEOM_Object::GetObject(aLabelObjMainSh);
256 if (anObjMainSh.IsNull()) return;
258 anObject->SetTic(anObjMainSh->GetTic());
264 //=============================================================================
268 //=============================================================================
269 Standard_GUID GEOM_Function::GetDriverGUID()
271 Handle(TFunction_Function) aFunction;
272 if(!_label.FindAttribute(TFunction_Function::GetID(), aFunction)) {
273 return TDF::LowestID();
276 return aFunction->GetDriverGUID();
279 //=============================================================================
283 //=============================================================================
284 TCollection_AsciiString GEOM_Function::GetDescription()
286 Handle(TDataStd_Comment) aComment;
287 TDF_Label aChild = _label.FindChild(DESCRIPTION_LABEL);
288 if(!aChild.FindAttribute(TDataStd_Comment::GetID(), aComment)) return TCollection_AsciiString();
289 TCollection_AsciiString aDescr(aComment->Get());
293 //=============================================================================
297 //=============================================================================
298 void GEOM_Function::SetDescription(const TCollection_AsciiString& theDescription)
300 TDF_Label aChild = _label.FindChild(DESCRIPTION_LABEL);
301 Handle(TDataStd_Comment) aComment =
302 TDataStd_Comment::Set(aChild, TCollection_ExtendedString(theDescription));
305 //=============================================================================
309 //=============================================================================
310 void GEOM_Function::SetReal(int thePosition, double theValue)
313 if(thePosition <= 0) return;
314 TDF_Label anArgLabel = ARGUMENT(thePosition);
315 TDataStd_Real::Set(anArgLabel, theValue);
319 //=============================================================================
323 //=============================================================================
324 void GEOM_Function::SetRealArray (int thePosition,
325 const Handle(TColStd_HArray1OfReal)& theArray)
328 if(thePosition <= 0) return;
329 TDF_Label anArgLabel = ARGUMENT(thePosition);
330 Handle(TDataStd_RealArray) anAttr =
331 TDataStd_RealArray::Set(anArgLabel, theArray->Lower(), theArray->Upper());
332 anAttr->ChangeArray(theArray);
336 //=============================================================================
340 //=============================================================================
341 double GEOM_Function::GetReal(int thePosition)
344 if(thePosition <= 0) return 0.0;
345 Handle(TDataStd_Real) aReal;
346 TDF_Label anArgLabel = ARGUMENT(thePosition);
347 if(!anArgLabel.FindAttribute(TDataStd_Real::GetID(), aReal)) return 0.0;
353 //=============================================================================
357 //=============================================================================
358 Handle(TColStd_HArray1OfReal) GEOM_Function::GetRealArray(int thePosition)
361 if(thePosition <= 0) return NULL;
362 Handle(TDataStd_RealArray) aRealArray;
363 TDF_Label anArgLabel = ARGUMENT(thePosition);
364 if(!anArgLabel.FindAttribute(TDataStd_RealArray::GetID(), aRealArray)) return NULL;
367 return aRealArray->Array();
370 //=============================================================================
374 //=============================================================================
375 void GEOM_Function::SetInteger(int thePosition, int theValue)
378 if(thePosition <= 0) return;
379 TDF_Label anArgLabel = ARGUMENT(thePosition);
380 TDataStd_Integer::Set(anArgLabel, theValue);
384 //=============================================================================
388 //=============================================================================
389 void GEOM_Function::SetIntegerArray (int thePosition,
390 const Handle(TColStd_HArray1OfInteger)& theArray)
393 if(thePosition <= 0) return;
394 TDF_Label anArgLabel = ARGUMENT(thePosition);
395 Handle(TDataStd_IntegerArray) anAttr =
396 TDataStd_IntegerArray::Set(anArgLabel, theArray->Lower(), theArray->Upper());
397 anAttr->ChangeArray(theArray);
401 //=============================================================================
405 //=============================================================================
406 int GEOM_Function::GetInteger(int thePosition)
409 if(thePosition <= 0) return 0;
410 Handle(TDataStd_Integer) anInteger;
411 TDF_Label anArgLabel = ARGUMENT(thePosition);
412 if(!anArgLabel.FindAttribute(TDataStd_Integer::GetID(), anInteger)) return 0;
415 return anInteger->Get();
418 //=============================================================================
422 //=============================================================================
423 Handle(TColStd_HArray1OfInteger) GEOM_Function::GetIntegerArray(int thePosition)
426 if(thePosition <= 0) return 0;
427 Handle(TDataStd_IntegerArray) anIntegerArray;
428 TDF_Label anArgLabel = ARGUMENT(thePosition);
429 if(!anArgLabel.FindAttribute(TDataStd_IntegerArray::GetID(), anIntegerArray)) return 0;
432 return anIntegerArray->Array();
435 //=============================================================================
439 //=============================================================================
440 void GEOM_Function::SetString(int thePosition, const TCollection_AsciiString& theValue)
443 if(thePosition <= 0) return;
444 TDF_Label anArgLabel = ARGUMENT(thePosition);
445 TDataStd_Comment::Set(anArgLabel, theValue);
449 //=============================================================================
453 //=============================================================================
454 TCollection_AsciiString GEOM_Function::GetString(int thePosition)
457 TCollection_AsciiString aRes;
458 if(thePosition <= 0) return aRes;
459 Handle(TDataStd_Comment) aString;
460 TDF_Label anArgLabel = ARGUMENT(thePosition);
461 if(!anArgLabel.FindAttribute(TDataStd_Comment::GetID(), aString)) return aRes;
464 aRes = TCollection_AsciiString(aString->Get());
468 //=============================================================================
472 //=============================================================================
473 void GEOM_Function::SetReference(int thePosition, Handle(GEOM_Function) theReference)
476 if (thePosition <= 0) return;
477 if (theReference.IsNull()) return;
478 TDF_Label anArgLabel = ARGUMENT(thePosition);
479 TDF_Reference::Set(anArgLabel, theReference->GetEntry());
480 TDataStd_UAttribute::Set(anArgLabel, GetDependencyID());
485 //=============================================================================
489 //=============================================================================
490 Handle(GEOM_Function) GEOM_Function::GetReference(int thePosition)
493 if(thePosition <= 0) return NULL;
494 TDF_Label anArgLabel = ARGUMENT(thePosition);
495 Handle(TDF_Reference) aRef;
496 if(!anArgLabel.FindAttribute(TDF_Reference::GetID(), aRef)) return NULL;
499 return GetFunction(aRef->Get());
503 //=============================================================================
507 //=============================================================================
508 void GEOM_Function::SetStringArray(int thePosition, const Handle(TColStd_HArray1OfExtendedString)& theArray)
511 if(thePosition <= 0 || theArray.IsNull()) return;
512 TDF_Label anArgLabel = ARGUMENT(thePosition);
514 Handle(TDataStd_ExtStringArray) anArray = new TDataStd_ExtStringArray;
515 anArray->ChangeArray(theArray);
516 anArgLabel.AddAttribute(anArray);
522 //=============================================================================
526 //=============================================================================
527 Handle(TColStd_HArray1OfExtendedString) GEOM_Function::GetStringArray(int thePosition)
530 if(thePosition <= 0) return NULL;
531 TDF_Label anArgLabel = ARGUMENT(thePosition);
532 Handle(TDataStd_ExtStringArray) anArray;
533 if(!anArgLabel.FindAttribute(TDataStd_ExtStringArray::GetID(), anArray)) return NULL;
536 return anArray->Array();
539 //=======================================================================
540 //function : GetReferencesTreeID
542 //=======================================================================
543 const Standard_GUID& GEOM_Function::GetReferencesTreeID()
545 static Standard_GUID aReferencesTreeID("FF1BBB10-5D14-4df2-980B-3A668264EA16");
546 return aReferencesTreeID;
549 //=============================================================================
553 //=============================================================================
554 void GEOM_Function::SetReferenceList (int thePosition,
555 const Handle(TColStd_HSequenceOfTransient)& theRefList)
558 if(thePosition <= 0) return;
560 // parent label for the list of references
561 TDF_Label anArgLabel = ARGUMENT(thePosition);
562 anArgLabel.ForgetAllAttributes();
564 // set TreeNode on the parent label
565 Handle(TDataStd_TreeNode) aRoot, aNode;
566 aRoot = TDataStd_TreeNode::Set(anArgLabel, GetReferencesTreeID());
568 // store references on sub-labels of the parent label
569 Handle(GEOM_Function) aFunc;
570 Standard_Integer ind, len = theRefList->Length();
571 for (ind = 1; ind <= len; ind++) {
572 aFunc = Handle(GEOM_Function)::DownCast(theRefList->Value(ind));
573 if (aFunc.IsNull()) continue;
574 TDF_Label anArgLabel_i = SUB_ARGUMENT(thePosition, ind);
575 TDF_Reference::Set(anArgLabel_i, aFunc->GetEntry());
576 TDataStd_UAttribute::Set(anArgLabel_i, GetDependencyID());
578 // set TreeNode on the child label
579 aNode = TDataStd_TreeNode::Set(anArgLabel_i, GetReferencesTreeID());
580 aRoot->Append(aNode);
587 //=============================================================================
591 //=============================================================================
592 Handle(TColStd_HSequenceOfTransient) GEOM_Function::GetReferenceList(int thePosition)
594 Handle(TColStd_HSequenceOfTransient) aResult = new TColStd_HSequenceOfTransient;
596 if(thePosition <= 0) return aResult;
598 // parent label for the list of references
599 TDF_Label anArgLabel = ARGUMENT(thePosition);
600 Handle(TDF_Reference) aRef;
602 // get TreeNode on the parent label
603 Handle(TDataStd_TreeNode) aRoot, aNode;
604 if(!anArgLabel.FindAttribute(GetReferencesTreeID(), aRoot))
607 // get references, stored on sub-labels of the parent label
609 TDataStd_ChildNodeIterator anIter (aRoot);
610 for (; anIter.More(); anIter.Next()) {
611 aNode = anIter.Value();
612 aLabel_i = aNode->Label();
613 if (!aLabel_i.FindAttribute(TDF_Reference::GetID(), aRef)) continue;
614 Handle(GEOM_Function) aFunc_i = GetFunction(aRef->Get());
615 if (aFunc_i.IsNull()) continue;
616 aResult->Append(aFunc_i);
623 //=============================================================================
627 //=============================================================================
628 //void GEOM_Function::SetShape(int thePosition, const TopoDS_Shape& theShape)
631 // if(thePosition <= 0 || theShape.IsNull()) return;
633 // TDF_Label anArgLabel = ARGUMENT(thePosition);
634 // TNaming_Builder aBuilder(anArgLabel);
635 // aBuilder.Generated(theShape);
641 //=============================================================================
645 //=============================================================================
646 //TopoDS_Shape GEOM_Function::GetShape(int thePosition)
649 // TopoDS_Shape aShape;
650 // if(thePosition <= 0) return aShape;
652 // TDF_Label anArgLabel = ARGUMENT(thePosition);
653 // Handle(TNaming_NamedShape) aNS;
654 // if(!anArgLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS)) return aShape;
656 // aShape = aNS->Get();
662 //=============================================================================
666 //=============================================================================
667 void GEOM_Function::GetDependency(TDF_LabelSequence& theSeq)
669 TDF_ChildIterator anIterator(ARGUMENTS, Standard_True);
670 for(; anIterator.More(); anIterator.Next()) {
671 if(anIterator.Value().IsAttribute(GetDependencyID())) theSeq.Append(anIterator.Value());
675 //=============================================================================
677 * AddSubShapeReference
679 //=============================================================================
680 void GEOM_Function::AddSubShapeReference(Handle(GEOM_Function) theSubShape)
684 TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL);
686 Handle(TDataStd_ExtStringList) aList;
687 if (!aSubShapesLabel.FindAttribute(TDataStd_ExtStringList::GetID(), aList)) {
688 aList = new TDataStd_ExtStringList;
689 aSubShapesLabel.AddAttribute(aList);
692 TCollection_AsciiString anEntry;
693 TDF_Tool::Entry(theSubShape->GetOwnerEntry(), anEntry);
694 aList->Append(anEntry);
699 //=============================================================================
701 * RemoveSubShapeReference
703 //=============================================================================
704 void GEOM_Function::RemoveSubShapeReference(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 TCollection_AsciiString anEntry;
713 TDF_Tool::Entry(theSubShape->GetOwnerEntry(), anEntry);
714 aList->Remove(anEntry);
720 //=============================================================================
722 * HasSubShapeReferences
724 //=============================================================================
725 bool GEOM_Function::HasSubShapeReferences()
729 TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL);
730 return aSubShapesLabel.IsAttribute(TDataStd_ExtStringList::GetID());
733 //=============================================================================
735 * GetSubShapeReferences
737 //=============================================================================
738 const TDataStd_ListOfExtendedString& GEOM_Function::GetSubShapeReferences()
742 TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL);
744 Handle(TDataStd_ExtStringList) aList;
745 if (!aSubShapesLabel.FindAttribute(TDataStd_ExtStringList::GetID(), aList)) {
746 aList = new TDataStd_ExtStringList;
747 aSubShapesLabel.AddAttribute(aList);
751 return aList->List();
754 //=============================================================================
758 //=============================================================================
759 TDF_Label GEOM_Function::GetHistoryEntry (const Standard_Boolean create)
761 return _label.FindChild(HISTORY_LABEL, create);
764 //=============================================================================
766 * GetArgumentHistoryEntry
768 //=============================================================================
769 TDF_Label GEOM_Function::GetArgumentHistoryEntry (const TDF_Label& theArgumentRefEntry,
770 const Standard_Boolean create)
772 TColStd_ListOfInteger anArgumentRefTags;
773 TDF_Tool::TagList(theArgumentRefEntry, anArgumentRefTags);
774 Standard_Integer anArgumentRefLabelPos = anArgumentRefTags.Extent();
776 TDF_Label aHistoryLabel = GetHistoryEntry(create);
777 if (aHistoryLabel.IsNull())
778 return aHistoryLabel;
779 Standard_Integer aHistoryLabelPos = aHistoryLabel.Depth() + 1;
781 Standard_Integer itag;
782 TDF_Label aHistoryCurLabel = aHistoryLabel;
783 TColStd_ListIteratorOfListOfInteger aListIter (anArgumentRefTags);
784 for (itag = 1; itag <= aHistoryLabelPos; itag++) {
787 for (; itag <= anArgumentRefLabelPos; itag++) {
788 aHistoryCurLabel = aHistoryCurLabel.FindChild(aListIter.Value(), create);
789 if (aHistoryCurLabel.IsNull())
790 return aHistoryCurLabel;
794 return aHistoryCurLabel;
797 //=============================================================================
801 //=============================================================================
802 TDF_Label GEOM_Function::GetNamingEntry (const Standard_Boolean create)
804 return _label.FindChild(NAMING_LABEL, create);
807 //=======================================================================
808 //function : GEOM_Function_Type_
810 //=======================================================================
811 Standard_EXPORT Handle_Standard_Type& GEOM_Function_Type_()
814 static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared);
815 if (aType1.IsNull()) aType1 = STANDARD_TYPE(MMgt_TShared);
816 static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient);
817 if (aType2.IsNull()) aType2 = STANDARD_TYPE(Standard_Transient);
819 static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
820 static Handle_Standard_Type _aType = new Standard_Type("GEOM_Function",
821 sizeof(GEOM_Function),
823 (Standard_Address)_Ancestors,
824 (Standard_Address)NULL);
829 //=======================================================================
830 //function : DownCast
832 //=======================================================================
834 const Handle(GEOM_Function) Handle(GEOM_Function)::DownCast(const Handle(Standard_Transient)& AnObject)
836 Handle(GEOM_Function) _anOtherObject;
838 if (!AnObject.IsNull()) {
839 if (AnObject->IsKind(STANDARD_TYPE(GEOM_Function))) {
840 _anOtherObject = Handle(GEOM_Function)((Handle(GEOM_Function)&)AnObject);
844 return _anOtherObject;