Salome HOME
Add missing preference item
[modules/geom.git] / src / GEOM / GEOM_Function.hxx
index cc83441ae5402df3fb1ea1cdb813d99c36b49d31..688324dae0c173c3edd72a87364e78513e8bde17 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  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
@@ -6,7 +6,7 @@
 // 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
 #ifndef _GEOM_Function_HeaderFile
 #define _GEOM_Function_HeaderFile
 
-#ifndef _Standard_TypeMismatch_HeaderFile
-#include <Standard_TypeMismatch.hxx>
-#endif
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
-#ifndef _Handle_MMgt_TShared_HeaderFile
-#include <Handle_MMgt_TShared.hxx>
-#endif
-#ifndef _MMgt_TShared_HeaderFile
-#include <MMgt_TShared.hxx>
-#endif
-#ifndef _Standard_GUID_HeaderFile
+#include <Standard_Transient.hxx>
 #include <Standard_GUID.hxx>
-#endif
-#ifndef _TopoDS_Shape_HeaderFile
-#include <TopoDS_Shape.hxx>
-#endif
-#ifndef _TDF_Label_HeaderFile
+#include <TColStd_HArray1OfExtendedString.hxx>
+#include <TCollection_AsciiString.hxx>
 #include <TDF_Label.hxx>
-#endif
-#ifndef _TDF_LabelSequence_HeaderFile
 #include <TDF_LabelSequence.hxx>
-#endif
-#ifndef _TColStd_HArray1OfExtendedString_HeaderFile
-#include <TColStd_HArray1OfExtendedString.hxx>
-#endif
+#include <TDataStd_ListOfExtendedString.hxx>
+#include <TopoDS_Shape.hxx>
 
+class Handle_TColStd_HArray1OfByte;
 class Handle_TColStd_HArray1OfReal;
 class Handle_TColStd_HArray1OfInteger;
 class Handle_TColStd_HSequenceOfTransient;
-class Handle_TColStd_HArray1OfExtendedString;
-
-class Standard_Transient;
-class Handle_Standard_Type;
-class Handle(MMgt_TShared);
 class GEOM_Function;
+DEFINE_STANDARD_HANDLE (GEOM_Function, Standard_Transient);
 
-#include <TCollection_AsciiString.hxx>
-#include <TDataStd_ListOfExtendedString.hxx>
-
-Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOM_Function);
-
-class Handle(GEOM_Function) : public Handle(MMgt_TShared) {
-  public:
-    inline void* operator new(size_t,void* anAddress)
-      {
-        return anAddress;
-      }
-    inline void* operator new(size_t size)
-      {
-        return Standard::Allocate(size);
-      }
-    inline void  operator delete(void *anAddress)
-      {
-        if (anAddress) Standard::Free((Standard_Address&)anAddress);
-      }
-
-    Handle(GEOM_Function)():Handle(MMgt_TShared)() {}
-    Handle(GEOM_Function)(const Handle(GEOM_Function)& aHandle) : Handle(MMgt_TShared)(aHandle)
-     {
-     }
-
-    Handle(GEOM_Function)(const GEOM_Function* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem)
-     {
-     }
-
-    Handle(GEOM_Function)& operator=(const Handle(GEOM_Function)& aHandle)
-     {
-      Assign(aHandle.Access());
-      return *this;
-     }
-
-    Handle(GEOM_Function)& operator=(const GEOM_Function* anItem)
-     {
-      Assign((Standard_Transient *)anItem);
-      return *this;
-     }
-
-    GEOM_Function* operator->()
-     {
-      return (GEOM_Function *)ControlAccess();
-     }
-
-    GEOM_Function* operator->() const
-     {
-      return (GEOM_Function *)ControlAccess();
-     }
-
-   Standard_EXPORT ~Handle(GEOM_Function)() {};
-
-   Standard_EXPORT static const Handle(GEOM_Function) DownCast(const Handle(Standard_Transient)& AnObject);
-};
-
-class GEOM_Function : public MMgt_TShared
+class GEOM_Function : public Standard_Transient
 {
-
-public:
-
-    inline void* operator new(size_t,void* anAddress)
-      {
-        return anAddress;
-      }
-    inline void* operator new(size_t size)
-      {
-        return Standard::Allocate(size);
-      }
-    inline void  operator delete(void *anAddress)
-      {
-        if (anAddress) Standard::Free((Standard_Address&)anAddress);
-      }
-
-    // Type management
-    //
-    Standard_EXPORT friend Handle_Standard_Type& GEOM_Function_Type_();
-    Standard_EXPORT const Handle(Standard_Type)& DynamicType() const
-      { return STANDARD_TYPE(GEOM_Function) ; }
-    Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const
-      { return (STANDARD_TYPE(GEOM_Function) == AType || MMgt_TShared::IsKind(AType)); }
-
-
-private:
   GEOM_Function(const TDF_Label& theEntry) { _label = theEntry; }
 
 public:
@@ -163,7 +56,7 @@ public:
 
 
   Standard_EXPORT GEOM_Function(const TDF_Label& theEntry, const Standard_GUID& theGUID, int theType);
-  Standard_EXPORT ~GEOM_Function() {;}
+  Standard_EXPORT ~GEOM_Function() {}
 
   Standard_EXPORT TDF_Label GetOwnerEntry();
 
@@ -216,6 +109,18 @@ public:
   //Returns an integer array argument at position thePosition
   Standard_EXPORT Handle(TColStd_HArray1OfInteger) GetIntegerArray(int thePosition);
 
+  //Sets a byte array argument at position thePosition
+  Standard_EXPORT void SetByteArray(int thePosition, const Handle(TColStd_HArray1OfByte)& theArray);
+
+  //Returns a byte array argument at position thePosition
+  Standard_EXPORT Handle(TColStd_HArray1OfByte) GetByteArray(int thePosition);
+
+  //Sets a boolean array argument at position thePosition
+  Standard_EXPORT void SetBooleanArray(int thePosition, const Handle(TColStd_HArray1OfByte)& theArray);
+
+  //Returns a boolean array argument at position thePosition
+  Standard_EXPORT Handle(TColStd_HArray1OfByte) GetBooleanArray(int thePosition);
+
   //Sets a reference to other function argument at position thePosition
   Standard_EXPORT void SetReference(int thePosition, Handle(GEOM_Function) theReference);
 
@@ -234,6 +139,9 @@ public:
   //Returns the array of ExtendedString
   Standard_EXPORT Handle(TColStd_HArray1OfExtendedString) GetStringArray(int thePosition);
 
+  //Returns true if data of given type already exists
+  Standard_EXPORT bool HasData(int thePosition, const Standard_GUID& dataID);
+
   //Returns a GUID for a references tree
   Standard_EXPORT static const Standard_GUID& GetReferencesTreeID();
 
@@ -276,7 +184,9 @@ public:
   //Returns top label of this function's naming tree
   Standard_EXPORT TDF_Label GetNamingEntry (const Standard_Boolean create = Standard_True);
 
-private:
+  DEFINE_STANDARD_RTTI (GEOM_Function);
+
+  private:
 
   TDF_Label _label;
   bool      _isDone;