Back to index

salome-gui  6.5.0
SALOME_InteractiveObject.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
00024 //  File   : SALOME_InteractiveObject.hxx
00025 //  Module : SALOME
00026 //
00027 #ifndef _SALOME_InteractiveObject_HeaderFile
00028 #define _SALOME_InteractiveObject_HeaderFile
00029 
00030 #ifndef _Standard_HeaderFile
00031 // E.A. : Standard.hxx defines PACKAGE and VERSION --> Pb in Werror mode
00032 // E.A. : --> Add the undef of PACKAGE and VERSION (really ugly !)
00033 #ifdef PACKAGE
00034 #undef PACKAGE
00035 #endif
00036 #ifdef VERSION
00037 #undef VERSION
00038 #endif
00039 #ifdef HAVE_FINITE
00040 #undef HAVE_FINITE
00041 #endif
00042 #include <Standard.hxx>
00043 #endif
00044 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
00045 #include "Handle_SALOME_InteractiveObject.hxx"
00046 #endif
00047 
00048 #ifndef _Standard_CString_HeaderFile
00049 #include <Standard_CString.hxx>
00050 #endif
00051 #ifndef _MMgt_TShared_HeaderFile
00052 #include <MMgt_TShared.hxx>
00053 #endif
00054 #ifndef _Standard_Boolean_HeaderFile
00055 #include <Standard_Boolean.hxx>
00056 #endif
00057 
00058 #include <string>
00059 
00060 class SALOME_InteractiveObject : public MMgt_TShared {
00061 
00062 public:
00063 
00064     void* operator new(size_t,void* anAddress) 
00065       {
00066         return anAddress;
00067       }
00068     void* operator new(size_t size) 
00069       { 
00070         return Standard::Allocate(size); 
00071       }
00072     void  operator delete(void *anAddress) 
00073       { 
00074         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
00075       }
00076  // Methods PUBLIC
00077  // 
00078 Standard_EXPORT   SALOME_InteractiveObject();
00079 Standard_EXPORT   SALOME_InteractiveObject(const char* anEntry, 
00080                                            const char* aComponentDataType,
00081                                            const char* aName = "");
00082 Standard_EXPORT   void setEntry(const char* anEntry) ;
00083 Standard_EXPORT   const char* getEntry() ;
00084 Standard_EXPORT   void setName(const char* aName) ;
00085 Standard_EXPORT   const char* getName() ;
00086 Standard_EXPORT   Standard_Boolean hasEntry() ;
00087 Standard_EXPORT   virtual  Standard_Boolean isSame(const Handle(SALOME_InteractiveObject)& anIO) ;
00088 
00089 Standard_EXPORT   Standard_Boolean hasReference() ;
00090 Standard_EXPORT   const char* getReference() ;
00091 Standard_EXPORT   void setReference(const char* aReference) ;
00092 
00093 Standard_EXPORT   void setComponentDataType(const char* ComponentDataType) ;
00094 Standard_EXPORT   const char* getComponentDataType() ;
00095 Standard_EXPORT   Standard_Boolean isComponentType(const char* ComponentDataType) ; 
00096   //Standard_EXPORT   Standard_Boolean isComponentType(std::string  ComponentDataType) ; 
00097 Standard_EXPORT   virtual ~SALOME_InteractiveObject();
00098 
00099 // Must be defined for using by NCollection for ceratin of data map
00100 friend Standard_Boolean IsEqual(const Handle(SALOME_InteractiveObject)& anIO1,
00101                                 const Handle(SALOME_InteractiveObject)& anIO2)
00102 { return anIO1->isSame( anIO2 ); }
00103 
00104 
00105 
00106 
00107 
00108  // Type management
00109  //
00110  Standard_EXPORT friend Handle_Standard_Type& SALOME_InteractiveObject_Type_();
00111  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
00112  Standard_EXPORT Standard_Boolean              IsKind(const Handle(Standard_Type)&) const;
00113 
00114 protected:
00115 
00116  // Methods PROTECTED
00117  // 
00118 
00119 
00120  // Fields PROTECTED
00121  //
00122   std::string myReference;
00123   std::string myEntry;
00124   std::string myName;
00125   std::string myComponentDataType;
00126 
00127 private: 
00128 
00129  // Methods PRIVATE
00130  // 
00131 
00132 
00133  // Fields PRIVATE
00134  //
00135 
00136 
00137 };
00138 
00139 
00140 
00141 
00142 
00143 // other Inline functions and methods (like "C++: function call" methods)
00144 //
00145 
00146 
00147 #endif