-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
if(thePosition <= 0 || theArray.IsNull()) return;
TDF_Label anArgLabel = ARGUMENT(thePosition);
- Handle(TDataStd_ExtStringArray) anArray = new TDataStd_ExtStringArray;
+ Handle(TDataStd_ExtStringArray) anArray =
+ TDataStd_ExtStringArray::Set(anArgLabel, theArray->Lower(), theArray->Upper());
anArray->ChangeArray(theArray);
- anArgLabel.AddAttribute(anArray);
_isDone = true;
}
return anArray->Array();
}
+//=======================================================================
+//function : HasData
+//purpose : Returns true if data of given type already exists
+//=======================================================================
+
+bool GEOM_Function::HasData(int thePosition, const Standard_GUID& dataID)
+{
+ if(thePosition <= 0) return false;
+ TDF_Label anArgLabel = ARGUMENT(thePosition);
+ return anArgLabel.IsAttribute( dataID );
+}
+
//=======================================================================
//function : GetReferencesTreeID
//purpose :
return _label.FindChild(NAMING_LABEL, create);
}
-//=======================================================================
-//function : GEOM_Function_Type_
-//purpose :
-//=======================================================================
-Standard_EXPORT Handle_Standard_Type& GEOM_Function_Type_()
-{
-
- static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared);
- if (aType1.IsNull()) aType1 = STANDARD_TYPE(MMgt_TShared);
- static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient);
- if (aType2.IsNull()) aType2 = STANDARD_TYPE(Standard_Transient);
-
- static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
- static Handle_Standard_Type _aType = new Standard_Type("GEOM_Function",
- sizeof(GEOM_Function),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
-
- return _aType;
-}
-
-//=======================================================================
-//function : DownCast
-//purpose :
-//=======================================================================
-
-const Handle(GEOM_Function) Handle(GEOM_Function)::DownCast(const Handle(Standard_Transient)& AnObject)
-{
- Handle(GEOM_Function) _anOtherObject;
-
- if (!AnObject.IsNull()) {
- if (AnObject->IsKind(STANDARD_TYPE(GEOM_Function))) {
- _anOtherObject = Handle(GEOM_Function)((Handle(GEOM_Function)&)AnObject);
- }
- }
-
- return _anOtherObject;
-}
+IMPLEMENT_STANDARD_HANDLE (GEOM_Function, Standard_Transient);
+IMPLEMENT_STANDARD_RTTIEXT(GEOM_Function, Standard_Transient );