From 366e4509daf230e0ce8fc400e6e691b0faeed3fa Mon Sep 17 00:00:00 2001 From: abd Date: Fri, 8 Aug 2008 07:11:41 +0000 Subject: [PATCH] Merging with BR_WPdev_For_5_0 --- src/Container/Container_i.cxx | 1 + src/Container/SALOME_Container.cxx | 10 +- .../SALOME_ResourcesManager.hxx | 19 +- src/SALOMEDSImpl/Makefile.am | 2 + .../SALOMEDSImpl_AttributeComment.cxx | 10 +- .../SALOMEDSImpl_AttributeComment.hxx | 32 +-- .../SALOMEDSImpl_AttributeDrawable.hxx | 40 ++-- .../SALOMEDSImpl_AttributeExpandable.hxx | 36 ++-- .../SALOMEDSImpl_AttributeExternalFileDef.hxx | 37 ++-- .../SALOMEDSImpl_AttributeFileType.hxx | 37 ++-- .../SALOMEDSImpl_AttributeFlags.hxx | 43 ++-- .../SALOMEDSImpl_AttributeGraphic.hxx | 43 ++-- .../SALOMEDSImpl_AttributeIOR.hxx | 28 +-- .../SALOMEDSImpl_AttributeInteger.cxx | 5 +- .../SALOMEDSImpl_AttributeInteger.hxx | 33 ++-- .../SALOMEDSImpl_AttributeLocalID.hxx | 32 +-- .../SALOMEDSImpl_AttributeName.hxx | 30 +-- .../SALOMEDSImpl_AttributeOpened.hxx | 32 +-- .../SALOMEDSImpl_AttributeParameter.hxx | 103 +++++----- .../SALOMEDSImpl_AttributePersistentRef.hxx | 34 ++-- .../SALOMEDSImpl_AttributePixMap.hxx | 36 ++-- .../SALOMEDSImpl_AttributePythonObject.hxx | 38 ++-- .../SALOMEDSImpl_AttributeReal.hxx | 28 +-- .../SALOMEDSImpl_AttributeReference.hxx | 30 +-- .../SALOMEDSImpl_AttributeSelectable.hxx | 32 +-- ...ALOMEDSImpl_AttributeSequenceOfInteger.hxx | 42 ++-- .../SALOMEDSImpl_AttributeSequenceOfReal.hxx | 42 ++-- .../SALOMEDSImpl_AttributeStudyProperties.hxx | 99 +++++----- .../SALOMEDSImpl_AttributeTableOfInteger.cxx | 2 +- .../SALOMEDSImpl_AttributeTableOfInteger.hxx | 88 +++++---- .../SALOMEDSImpl_AttributeTableOfReal.cxx | 6 +- .../SALOMEDSImpl_AttributeTableOfReal.hxx | 88 +++++---- .../SALOMEDSImpl_AttributeTableOfString.cxx | 2 +- .../SALOMEDSImpl_AttributeTableOfString.hxx | 88 +++++---- .../SALOMEDSImpl_AttributeTarget.hxx | 36 ++-- .../SALOMEDSImpl_AttributeTextColor.hxx | 28 +-- ...LOMEDSImpl_AttributeTextHighlightColor.hxx | 28 +-- .../SALOMEDSImpl_AttributeTreeNode.hxx | 108 +++++----- .../SALOMEDSImpl_AttributeUserID.hxx | 42 ++-- src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx | 10 +- src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx | 28 +-- .../SALOMEDSImpl_ChildIterator.hxx | 34 ++-- .../SALOMEDSImpl_ChildNodeIterator.hxx | 25 +-- src/SALOMEDSImpl/SALOMEDSImpl_Defines.hxx | 39 ++++ src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx | 67 +++---- .../SALOMEDSImpl_GenericAttribute.cxx | 14 +- .../SALOMEDSImpl_GenericAttribute.hxx | 26 +-- src/SALOMEDSImpl/SALOMEDSImpl_IParameters.hxx | 89 ++++----- src/SALOMEDSImpl/SALOMEDSImpl_SComponent.hxx | 31 +-- .../SALOMEDSImpl_SComponentIterator.hxx | 12 +- src/SALOMEDSImpl/SALOMEDSImpl_SObject.hxx | 64 +++--- src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx | 187 +++++++++--------- .../SALOMEDSImpl_StudyBuilder.hxx | 99 +++++----- src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.hxx | 38 ++-- .../SALOMEDSImpl_StudyManager.cxx | 18 +- .../SALOMEDSImpl_StudyManager.hxx | 110 ++++++----- src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.hxx | 9 +- src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx | 18 +- src/SALOMEDSImpl/SALOMEDSImpl_Tool.hxx | 4 +- .../SALOMEDSImpl_UseCaseBuilder.hxx | 42 ++-- .../SALOMEDSImpl_UseCaseIterator.hxx | 12 +- src/TOOLSDS/SALOMEDS_Tool.cxx | 16 +- src/Utils/OpUtil.cxx | 169 ++++++++++++++++ src/Utils/OpUtil.hxx | 20 ++ 64 files changed, 1476 insertions(+), 1175 deletions(-) create mode 100755 src/SALOMEDSImpl/SALOMEDSImpl_Defines.hxx diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 985fd4e42..22e9c8352 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -37,6 +37,7 @@ #else #include #include +#include int SIGUSR1 = 1000; #endif diff --git a/src/Container/SALOME_Container.cxx b/src/Container/SALOME_Container.cxx index 61401e7f0..652728b3e 100644 --- a/src/Container/SALOME_Container.cxx +++ b/src/Container/SALOME_Container.cxx @@ -65,8 +65,11 @@ extern "C" void HandleServerSideSignals(CORBA::ORB_ptr theORB); #include #include #include -#include +#ifndef WIN32 +# include +#endif +#ifndef WIN32 typedef void (*sighandler_t)(int); sighandler_t setsig(int sig, sighandler_t handler) { @@ -78,9 +81,11 @@ sighandler_t setsig(int sig, sighandler_t handler) return SIG_ERR; return ocontext.sa_handler; } +#endif //WIN32 void AttachDebugger() { +#ifndef WIN32 if(getenv ("DEBUGGER")) { std::stringstream exec; @@ -89,6 +94,7 @@ void AttachDebugger() system(exec.str().c_str()); while(1); } +#endif } void Handler(int theSigId) @@ -117,12 +123,14 @@ int main(int argc, char* argv[]) MPI_Init(&argc,&argv); #endif +#ifndef WIN32 if(getenv ("DEBUGGER")) { setsig(SIGSEGV,&Handler); set_terminate(&terminateHandler); set_unexpected(&unexpectedHandler); } +#endif // Initialise the ORB. //SRN: BugID: IPAL9541, it's necessary to set a size of one message to be at least 100Mb diff --git a/src/ResourcesManager/SALOME_ResourcesManager.hxx b/src/ResourcesManager/SALOME_ResourcesManager.hxx index f2fdc259b..dceb9db67 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.hxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.hxx @@ -32,18 +32,15 @@ #include #include "ResourcesManager.hxx" -#if defined RESOURCESMANAGER_EXPORTS -#if defined WIN32 -#define RESOURCESMANAGER_EXPORT __declspec( dllexport ) -#else -#define RESOURCESMANAGER_EXPORT -#endif -#else -#if defined WNT -#define RESOURCESMANAGER_EXPORT __declspec( dllimport ) + +#ifdef WIN32 +# ifdef RESOURCESMANAGER_EXPORTS +# define RESOURCESMANAGER_EXPORT __declspec( dllexport ) +# else +# define RESOURCESMANAGER_EXPORT __declspec( dllimport ) +# endif #else -#define RESOURCESMANAGER_EXPORT -#endif +# define RESOURCESMANAGER_EXPORT #endif // --- WARNING --- diff --git a/src/SALOMEDSImpl/Makefile.am b/src/SALOMEDSImpl/Makefile.am index 4ca4e58ab..de0b5f12e 100644 --- a/src/SALOMEDSImpl/Makefile.am +++ b/src/SALOMEDSImpl/Makefile.am @@ -74,6 +74,7 @@ salomeinclude_HEADERS= \ SALOMEDSImpl_Study.hxx \ SALOMEDSImpl_StudyManager.hxx \ SALOMEDSImpl_ChildNodeIterator.hxx \ + SALOMEDSImpl_Defines.hxx \ SALOMEDSImpl_IParameters.hxx \ SALOMEDSImpl_TMPFile.hxx @@ -189,6 +190,7 @@ libSalomeDSImpl_la_SOURCES =\ SALOMEDSImpl_Callback.hxx \ SALOMEDSImpl_ChildIterator.hxx \ SALOMEDSImpl_ChildNodeIterator.hxx \ + SALOMEDSImpl_Defines.hxx \ SALOMEDSImpl_Driver.hxx \ SALOMEDSImpl_GenericAttribute.hxx \ SALOMEDSImpl_SComponent.hxx \ diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx index e76570dd1..45be60a9d 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx @@ -23,22 +23,20 @@ #include "SALOMEDSImpl_AttributeComment.hxx" -#ifndef WNT using namespace std; -#endif //======================================================================= //function : GetID //purpose : //======================================================================= -const std::string& SALOMEDSImpl_AttributeComment::GetID () +const string& SALOMEDSImpl_AttributeComment::GetID () { - static std::string CommentID ("7AF2F7CC-1CA2-4476-BE95-8ACC996BC7B9"); + static string CommentID ("7AF2F7CC-1CA2-4476-BE95-8ACC996BC7B9"); return CommentID; } SALOMEDSImpl_AttributeComment* SALOMEDSImpl_AttributeComment::Set (const DF_Label& L, - const std::string& Val) + const string& Val) { SALOMEDSImpl_AttributeComment* A = NULL; if (!(A=(SALOMEDSImpl_AttributeComment*)L.FindAttribute(SALOMEDSImpl_AttributeComment::GetID()))) { @@ -73,7 +71,7 @@ void SALOMEDSImpl_AttributeComment::SetValue (const string& S) //function : ID //purpose : //======================================================================= -const std::string& SALOMEDSImpl_AttributeComment::ID () const { return GetID(); } +const string& SALOMEDSImpl_AttributeComment::ID () const { return GetID(); } //======================================================================= //function : NewEmpty diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.hxx index 8f6e361b5..71f7e25e5 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.hxx @@ -24,37 +24,39 @@ #ifndef _SALOMEDSImpl_AttributeComment_HeaderFile #define _SALOMEDSImpl_AttributeComment_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" +#include "SALOMEDSImpl_GenericAttribute.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" -#include "SALOMEDSImpl_GenericAttribute.hxx" #include -class SALOMEDSImpl_AttributeComment : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeComment : + public SALOMEDSImpl_GenericAttribute { private: - std::string myString; + std::string myString; public: -Standard_EXPORT static const std::string& GetID() ; + static const std::string& GetID() ; -Standard_EXPORT SALOMEDSImpl_AttributeComment() :SALOMEDSImpl_GenericAttribute("AttributeComment") {} + SALOMEDSImpl_AttributeComment() :SALOMEDSImpl_GenericAttribute("AttributeComment") {} -Standard_EXPORT static SALOMEDSImpl_AttributeComment* Set(const DF_Label& L, const std::string& Val); -Standard_EXPORT void SetValue (const std::string& S); -Standard_EXPORT std::string Value() const { return myString; } + static SALOMEDSImpl_AttributeComment* Set(const DF_Label& L, const std::string& Val); + void SetValue (const std::string& S); + std::string Value() const { return myString; } -Standard_EXPORT virtual std::string Save() { return myString; } -Standard_EXPORT virtual void Load(const std::string& theValue) { myString = theValue; } + virtual std::string Save() { return myString; } + virtual void Load(const std::string& theValue) { myString = theValue; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeComment() {} + ~SALOMEDSImpl_AttributeComment() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.hxx index 9fa1122e7..d1b464bfd 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.hxx @@ -24,31 +24,33 @@ #ifndef _SALOMEDSImpl_AttributeDrawable_HeaderFile #define _SALOMEDSImpl_AttributeDrawable_HeaderFile +#include "SALOMEDSImpl_GenericAttribute.hxx" +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" -#include #include "DF_Label.hxx" -#include "SALOMEDSImpl_GenericAttribute.hxx" - -class SALOMEDSImpl_AttributeDrawable : public SALOMEDSImpl_GenericAttribute +#include + +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeDrawable : + public SALOMEDSImpl_GenericAttribute { private: -int myValue; + int myValue; public: -Standard_EXPORT virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } -Standard_EXPORT virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeDrawable* Set(const DF_Label& label,const int value) ; - -Standard_EXPORT void SetDrawable(const int theValue); -Standard_EXPORT int IsDrawable() const { return myValue; } -Standard_EXPORT SALOMEDSImpl_AttributeDrawable(); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeDrawable() {} + virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } + virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeDrawable* Set(const DF_Label& label,const int value) ; + + void SetDrawable(const int theValue); + int IsDrawable() const { return myValue; } + SALOMEDSImpl_AttributeDrawable(); + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeDrawable() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.hxx index 8b80e3b39..c22b57ab6 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.hxx @@ -24,32 +24,34 @@ #ifndef _SALOMEDSImpl_AttributeExpandable_HeaderFile #define _SALOMEDSImpl_AttributeExpandable_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" +#include "SALOMEDSImpl_GenericAttribute.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" -#include -#include "SALOMEDSImpl_GenericAttribute.hxx" +#include -class SALOMEDSImpl_AttributeExpandable : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeExpandable : + public SALOMEDSImpl_GenericAttribute { private: -int myValue; + int myValue; public: -Standard_EXPORT virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } -Standard_EXPORT virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeExpandable* Set(const DF_Label& label,const int value) ; -Standard_EXPORT SALOMEDSImpl_AttributeExpandable(); -Standard_EXPORT void SetExpandable(const int value); -Standard_EXPORT int IsExpandable() const { return myValue; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeExpandable() {} + virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } + virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeExpandable* Set(const DF_Label& label,const int value) ; + SALOMEDSImpl_AttributeExpandable(); + void SetExpandable(const int value); + int IsExpandable() const { return myValue; } + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeExpandable() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.hxx index 2222717bd..ee5649952 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.hxx @@ -21,32 +21,35 @@ #ifndef _SALOMEDSImpl_AttributeExternalFileDef_HeaderFile #define _SALOMEDSImpl_AttributeExternalFileDef_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" +#include "SALOMEDSImpl_GenericAttribute.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include -#include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeExternalFileDef : public SALOMEDSImpl_GenericAttribute + +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeExternalFileDef : + public SALOMEDSImpl_GenericAttribute { private: - std::string myString; + std::string myString; public: -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeExternalFileDef* Set(const DF_Label& label, - const std::string& Name); -Standard_EXPORT SALOMEDSImpl_AttributeExternalFileDef(); -Standard_EXPORT void SetValue(const std::string& value); -Standard_EXPORT std::string Value() const { return myString; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeExternalFileDef() {} - -Standard_EXPORT virtual std::string Save() { return myString; } -Standard_EXPORT virtual void Load(const std::string& theValue) { myString = theValue; } + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeExternalFileDef* Set(const DF_Label& label, + const std::string& Name); + SALOMEDSImpl_AttributeExternalFileDef(); + void SetValue(const std::string& value); + std::string Value() const { return myString; } + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeExternalFileDef() {} + + virtual std::string Save() { return myString; } + virtual void Load(const std::string& theValue) { myString = theValue; } }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.hxx index a4d61fe96..d5396bd02 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.hxx @@ -21,32 +21,35 @@ #ifndef _SALOMEDSImpl_AttributeFileType_HeaderFile #define _SALOMEDSImpl_AttributeFileType_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" +#include "SALOMEDSImpl_GenericAttribute.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include -#include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeFileType : public SALOMEDSImpl_GenericAttribute + +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeFileType : + public SALOMEDSImpl_GenericAttribute { private: - std::string myString; + std::string myString; public: -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeFileType* Set(const DF_Label& label, - const std::string& Name) ; -Standard_EXPORT SALOMEDSImpl_AttributeFileType(); -Standard_EXPORT void SetValue(const std::string& value); -Standard_EXPORT std::string Value() const { return myString; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeFileType() {} - -Standard_EXPORT virtual std::string Save() { return myString; } -Standard_EXPORT virtual void Load(const std::string& theValue) { myString = theValue; } + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeFileType* Set(const DF_Label& label, + const std::string& Name) ; + SALOMEDSImpl_AttributeFileType(); + void SetValue(const std::string& value); + std::string Value() const { return myString; } + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeFileType() {} + + virtual std::string Save() { return myString; } + virtual void Load(const std::string& theValue) { myString = theValue; } }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.hxx index 773df8891..353c1ed21 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.hxx @@ -24,38 +24,37 @@ #ifndef SALOMEDSImpl_AttributeFlags_HeaderFile #define SALOMEDSImpl_AttributeFlags_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" +#include "SALOMEDSImpl_GenericAttribute.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" -#include "SALOMEDSImpl_GenericAttribute.hxx" + /* - Class : SALOMEDSImpl_AttributeFlags - Description : This class is intended for storing different object attributes that - have only two states (0 and 1). +Class : SALOMEDSImpl_AttributeFlags +Description : This class is intended for storing different object attributes that +have only two states (0 and 1). */ -#ifndef WNT -class Standard_EXPORT SALOMEDSImpl_AttributeFlags : public SALOMEDSImpl_GenericAttribute -#else -class SALOMEDSImpl_AttributeFlags : public SALOMEDSImpl_GenericAttribute -#endif +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeFlags : + public SALOMEDSImpl_GenericAttribute { private: -int myValue; + int myValue; public: -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeFlags* Set(const DF_Label&, const int theValue ); - - SALOMEDSImpl_AttributeFlags(); -Standard_EXPORT virtual ~SALOMEDSImpl_AttributeFlags(); - -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore( DF_Attribute* with ); -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste( DF_Attribute* into); -Standard_EXPORT void Set( const int ); -Standard_EXPORT int Get() const; + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeFlags* Set(const DF_Label&, const int theValue ); + + SALOMEDSImpl_AttributeFlags(); + virtual ~SALOMEDSImpl_AttributeFlags(); + + const std::string& ID() const; + void Restore( DF_Attribute* with ); + DF_Attribute* NewEmpty() const; + void Paste( DF_Attribute* into); + void Set( const int ); + int Get() const; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.hxx index 69801875a..5358b81ec 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.hxx @@ -24,42 +24,39 @@ #ifndef SALOMEDSImpl_AttributeGraphic_HeaderFile #define SALOMEDSImpl_AttributeGraphic_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" +#include "SALOMEDSImpl_GenericAttribute.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" -#include "SALOMEDSImpl_GenericAttribute.hxx" - #include /* - Class : SALOMEDSImpl_AttributeGraphic - Description : This class is intended for storing information about - graphic representation of objects in dirrent views +Class : SALOMEDSImpl_AttributeGraphic +Description : This class is intended for storing information about +graphic representation of objects in dirrent views */ -#ifndef WNT -class Standard_EXPORT SALOMEDSImpl_AttributeGraphic : public SALOMEDSImpl_GenericAttribute -#else -class SALOMEDSImpl_AttributeGraphic : public SALOMEDSImpl_GenericAttribute -#endif +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeGraphic : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT SALOMEDSImpl_AttributeGraphic(); -Standard_EXPORT ~SALOMEDSImpl_AttributeGraphic(); - -Standard_EXPORT static const std::string& GetID() ; + SALOMEDSImpl_AttributeGraphic(); + ~SALOMEDSImpl_AttributeGraphic(); + + static const std::string& GetID() ; + + void SetVisibility( const int, const bool ); + bool GetVisibility( const int ); + const std::string& ID() const; + void Restore( DF_Attribute* theWith ); + DF_Attribute* NewEmpty() const; + void Paste( DF_Attribute* theInto); -Standard_EXPORT void SetVisibility( const int, const bool ); -Standard_EXPORT bool GetVisibility( const int ); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore( DF_Attribute* theWith ); -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste( DF_Attribute* theInto); + void SetVisibility( const std::map& ); -Standard_EXPORT void SetVisibility( const std::map& ); + const std::map& GetVisibility(); -Standard_EXPORT const std::map& GetVisibility(); - private: std::map myVisibility; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.hxx index eb0be83c5..8f061a033 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.hxx @@ -24,30 +24,32 @@ #ifndef _SALOMEDSImpl_AttributeIOR_HeaderFile #define _SALOMEDSImpl_AttributeIOR_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeIOR : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeIOR : + public SALOMEDSImpl_GenericAttribute { private: - std::string myString; + std::string myString; public: -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeIOR* Set(const DF_Label& label, - const std::string& IOR); -Standard_EXPORT SALOMEDSImpl_AttributeIOR(); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void SetValue(const std::string& theValue); -Standard_EXPORT std::string Value() const ; -Standard_EXPORT void Restore(DF_Attribute* with); -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeIOR() {} + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeIOR* Set(const DF_Label& label, + const std::string& IOR); + SALOMEDSImpl_AttributeIOR(); + const std::string& ID() const; + void SetValue(const std::string& theValue); + std::string Value() const ; + void Restore(DF_Attribute* with); + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeIOR() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx index ea1058ff9..e6a0fcfbb 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx @@ -23,11 +23,8 @@ #include "SALOMEDSImpl_AttributeInteger.hxx" -#ifndef WNT -using namespace std; -#endif - #include +using namespace std; //======================================================================= //function : GetID diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.hxx index 94751adfa..a2a2e5753 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.hxx @@ -24,31 +24,32 @@ #ifndef _SALOMEDSImpl_AttributeInteger_HeaderFile #define _SALOMEDSImpl_AttributeInteger_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeInteger : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeInteger : public SALOMEDSImpl_GenericAttribute { private: -int myValue; + int myValue; public: -Standard_EXPORT static const std::string& GetID() ; - -Standard_EXPORT SALOMEDSImpl_AttributeInteger():SALOMEDSImpl_GenericAttribute("AttributeInteger") {} -Standard_EXPORT static SALOMEDSImpl_AttributeInteger* Set (const DF_Label& L, int Val); -Standard_EXPORT void SetValue(const int theVal); -Standard_EXPORT int Value() const; -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string& theValue); - -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeInteger() {} + static const std::string& GetID() ; + + SALOMEDSImpl_AttributeInteger():SALOMEDSImpl_GenericAttribute("AttributeInteger") {} + static SALOMEDSImpl_AttributeInteger* Set (const DF_Label& L, int Val); + void SetValue(const int theVal); + int Value() const; + virtual std::string Save(); + virtual void Load(const std::string& theValue); + + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeInteger() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.hxx index 2654146b4..d44c06009 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.hxx @@ -24,31 +24,33 @@ #ifndef _SALOMEDSImpl_AttributeLocalID_HeaderFile #define _SALOMEDSImpl_AttributeLocalID_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeLocalID : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeLocalID : + public SALOMEDSImpl_GenericAttribute { private: -int myValue; + int myValue; public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string& theValue); - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeLocalID* Set(const DF_Label& label,const int value) ; -Standard_EXPORT void SetValue(const int value); -Standard_EXPORT int Value() const { return myValue; } -Standard_EXPORT SALOMEDSImpl_AttributeLocalID(); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute*); -Standard_EXPORT ~SALOMEDSImpl_AttributeLocalID() {} + virtual std::string Save(); + virtual void Load(const std::string& theValue); + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeLocalID* Set(const DF_Label& label,const int value) ; + void SetValue(const int value); + int Value() const { return myValue; } + SALOMEDSImpl_AttributeLocalID(); + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute*); + ~SALOMEDSImpl_AttributeLocalID() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.hxx index 2bb858a68..2e5d0e961 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.hxx @@ -24,35 +24,37 @@ #ifndef _SALOMEDSImpl_AttributeName_HeaderFile #define _SALOMEDSImpl_AttributeName_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeName : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeName : + public SALOMEDSImpl_GenericAttribute { private: - std::string myString; + std::string myString; public: -Standard_EXPORT static const std::string& GetID() ; + static const std::string& GetID() ; -Standard_EXPORT SALOMEDSImpl_AttributeName():SALOMEDSImpl_GenericAttribute("AttributeName") {} -Standard_EXPORT static SALOMEDSImpl_AttributeName* Set (const DF_Label& L, const std::string& Val); -Standard_EXPORT void SetValue(const std::string& theVal); -Standard_EXPORT std::string Value() const { return myString; } + SALOMEDSImpl_AttributeName():SALOMEDSImpl_GenericAttribute("AttributeName") {} + static SALOMEDSImpl_AttributeName* Set (const DF_Label& L, const std::string& Val); + void SetValue(const std::string& theVal); + std::string Value() const { return myString; } -Standard_EXPORT virtual std::string Save() { return myString; } -Standard_EXPORT virtual void Load(const std::string& theValue) { myString = theValue; } + virtual std::string Save() { return myString; } + virtual void Load(const std::string& theValue) { myString = theValue; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeName() {} + ~SALOMEDSImpl_AttributeName() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.hxx index 8efd33901..b86d496ec 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.hxx @@ -24,31 +24,33 @@ #ifndef _SALOMEDSImpl_AttributeOpened_HeaderFile #define _SALOMEDSImpl_AttributeOpened_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeOpened : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeOpened : + public SALOMEDSImpl_GenericAttribute { private: -int myValue; + int myValue; public: -Standard_EXPORT virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } -Standard_EXPORT virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeOpened* Set(const DF_Label& label,const int value) ; -Standard_EXPORT SALOMEDSImpl_AttributeOpened(); -Standard_EXPORT void SetOpened(const int value); -Standard_EXPORT int IsOpened() const { return myValue; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeOpened() {} + virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } + virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeOpened* Set(const DF_Label& label,const int value) ; + SALOMEDSImpl_AttributeOpened(); + void SetOpened(const int value); + int IsOpened() const { return myValue; } + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeOpened() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx index ecbc14ec2..f40e9bf87 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx @@ -24,6 +24,7 @@ #ifndef _SALOMEDSImpl_AttributeParameter_HeaderFile #define _SALOMEDSImpl_AttributeParameter_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" @@ -35,15 +36,16 @@ enum Parameter_Types {PT_INTEGER, PT_REAL, PT_BOOLEAN, PT_STRING, PT_REALARRAY, PT_INTARRAY, PT_STRARRAY}; /*! - Class: SALOMEDSImpl_AttributeParameter - Description : AttributeParameter is a universal container of basic types +Class: SALOMEDSImpl_AttributeParameter +Description : AttributeParameter is a universal container of basic types */ -class SALOMEDSImpl_AttributeParameter : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeParameter : + public SALOMEDSImpl_GenericAttribute { private: - + std::map _ints; std::map _reals; std::map _strings; @@ -53,55 +55,54 @@ private: std::map< std::string, std::vector > _strarrays; public: - Standard_EXPORT static const std::string& GetID() ; - - Standard_EXPORT SALOMEDSImpl_AttributeParameter():SALOMEDSImpl_GenericAttribute("AttributeParameter") {} - Standard_EXPORT static SALOMEDSImpl_AttributeParameter* Set (const DF_Label& L); - - - Standard_EXPORT void SetInt(const std::string& theID, const int& theValue); - Standard_EXPORT int GetInt(const std::string& theID); - - Standard_EXPORT void SetReal(const std::string& theID, const double& theValue); - Standard_EXPORT double GetReal(const std::string& theID); - - Standard_EXPORT void SetString(const std::string& theID, const std::string& theValue); - Standard_EXPORT std::string GetString(const std::string& theID); - - Standard_EXPORT void SetBool(const std::string& theID, const bool& theValue); - Standard_EXPORT bool GetBool(const std::string& theID); - - Standard_EXPORT void SetRealArray(const std::string& theID, const std::vector& theArray); - Standard_EXPORT std::vector GetRealArray(const std::string& theID); - - Standard_EXPORT void SetIntArray(const std::string& theID, const std::vector& theArray); - Standard_EXPORT std::vector GetIntArray(const std::string& theID); - - Standard_EXPORT void SetStrArray(const std::string& theID, const std::vector& theArray); - Standard_EXPORT std::vector GetStrArray(const std::string& theID); - Standard_EXPORT bool IsSet(const std::string& theID, const Parameter_Types theType); + static const std::string& GetID() ; - Standard_EXPORT bool RemoveID(const std::string& theID, const Parameter_Types theType); - - Standard_EXPORT SALOMEDSImpl_AttributeParameter* GetFather(); - Standard_EXPORT bool HasFather(); - Standard_EXPORT bool IsRoot(); - - Standard_EXPORT std::vector GetIDs(const Parameter_Types theType); - - Standard_EXPORT void Clear(); - - Standard_EXPORT virtual std::string Save(); - Standard_EXPORT virtual void Load(const std::string& theValue); - - Standard_EXPORT const std::string& ID() const; - Standard_EXPORT void Restore(DF_Attribute* with) ; - Standard_EXPORT DF_Attribute* NewEmpty() const; - Standard_EXPORT void Paste(DF_Attribute* into); - - Standard_EXPORT ~SALOMEDSImpl_AttributeParameter() {} - + SALOMEDSImpl_AttributeParameter():SALOMEDSImpl_GenericAttribute("AttributeParameter") {} + static SALOMEDSImpl_AttributeParameter* Set (const DF_Label& L); + + void SetInt(const std::string& theID, const int& theValue); + int GetInt(const std::string& theID); + + void SetReal(const std::string& theID, const double& theValue); + double GetReal(const std::string& theID); + + void SetString(const std::string& theID, const std::string& theValue); + std::string GetString(const std::string& theID); + + void SetBool(const std::string& theID, const bool& theValue); + bool GetBool(const std::string& theID); + + void SetRealArray(const std::string& theID, const std::vector& theArray); + std::vector GetRealArray(const std::string& theID); + + void SetIntArray(const std::string& theID, const std::vector& theArray); + std::vector GetIntArray(const std::string& theID); + + void SetStrArray(const std::string& theID, const std::vector& theArray); + std::vector GetStrArray(const std::string& theID); + + bool IsSet(const std::string& theID, const Parameter_Types theType); + + bool RemoveID(const std::string& theID, const Parameter_Types theType); + + SALOMEDSImpl_AttributeParameter* GetFather(); + bool HasFather(); + bool IsRoot(); + + std::vector GetIDs(const Parameter_Types theType); + + void Clear(); + + virtual std::string Save(); + virtual void Load(const std::string& theValue); + + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + + ~SALOMEDSImpl_AttributeParameter() {} }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.hxx index fa95a619f..256da73eb 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.hxx @@ -24,33 +24,35 @@ #ifndef _SALOMEDSImpl_AttributePersistentRef_HeaderFile #define _SALOMEDSImpl_AttributePersistentRef_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributePersistentRef : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributePersistentRef : + public SALOMEDSImpl_GenericAttribute { private: - std::string myString; + std::string myString; public: -Standard_EXPORT virtual std::string Save() { return myString; } -Standard_EXPORT virtual void Load(const std::string& theValue) { myString = theValue; } - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributePersistentRef* Set(const DF_Label& label, - const std::string& value) ; -Standard_EXPORT SALOMEDSImpl_AttributePersistentRef(); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void SetValue(const std::string& value); -Standard_EXPORT std::string Value() const { return myString; } -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributePersistentRef() {} + virtual std::string Save() { return myString; } + virtual void Load(const std::string& theValue) { myString = theValue; } + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributePersistentRef* Set(const DF_Label& label, + const std::string& value) ; + SALOMEDSImpl_AttributePersistentRef(); + const std::string& ID() const; + void SetValue(const std::string& value); + std::string Value() const { return myString; } + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributePersistentRef() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.hxx index ac0fcbd33..feb9e67d9 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.hxx @@ -24,33 +24,35 @@ #ifndef _SALOMEDSImpl_AttributePixMap_HeaderFile #define _SALOMEDSImpl_AttributePixMap_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributePixMap : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributePixMap : + public SALOMEDSImpl_GenericAttribute { private: - std::string myString; + std::string myString; public: -Standard_EXPORT virtual std::string Save() { return myString; } -Standard_EXPORT virtual void Load(const std::string& theValue) { myString = theValue; } - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributePixMap* Set(const DF_Label& label, - const std::string& string) ; -Standard_EXPORT SALOMEDSImpl_AttributePixMap(); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void SetPixMap(const std::string& value); -Standard_EXPORT std::string GetPixMap() const { return myString; } -Standard_EXPORT bool HasPixMap() const { return (myString != "None"); } -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributePixMap() {} + virtual std::string Save() { return myString; } + virtual void Load(const std::string& theValue) { myString = theValue; } + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributePixMap* Set(const DF_Label& label, + const std::string& string) ; + SALOMEDSImpl_AttributePixMap(); + const std::string& ID() const; + void SetPixMap(const std::string& value); + std::string GetPixMap() const { return myString; } + bool HasPixMap() const { return (myString != "None"); } + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributePixMap() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.hxx index bda55e4fa..b9c105e50 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.hxx @@ -24,6 +24,7 @@ #ifndef _SALOMEDSImpl_AttributePythonObject_HeaderFile #define _SALOMEDSImpl_AttributePythonObject_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include @@ -33,30 +34,31 @@ #undef GetObject #endif -class SALOMEDSImpl_AttributePythonObject : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributePythonObject : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributePythonObject* Set(const DF_Label& label) ; -Standard_EXPORT SALOMEDSImpl_AttributePythonObject(); -Standard_EXPORT void SetObject(const std::string& theSequence, const bool theScript) ; -Standard_EXPORT std::string GetObject() const; -Standard_EXPORT bool IsScript() const; -Standard_EXPORT int GetLength() const; -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributePythonObject() {} + virtual std::string Save(); + virtual void Load(const std::string&); + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributePythonObject* Set(const DF_Label& label) ; + SALOMEDSImpl_AttributePythonObject(); + void SetObject(const std::string& theSequence, const bool theScript) ; + std::string GetObject() const; + bool IsScript() const; + int GetLength() const; + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributePythonObject() {} private: -std::string mySequence; -bool myIsScript; + std::string mySequence; + bool myIsScript; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.hxx index 488f3bfe8..93bdba112 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.hxx @@ -24,31 +24,33 @@ #ifndef _SALOMEDSImpl_AttributeReal_HeaderFile #define _SALOMEDSImpl_AttributeReal_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeReal : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeReal : + public SALOMEDSImpl_GenericAttribute { private: double myValue; public: -Standard_EXPORT static const std::string& GetID() ; + static const std::string& GetID() ; -Standard_EXPORT SALOMEDSImpl_AttributeReal():SALOMEDSImpl_GenericAttribute("AttributeReal") {} -Standard_EXPORT static SALOMEDSImpl_AttributeReal* Set (const DF_Label& L, const double& Val); -Standard_EXPORT void SetValue(const double& theVal); -Standard_EXPORT double Value() const { return myValue; } -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string& theValue); + SALOMEDSImpl_AttributeReal():SALOMEDSImpl_GenericAttribute("AttributeReal") {} + static SALOMEDSImpl_AttributeReal* Set (const DF_Label& L, const double& Val); + void SetValue(const double& theVal); + double Value() const { return myValue; } + virtual std::string Save(); + virtual void Load(const std::string& theValue); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeReal() {} + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeReal() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.hxx index 4c69dee7b..f1e78ad64 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.hxx @@ -24,33 +24,35 @@ #ifndef _SALOMEDSImpl_AttributeReference_HeaderFile #define _SALOMEDSImpl_AttributeReference_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeReference : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeReference : + public SALOMEDSImpl_GenericAttribute { private: - DF_Label myLabel; + DF_Label myLabel; public: -Standard_EXPORT static const std::string& GetID() ; + static const std::string& GetID() ; -Standard_EXPORT SALOMEDSImpl_AttributeReference():SALOMEDSImpl_GenericAttribute("AttributeReference") {} -Standard_EXPORT static SALOMEDSImpl_AttributeReference* Set(const DF_Label& theLabel, const DF_Label& theRefLabel); -Standard_EXPORT void Set(const DF_Label& theLabel); -Standard_EXPORT DF_Label Get() const { return myLabel; } -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string& theValue); + SALOMEDSImpl_AttributeReference():SALOMEDSImpl_GenericAttribute("AttributeReference") {} + static SALOMEDSImpl_AttributeReference* Set(const DF_Label& theLabel, const DF_Label& theRefLabel); + void Set(const DF_Label& theLabel); + DF_Label Get() const { return myLabel; } + virtual std::string Save(); + virtual void Load(const std::string& theValue); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeReference() {} + ~SALOMEDSImpl_AttributeReference() {} }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.hxx index dfdc71871..56d5fa750 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.hxx @@ -24,31 +24,33 @@ #ifndef _SALOMEDSImpl_AttributeSelectable_HeaderFile #define _SALOMEDSImpl_AttributeSelectable_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeSelectable : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeSelectable : + public SALOMEDSImpl_GenericAttribute { private: -int myValue; + int myValue; public: -Standard_EXPORT virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } -Standard_EXPORT virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeSelectable* Set(const DF_Label& label,const int value) ; -Standard_EXPORT SALOMEDSImpl_AttributeSelectable(); -Standard_EXPORT void SetSelectable(const int value); -Standard_EXPORT int IsSelectable() const { return myValue; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeSelectable() {} + virtual std::string Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } + virtual void Load(const std::string& theValue) { (theValue == "0")?myValue=0:myValue=1; } + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeSelectable* Set(const DF_Label& label,const int value) ; + SALOMEDSImpl_AttributeSelectable(); + void SetSelectable(const int value); + int IsSelectable() const { return myValue; } + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeSelectable() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.hxx index f1f935b4d..7c0f5cb83 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.hxx @@ -24,38 +24,40 @@ #ifndef _SALOMEDSImpl_AttributeSequenceOfInteger_HeaderFile #define _SALOMEDSImpl_AttributeSequenceOfInteger_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeSequenceOfInteger : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeSequenceOfInteger : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeSequenceOfInteger* Set(const DF_Label& label) ; -Standard_EXPORT SALOMEDSImpl_AttributeSequenceOfInteger(); -Standard_EXPORT void Assign(const std::vector& other) ; -Standard_EXPORT void ChangeValue(const int Index,const int Value) ; -Standard_EXPORT void Add(const int value) ; -Standard_EXPORT int Value(const int Index) ; -Standard_EXPORT void Remove(const int Index) ; -Standard_EXPORT int Length() ; -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeSequenceOfInteger() {} -Standard_EXPORT const std::vector& Array() { return myValue; } + virtual std::string Save(); + virtual void Load(const std::string&); + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeSequenceOfInteger* Set(const DF_Label& label) ; + SALOMEDSImpl_AttributeSequenceOfInteger(); + void Assign(const std::vector& other) ; + void ChangeValue(const int Index,const int Value) ; + void Add(const int value) ; + int Value(const int Index) ; + void Remove(const int Index) ; + int Length() ; + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeSequenceOfInteger() {} + const std::vector& Array() { return myValue; } private: -std::vector myValue; + std::vector myValue; }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.hxx index 10ebdf846..91f0a7c68 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.hxx @@ -24,6 +24,7 @@ #ifndef _SALOMEDSImpl_AttributeSequenceOfReal_HeaderFile #define _SALOMEDSImpl_AttributeSequenceOfReal_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include @@ -31,32 +32,33 @@ #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeSequenceOfReal : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeSequenceOfReal : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); - -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeSequenceOfReal* Set(const DF_Label& label) ; -Standard_EXPORT SALOMEDSImpl_AttributeSequenceOfReal(); -Standard_EXPORT void Assign(const std::vector& other) ; -Standard_EXPORT void ChangeValue(const int Index,const double& Value) ; -Standard_EXPORT void Add(const double& Value) ; -Standard_EXPORT double Value(const int Index) ; -Standard_EXPORT void Remove(const int Index) ; -Standard_EXPORT int Length() ; -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeSequenceOfReal() {} -Standard_EXPORT const std::vector& Array() { return myValue; } + virtual std::string Save(); + virtual void Load(const std::string&); + + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeSequenceOfReal* Set(const DF_Label& label) ; + SALOMEDSImpl_AttributeSequenceOfReal(); + void Assign(const std::vector& other) ; + void ChangeValue(const int Index,const double& Value) ; + void Add(const double& Value) ; + double Value(const int Index) ; + void Remove(const int Index) ; + int Length() ; + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeSequenceOfReal() {} + const std::vector& Array() { return myValue; } private: -std::vector myValue; + std::vector myValue; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.hxx index c520bce61..3cf59dfb3 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.hxx @@ -24,77 +24,78 @@ #ifndef _SALOMEDSImpl_AttributeStudyProperties_HeaderFile #define _SALOMEDSImpl_AttributeStudyProperties_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeStudyProperties : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeStudyProperties : public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT SALOMEDSImpl_AttributeStudyProperties(); -Standard_EXPORT ~SALOMEDSImpl_AttributeStudyProperties() {} + SALOMEDSImpl_AttributeStudyProperties(); + ~SALOMEDSImpl_AttributeStudyProperties() {} -Standard_EXPORT static const std::string& GetID(); -Standard_EXPORT const std::string& ID() const; + static const std::string& GetID(); + const std::string& ID() const; -Standard_EXPORT static SALOMEDSImpl_AttributeStudyProperties* Set(const DF_Label& label); + static SALOMEDSImpl_AttributeStudyProperties* Set(const DF_Label& label); -Standard_EXPORT void Init(); + void Init(); -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); + virtual std::string Save(); + virtual void Load(const std::string&); -Standard_EXPORT void SetModification(const std::string& theUserName, - const int theMinute, - const int theHour, - const int theDay, - const int theMonth, - const int theYear); -Standard_EXPORT void GetModifications(std::vector& theUserNames, - std::vector& theMinutes, - std::vector& theHours, - std::vector& theDays, - std::vector& theMonths, - std::vector& theYears) const; + void SetModification(const std::string& theUserName, + const int theMinute, + const int theHour, + const int theDay, + const int theMonth, + const int theYear); + void GetModifications(std::vector& theUserNames, + std::vector& theMinutes, + std::vector& theHours, + std::vector& theDays, + std::vector& theMonths, + std::vector& theYears) const; -Standard_EXPORT std::string GetCreatorName() const; -Standard_EXPORT bool GetCreationDate(int& theMinute, - int& theHour, - int& theDay, - int& theMonth, - int& theYear) const; + std::string GetCreatorName() const; + bool GetCreationDate(int& theMinute, + int& theHour, + int& theDay, + int& theMonth, + int& theYear) const; -Standard_EXPORT void ChangeCreatorName(const std::string& theUserName); + void ChangeCreatorName(const std::string& theUserName); -Standard_EXPORT void SetCreationMode(const int theMode); -Standard_EXPORT int GetCreationMode() const; + void SetCreationMode(const int theMode); + int GetCreationMode() const; -Standard_EXPORT void SetModified(const int theModified); -Standard_EXPORT bool IsModified() const; -Standard_EXPORT int GetModified() const; + void SetModified(const int theModified); + bool IsModified() const; + int GetModified() const; -Standard_EXPORT void SetLocked(const bool theLocked); -Standard_EXPORT bool IsLocked() const; -Standard_EXPORT bool IsLockChanged(const bool theErase); + void SetLocked(const bool theLocked); + bool IsLocked() const; + bool IsLockChanged(const bool theErase); -Standard_EXPORT void Restore(DF_Attribute* with); -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); + void Restore(DF_Attribute* with); + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); private: -std::vector myUserName; -std::vector myMinute; -std::vector myHour; -std::vector myDay; -std::vector myMonth; -std::vector myYear; -int myMode; -int myModified; -bool myLocked; -bool myLockChanged; + std::vector myUserName; + std::vector myMinute; + std::vector myHour; + std::vector myDay; + std::vector myMonth; + std::vector myYear; + int myMode; + int myModified; + bool myLocked; + bool myLockChanged; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx index 27abce57b..ff7e582a8 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx @@ -458,7 +458,7 @@ string SALOMEDSImpl_AttributeTableOfInteger::Save() aString += myRows[i][j]; aString += '\n'; } - } + } //Nb columns sprintf(buffer, "%d\n", myNbColumns); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.hxx index 84434df7b..b89383513 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.hxx @@ -11,6 +11,7 @@ #ifndef _SALOMEDSImpl_AttributeTableOfInteger_HeaderFile #define _SALOMEDSImpl_AttributeTableOfInteger_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" @@ -20,58 +21,59 @@ #include -class SALOMEDSImpl_AttributeTableOfInteger : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTableOfInteger : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeTableOfInteger* Set(const DF_Label& label) ; -Standard_EXPORT SALOMEDSImpl_AttributeTableOfInteger(); -Standard_EXPORT void SetNbColumns(const int theNbColumns); -Standard_EXPORT void SetTitle(const std::string& theTitle) ; -Standard_EXPORT std::string GetTitle() const; -Standard_EXPORT void SetRowData(const int theRow,const std::vector& theData) ; -Standard_EXPORT std::vector GetRowData(const int theRow) ; -Standard_EXPORT void SetRowTitle(const int theRow,const std::string& theTitle) ; -Standard_EXPORT void SetRowUnit(const int theRow,const std::string& theUnit) ; -Standard_EXPORT std::string GetRowUnit(const int theRow) const; -Standard_EXPORT void SetRowUnits(const std::vector& theUnits) ; -Standard_EXPORT std::vector GetRowUnits(); -Standard_EXPORT void SetRowTitles(const std::vector& theTitles) ; -Standard_EXPORT std::vector GetRowTitles(); -Standard_EXPORT std::string GetRowTitle(const int theRow) const; -Standard_EXPORT void SetColumnData(const int theColumn,const std::vector& theData) ; -Standard_EXPORT std::vector GetColumnData(const int theColumn) ; -Standard_EXPORT void SetColumnTitle(const int theColumn,const std::string& theTitle) ; -Standard_EXPORT std::string GetColumnTitle(const int theColumn) const; -Standard_EXPORT void SetColumnTitles(const std::vector& theTitles); -Standard_EXPORT std::vector GetColumnTitles(); -Standard_EXPORT int GetNbRows() const; -Standard_EXPORT int GetNbColumns() const; + virtual std::string Save(); + virtual void Load(const std::string&); + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeTableOfInteger* Set(const DF_Label& label) ; + SALOMEDSImpl_AttributeTableOfInteger(); + void SetNbColumns(const int theNbColumns); + void SetTitle(const std::string& theTitle) ; + std::string GetTitle() const; + void SetRowData(const int theRow,const std::vector& theData) ; + std::vector GetRowData(const int theRow) ; + void SetRowTitle(const int theRow,const std::string& theTitle) ; + void SetRowUnit(const int theRow,const std::string& theUnit) ; + std::string GetRowUnit(const int theRow) const; + void SetRowUnits(const std::vector& theUnits) ; + std::vector GetRowUnits(); + void SetRowTitles(const std::vector& theTitles) ; + std::vector GetRowTitles(); + std::string GetRowTitle(const int theRow) const; + void SetColumnData(const int theColumn,const std::vector& theData) ; + std::vector GetColumnData(const int theColumn) ; + void SetColumnTitle(const int theColumn,const std::string& theTitle) ; + std::string GetColumnTitle(const int theColumn) const; + void SetColumnTitles(const std::vector& theTitles); + std::vector GetColumnTitles(); + int GetNbRows() const; + int GetNbColumns() const; -Standard_EXPORT void PutValue(const int theValue,const int theRow,const int theColumn) ; -Standard_EXPORT bool HasValue(const int theRow,const int theColumn) ; -Standard_EXPORT int GetValue(const int theRow,const int theColumn) ; -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); + void PutValue(const int theValue,const int theRow,const int theColumn) ; + bool HasValue(const int theRow,const int theColumn) ; + int GetValue(const int theRow,const int theColumn) ; + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); -Standard_EXPORT std::vector GetSetRowIndices(const int theRow); -Standard_EXPORT std::vector GetSetColumnIndices(const int theColumn); + std::vector GetSetRowIndices(const int theRow); + std::vector GetSetColumnIndices(const int theColumn); -Standard_EXPORT ~SALOMEDSImpl_AttributeTableOfInteger() {} + ~SALOMEDSImpl_AttributeTableOfInteger() {} private: -std::map myTable; -std::string myTitle; -std::vector myRows; -std::vector myCols; -int myNbRows; -int myNbColumns; + std::map myTable; + std::string myTitle; + std::vector myRows; + std::vector myCols; + int myNbRows; + int myNbColumns; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx index 2c3aba89e..9c4eb1906 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx @@ -444,7 +444,7 @@ string SALOMEDSImpl_AttributeTableOfReal::Save() aString += myTitle[i]; aString +='\n'; } - + //Nb rows sprintf(buffer, "%d\n", myNbRows); aString+=buffer; @@ -458,7 +458,7 @@ string SALOMEDSImpl_AttributeTableOfReal::Save() aString += myRows[i][j]; aString += '\n'; } - } + } //Nb columns sprintf(buffer, "%d\n", myNbColumns); @@ -483,7 +483,7 @@ string SALOMEDSImpl_AttributeTableOfReal::Save() sprintf(buffer, "%d\n%.64e\n", p->first, p->second); aString += buffer; } - + delete []buffer; return aString; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.hxx index 3dea7567d..672a26e5b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.hxx @@ -11,6 +11,7 @@ #ifndef _SALOMEDSImpl_AttributeTableOfReal_HeaderFile #define _SALOMEDSImpl_AttributeTableOfReal_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" @@ -19,57 +20,58 @@ #include #include -class SALOMEDSImpl_AttributeTableOfReal : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTableOfReal : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeTableOfReal* Set(const DF_Label& label) ; -Standard_EXPORT SALOMEDSImpl_AttributeTableOfReal(); -Standard_EXPORT void SetNbColumns(const int theNbColumns); -Standard_EXPORT void SetTitle(const std::string& theTitle) ; -Standard_EXPORT std::string GetTitle() const; -Standard_EXPORT void SetRowData(const int theRow,const std::vector& theData) ; -Standard_EXPORT std::vector GetRowData(const int theRow) ; -Standard_EXPORT void SetRowTitle(const int theRow,const std::string& theTitle) ; -Standard_EXPORT void SetRowUnit(const int theRow,const std::string& theUnit) ; -Standard_EXPORT std::string GetRowUnit(const int theRow) const; -Standard_EXPORT void SetRowUnits(const std::vector& theUnits) ; -Standard_EXPORT std::vector GetRowUnits(); -Standard_EXPORT void SetRowTitles(const std::vector& theTitles) ; -Standard_EXPORT std::vector GetRowTitles(); -Standard_EXPORT std::string GetRowTitle(const int theRow) const; -Standard_EXPORT void SetColumnData(const int theColumn,const std::vector& theData) ; -Standard_EXPORT std::vector GetColumnData(const int theColumn) ; -Standard_EXPORT void SetColumnTitle(const int theColumn,const std::string& theTitle) ; -Standard_EXPORT void SetColumnTitles(const std::vector& theTitles); -Standard_EXPORT std::vector GetColumnTitles(); -Standard_EXPORT std::string GetColumnTitle(const int theColumn) const; -Standard_EXPORT int GetNbRows() const; -Standard_EXPORT int GetNbColumns() const; + virtual std::string Save(); + virtual void Load(const std::string&); + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeTableOfReal* Set(const DF_Label& label) ; + SALOMEDSImpl_AttributeTableOfReal(); + void SetNbColumns(const int theNbColumns); + void SetTitle(const std::string& theTitle) ; + std::string GetTitle() const; + void SetRowData(const int theRow,const std::vector& theData) ; + std::vector GetRowData(const int theRow) ; + void SetRowTitle(const int theRow,const std::string& theTitle) ; + void SetRowUnit(const int theRow,const std::string& theUnit) ; + std::string GetRowUnit(const int theRow) const; + void SetRowUnits(const std::vector& theUnits) ; + std::vector GetRowUnits(); + void SetRowTitles(const std::vector& theTitles) ; + std::vector GetRowTitles(); + std::string GetRowTitle(const int theRow) const; + void SetColumnData(const int theColumn,const std::vector& theData) ; + std::vector GetColumnData(const int theColumn) ; + void SetColumnTitle(const int theColumn,const std::string& theTitle) ; + void SetColumnTitles(const std::vector& theTitles); + std::vector GetColumnTitles(); + std::string GetColumnTitle(const int theColumn) const; + int GetNbRows() const; + int GetNbColumns() const; -Standard_EXPORT void PutValue(const double& theValue,const int theRow,const int theColumn) ; -Standard_EXPORT bool HasValue(const int theRow,const int theColumn) ; -Standard_EXPORT double GetValue(const int theRow,const int theColumn) ; -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); + void PutValue(const double& theValue,const int theRow,const int theColumn) ; + bool HasValue(const int theRow,const int theColumn) ; + double GetValue(const int theRow,const int theColumn) ; + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); -Standard_EXPORT std::vector GetSetRowIndices(const int theRow); -Standard_EXPORT std::vector GetSetColumnIndices(const int theColumn); + std::vector GetSetRowIndices(const int theRow); + std::vector GetSetColumnIndices(const int theColumn); -Standard_EXPORT ~SALOMEDSImpl_AttributeTableOfReal() {} + ~SALOMEDSImpl_AttributeTableOfReal() {} private: -std::map myTable; -std::string myTitle; -std::vector myRows; -std::vector myCols; -int myNbRows; -int myNbColumns; + std::map myTable; + std::string myTitle; + std::vector myRows; + std::vector myCols; + int myNbRows; + int myNbColumns; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx index 8966b054e..39930f364 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx @@ -459,7 +459,7 @@ string SALOMEDSImpl_AttributeTableOfString::Save() aString += myRows[i][j]; aString += '\n'; } - } + } //Nb columns sprintf(buffer, "%d\n", myNbColumns); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.hxx index 0a4da3185..f30caa8a3 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.hxx @@ -11,6 +11,7 @@ #ifndef _SALOMEDSImpl_AttributeTableOfString_HeaderFile #define _SALOMEDSImpl_AttributeTableOfString_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Label.hxx" #include "DF_Attribute.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" @@ -19,58 +20,59 @@ #include #include -class SALOMEDSImpl_AttributeTableOfString : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTableOfString : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeTableOfString* Set(const DF_Label& label) ; -Standard_EXPORT SALOMEDSImpl_AttributeTableOfString(); -Standard_EXPORT void SetNbColumns(const int theNbColumns); -Standard_EXPORT void SetTitle(const std::string& theTitle) ; -Standard_EXPORT std::string GetTitle() const; -Standard_EXPORT void SetRowData(const int theRow,const std::vector& theData) ; -Standard_EXPORT std::vector GetRowData(const int theRow) ; -Standard_EXPORT void SetRowTitle(const int theRow,const std::string& theTitle) ; -Standard_EXPORT void SetRowUnit(const int theRow,const std::string& theUnit) ; -Standard_EXPORT std::string GetRowUnit(const int theRow) const; -Standard_EXPORT void SetRowUnits(const std::vector& theUnits) ; -Standard_EXPORT std::vector GetRowUnits(); -Standard_EXPORT void SetRowTitles(const std::vector& theTitles) ; -Standard_EXPORT std::vector GetRowTitles(); -Standard_EXPORT std::string GetRowTitle(const int theRow) const; -Standard_EXPORT void SetColumnData(const int theColumn,const std::vector& theData) ; -Standard_EXPORT std::vector GetColumnData(const int theColumn) ; -Standard_EXPORT void SetColumnTitle(const int theColumn,const std::string& theTitle) ; -Standard_EXPORT std::string GetColumnTitle(const int theColumn) const; -Standard_EXPORT void SetColumnTitles(const std::vector& theTitles); -Standard_EXPORT std::vector GetColumnTitles(); -Standard_EXPORT int GetNbRows() const; -Standard_EXPORT int GetNbColumns() const; + virtual std::string Save(); + virtual void Load(const std::string&); + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeTableOfString* Set(const DF_Label& label) ; + SALOMEDSImpl_AttributeTableOfString(); + void SetNbColumns(const int theNbColumns); + void SetTitle(const std::string& theTitle) ; + std::string GetTitle() const; + void SetRowData(const int theRow,const std::vector& theData) ; + std::vector GetRowData(const int theRow) ; + void SetRowTitle(const int theRow,const std::string& theTitle) ; + void SetRowUnit(const int theRow,const std::string& theUnit) ; + std::string GetRowUnit(const int theRow) const; + void SetRowUnits(const std::vector& theUnits) ; + std::vector GetRowUnits(); + void SetRowTitles(const std::vector& theTitles) ; + std::vector GetRowTitles(); + std::string GetRowTitle(const int theRow) const; + void SetColumnData(const int theColumn,const std::vector& theData) ; + std::vector GetColumnData(const int theColumn) ; + void SetColumnTitle(const int theColumn,const std::string& theTitle) ; + std::string GetColumnTitle(const int theColumn) const; + void SetColumnTitles(const std::vector& theTitles); + std::vector GetColumnTitles(); + int GetNbRows() const; + int GetNbColumns() const; -Standard_EXPORT void PutValue(const std::string& theValue,const int theRow,const int theColumn) ; -Standard_EXPORT bool HasValue(const int theRow,const int theColumn) ; -Standard_EXPORT std::string GetValue(const int theRow,const int theColumn) ; -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); + void PutValue(const std::string& theValue,const int theRow,const int theColumn) ; + bool HasValue(const int theRow,const int theColumn) ; + std::string GetValue(const int theRow,const int theColumn) ; + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); -Standard_EXPORT std::vector GetSetRowIndices(const int theRow); -Standard_EXPORT std::vector GetSetColumnIndices(const int theColumn); + std::vector GetSetRowIndices(const int theRow); + std::vector GetSetColumnIndices(const int theColumn); -Standard_EXPORT ~SALOMEDSImpl_AttributeTableOfString() {} + ~SALOMEDSImpl_AttributeTableOfString() {} private: -std::map myTable; -std::string myTitle; -std::vector myRows; -std::vector myCols; -int myNbRows; -int myNbColumns; + std::map myTable; + std::string myTitle; + std::vector myRows; + std::vector myCols; + int myNbRows; + int myNbColumns; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.hxx index 5c4bb4f71..ea3663759 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.hxx @@ -24,33 +24,35 @@ #ifndef _SALOMEDSImpl_AttributeTarget_HeaderFile #define _SALOMEDSImpl_AttributeTarget_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include "SALOMEDSImpl_GenericAttribute.hxx" #include "SALOMEDSImpl_SObject.hxx" -class SALOMEDSImpl_AttributeTarget : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTarget : + public SALOMEDSImpl_GenericAttribute { private: -std::string myRelation; -std::vector myVariables; + std::string myRelation; + std::vector myVariables; public: -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT static SALOMEDSImpl_AttributeTarget* Set(const DF_Label& label) ; -Standard_EXPORT SALOMEDSImpl_AttributeTarget(); -Standard_EXPORT void Add(const SALOMEDSImpl_SObject& theSO); -Standard_EXPORT std::vector Get(); -Standard_EXPORT void Remove(const SALOMEDSImpl_SObject& theSO); -Standard_EXPORT std::string GetRelation() { return myRelation; } -Standard_EXPORT void SetRelation(const std::string& theRelation); -Standard_EXPORT std::vector& GetVariables() { return myVariables; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeTarget() {} + static const std::string& GetID() ; + static SALOMEDSImpl_AttributeTarget* Set(const DF_Label& label) ; + SALOMEDSImpl_AttributeTarget(); + void Add(const SALOMEDSImpl_SObject& theSO); + std::vector Get(); + void Remove(const SALOMEDSImpl_SObject& theSO); + std::string GetRelation() { return myRelation; } + void SetRelation(const std::string& theRelation); + std::vector& GetVariables() { return myVariables; } + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeTarget() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.hxx index a0e9f50d7..477cda6c1 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.hxx @@ -24,30 +24,32 @@ #ifndef _SALOMEDSImpl_AttributeTextColor_HeaderFile #define _SALOMEDSImpl_AttributeTextColor_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeTextColor : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTextColor : + public SALOMEDSImpl_GenericAttribute { private: std::vector myValue; public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT SALOMEDSImpl_AttributeTextColor(); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void SetTextColor(const double& R, const double& G, const double& B); -Standard_EXPORT std::vector TextColor(); -Standard_EXPORT void ChangeArray(const std::vector& newArray); -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste( DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeTextColor() {} + virtual std::string Save(); + virtual void Load(const std::string&); + static const std::string& GetID() ; + SALOMEDSImpl_AttributeTextColor(); + const std::string& ID() const; + void SetTextColor(const double& R, const double& G, const double& B); + std::vector TextColor(); + void ChangeArray(const std::vector& newArray); + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste( DF_Attribute* into); + ~SALOMEDSImpl_AttributeTextColor() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.hxx index d17e7f29c..017af2394 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.hxx @@ -24,6 +24,7 @@ #ifndef _SALOMEDSImpl_AttributeTextHighlightColor_HeaderFile #define _SALOMEDSImpl_AttributeTextHighlightColor_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include @@ -31,24 +32,25 @@ #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeTextHighlightColor : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTextHighlightColor : + public SALOMEDSImpl_GenericAttribute { private: std::vector myValue; public: -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); -Standard_EXPORT static const std::string& GetID() ; -Standard_EXPORT SALOMEDSImpl_AttributeTextHighlightColor(); -Standard_EXPORT void SetTextHighlightColor(const double& R, const double& G, const double& B); -Standard_EXPORT std::vector TextHighlightColor(); -Standard_EXPORT void ChangeArray(const std::vector& newArray); -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeTextHighlightColor() {} + virtual std::string Save(); + virtual void Load(const std::string&); + static const std::string& GetID() ; + SALOMEDSImpl_AttributeTextHighlightColor(); + void SetTextHighlightColor(const double& R, const double& G, const double& B); + std::vector TextHighlightColor(); + void ChangeArray(const std::vector& newArray); + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeTextHighlightColor() {} }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.hxx index 88d6a6b0d..8555b1bb0 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.hxx @@ -24,71 +24,73 @@ #ifndef _SALOMEDSImpl_AttributeTreeNode_HeaderFile #define _SALOMEDSImpl_AttributeTreeNode_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeTreeNode : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeTreeNode : + public SALOMEDSImpl_GenericAttribute { public: -Standard_EXPORT const static std::string& GetDefaultTreeID(); -Standard_EXPORT static SALOMEDSImpl_AttributeTreeNode* Set(const DF_Label& L, const std::string& ID); - -Standard_EXPORT SALOMEDSImpl_AttributeTreeNode(); -Standard_EXPORT void SetFather(const SALOMEDSImpl_AttributeTreeNode* value); -Standard_EXPORT void SetPrevious(const SALOMEDSImpl_AttributeTreeNode* value); -Standard_EXPORT void SetNext(const SALOMEDSImpl_AttributeTreeNode* value); -Standard_EXPORT void SetFirst(const SALOMEDSImpl_AttributeTreeNode* value); -Standard_EXPORT void SetTreeID(const std::string& value); - -Standard_EXPORT bool Append(SALOMEDSImpl_AttributeTreeNode* value); -Standard_EXPORT bool Prepend(SALOMEDSImpl_AttributeTreeNode* value); -Standard_EXPORT bool Remove(); -Standard_EXPORT bool InsertBefore(SALOMEDSImpl_AttributeTreeNode* value); -Standard_EXPORT bool InsertAfter(SALOMEDSImpl_AttributeTreeNode* value); - -Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* GetFather() const { return myFather; } -Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* GetPrevious() const { return myPrevious; } -Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* GetNext() const { return myNext; } -Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* GetFirst() const { return myFirst; } - -Standard_EXPORT bool HasFather() { return (myFather); } -Standard_EXPORT bool HasPrevious() { return (myPrevious); } -Standard_EXPORT bool HasNext() {return (myNext); } -Standard_EXPORT bool HasFirst() { return (myFirst); } -Standard_EXPORT const std::string& GetTreeID() { return ID(); } -Standard_EXPORT int Depth() const; -Standard_EXPORT bool IsRoot() const ; -Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* Root() const; -Standard_EXPORT bool IsAscendant (const SALOMEDSImpl_AttributeTreeNode* ofTN) const; -Standard_EXPORT bool IsDescendant(const SALOMEDSImpl_AttributeTreeNode* value) const; -Standard_EXPORT bool IsFather(const SALOMEDSImpl_AttributeTreeNode* value) const; -Standard_EXPORT bool IsChild(const SALOMEDSImpl_AttributeTreeNode* value) const; - -Standard_EXPORT virtual std::string Save(); -Standard_EXPORT virtual void Load(const std::string&); -Standard_EXPORT virtual std::string Type(); - -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT ~SALOMEDSImpl_AttributeTreeNode() {;} - -Standard_EXPORT virtual void AfterAddition(); -Standard_EXPORT virtual void BeforeForget(); + const static std::string& GetDefaultTreeID(); + static SALOMEDSImpl_AttributeTreeNode* Set(const DF_Label& L, const std::string& ID); + + SALOMEDSImpl_AttributeTreeNode(); + void SetFather(const SALOMEDSImpl_AttributeTreeNode* value); + void SetPrevious(const SALOMEDSImpl_AttributeTreeNode* value); + void SetNext(const SALOMEDSImpl_AttributeTreeNode* value); + void SetFirst(const SALOMEDSImpl_AttributeTreeNode* value); + void SetTreeID(const std::string& value); + + bool Append(SALOMEDSImpl_AttributeTreeNode* value); + bool Prepend(SALOMEDSImpl_AttributeTreeNode* value); + bool Remove(); + bool InsertBefore(SALOMEDSImpl_AttributeTreeNode* value); + bool InsertAfter(SALOMEDSImpl_AttributeTreeNode* value); + + SALOMEDSImpl_AttributeTreeNode* GetFather() const { return myFather; } + SALOMEDSImpl_AttributeTreeNode* GetPrevious() const { return myPrevious; } + SALOMEDSImpl_AttributeTreeNode* GetNext() const { return myNext; } + SALOMEDSImpl_AttributeTreeNode* GetFirst() const { return myFirst; } + + bool HasFather() { return (myFather); } + bool HasPrevious() { return (myPrevious); } + bool HasNext() {return (myNext); } + bool HasFirst() { return (myFirst); } + const std::string& GetTreeID() { return ID(); } + int Depth() const; + bool IsRoot() const ; + SALOMEDSImpl_AttributeTreeNode* Root() const; + bool IsAscendant (const SALOMEDSImpl_AttributeTreeNode* ofTN) const; + bool IsDescendant(const SALOMEDSImpl_AttributeTreeNode* value) const; + bool IsFather(const SALOMEDSImpl_AttributeTreeNode* value) const; + bool IsChild(const SALOMEDSImpl_AttributeTreeNode* value) const; + + virtual std::string Save(); + virtual void Load(const std::string&); + virtual std::string Type(); + + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + void Paste(DF_Attribute* into); + DF_Attribute* NewEmpty() const; + ~SALOMEDSImpl_AttributeTreeNode() {;} + + virtual void AfterAddition(); + virtual void BeforeForget(); private: -std::string myTreeID; -SALOMEDSImpl_AttributeTreeNode* myFather; -SALOMEDSImpl_AttributeTreeNode* myPrevious; -SALOMEDSImpl_AttributeTreeNode* myNext; -SALOMEDSImpl_AttributeTreeNode* myFirst; + std::string myTreeID; + SALOMEDSImpl_AttributeTreeNode* myFather; + SALOMEDSImpl_AttributeTreeNode* myPrevious; + SALOMEDSImpl_AttributeTreeNode* myNext; + SALOMEDSImpl_AttributeTreeNode* myFirst; -friend class SALOMEDSImpl_ChildNodeIterator; + friend class SALOMEDSImpl_ChildNodeIterator; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.hxx index 8d3ab95ac..5bf9b27c3 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.hxx @@ -24,36 +24,38 @@ #ifndef _SALOMEDSImpl_AttributeUserID_HeaderFile #define _SALOMEDSImpl_AttributeUserID_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" #include #include "SALOMEDSImpl_GenericAttribute.hxx" -class SALOMEDSImpl_AttributeUserID : public SALOMEDSImpl_GenericAttribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeUserID : + public SALOMEDSImpl_GenericAttribute { private: -std::string myID; + std::string myID; public: -SALOMEDSImpl_AttributeUserID():SALOMEDSImpl_GenericAttribute("AttributeUserID") {} -static SALOMEDSImpl_AttributeUserID* Set (const DF_Label& L, const std::string& ID); -static const std::string& DefaultID() -{ - static std::string SALOMEDSImpl_DefaultUserAttributeID ("FFFFFFFF-D9CD-11d6-945D-1050DA506788"); - return SALOMEDSImpl_DefaultUserAttributeID; -} - -Standard_EXPORT const std::string& Value() const { return ID(); } -Standard_EXPORT void SetValue(const std::string& value); - -Standard_EXPORT virtual std::string Type(); - -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore(DF_Attribute* with) ; -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste(DF_Attribute* into); -Standard_EXPORT ~SALOMEDSImpl_AttributeUserID() {} + SALOMEDSImpl_AttributeUserID():SALOMEDSImpl_GenericAttribute("AttributeUserID") {} + static SALOMEDSImpl_AttributeUserID* Set (const DF_Label& L, const std::string& ID); + static const std::string& DefaultID() + { + static std::string SALOMEDSImpl_DefaultUserAttributeID ("FFFFFFFF-D9CD-11d6-945D-1050DA506788"); + return SALOMEDSImpl_DefaultUserAttributeID; + } + + const std::string& Value() const { return ID(); } + void SetValue(const std::string& value); + + virtual std::string Type(); + + const std::string& ID() const; + void Restore(DF_Attribute* with) ; + DF_Attribute* NewEmpty() const; + void Paste(DF_Attribute* into); + ~SALOMEDSImpl_AttributeUserID() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx index ff366e786..895bae5ea 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx @@ -24,15 +24,7 @@ #ifndef __SALOMEDSIMPL_ATTRIBUTES__H__ #define __SALOMEDSIMPL_ATTRIBUTES__H__ -#ifdef WNT -# ifdef SALOMEDSIMPL_EXPORTS -# define SALOMEDSIMPL_EXPORT __declspec( dllexport ) -# else -# define SALOMEDSIMPL_EXPORT __declspec( dllimport ) -# endif -#else -# define SALOMEDSIMPL_EXPORT -#endif +#include "SALOMEDSImpl_Defines.hxx" #include class SALOMEDSIMPL_EXPORT LockProtection diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx index 313d1d305..22ae44b6c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx @@ -24,30 +24,30 @@ #ifndef __SALOMEDSIMPL_CALLBACK_H__ #define __SALOMEDSIMPL_CALLBACK_H__ - +#include "SALOMEDSImpl_Defines.hxx" #include "SALOMEDSImpl_UseCaseBuilder.hxx" -class SALOMEDSImpl_Callback +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Callback { private: SALOMEDSImpl_UseCaseBuilder* _builder; public: - SALOMEDSImpl_Callback(SALOMEDSImpl_UseCaseBuilder* builder) - { - _builder = builder; - } + SALOMEDSImpl_Callback(SALOMEDSImpl_UseCaseBuilder* builder) + { + _builder = builder; + } - virtual void OnAddSObject(const SALOMEDSImpl_SObject& theObject) - { - if(_builder != NULL && theObject) _builder->Append(theObject); - } + virtual void OnAddSObject(const SALOMEDSImpl_SObject& theObject) + { + if(_builder != NULL && theObject) _builder->Append(theObject); + } - virtual void OnRemoveSObject(const SALOMEDSImpl_SObject& theObject) - { - if(_builder != NULL && theObject) _builder->Remove(theObject); - } + virtual void OnRemoveSObject(const SALOMEDSImpl_SObject& theObject) + { + if(_builder != NULL && theObject) _builder->Remove(theObject); + } }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.hxx index e3c50b9b0..9e3d5b568 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.hxx @@ -24,12 +24,12 @@ #ifndef __SALOMEDSImpl_CHILDITERATOR_H__ #define __SALOMEDSImpl_CHILDITERATOR_H__ - +#include "SALOMEDSImpl_Defines.hxx" #include "SALOMEDSImpl_SObject.hxx" #include "DF_ChildIterator.hxx" #include "DF_Label.hxx" -class SALOMEDSImpl_ChildIterator +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_ChildIterator { private: DF_ChildIterator _it; @@ -37,20 +37,20 @@ private: public: - Standard_EXPORT SALOMEDSImpl_ChildIterator() {} - Standard_EXPORT SALOMEDSImpl_ChildIterator(const SALOMEDSImpl_SObject& theSO); - Standard_EXPORT SALOMEDSImpl_ChildIterator(const DF_Label& theLabel); - Standard_EXPORT ~SALOMEDSImpl_ChildIterator() {}; - - Standard_EXPORT virtual void Init(); - Standard_EXPORT virtual void Init(const DF_Label& theLabel); - Standard_EXPORT virtual void InitEx(bool theAllLevels); - Standard_EXPORT virtual void InitEx(const DF_Label& theLabel, bool theAllLevels); - Standard_EXPORT virtual bool More(); - Standard_EXPORT virtual void Next(); - Standard_EXPORT virtual SALOMEDSImpl_SObject Value(); - Standard_EXPORT virtual DF_Label Label(); - - Standard_EXPORT SALOMEDSImpl_ChildIterator* GetPersistentCopy() const; + SALOMEDSImpl_ChildIterator() {} + SALOMEDSImpl_ChildIterator(const SALOMEDSImpl_SObject& theSO); + SALOMEDSImpl_ChildIterator(const DF_Label& theLabel); + ~SALOMEDSImpl_ChildIterator() {}; + + virtual void Init(); + virtual void Init(const DF_Label& theLabel); + virtual void InitEx(bool theAllLevels); + virtual void InitEx(const DF_Label& theLabel, bool theAllLevels); + virtual bool More(); + virtual void Next(); + virtual SALOMEDSImpl_SObject Value(); + virtual DF_Label Label(); + + SALOMEDSImpl_ChildIterator* GetPersistentCopy() const; }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_ChildNodeIterator.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_ChildNodeIterator.hxx index 21651a4e7..452a60f84 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_ChildNodeIterator.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_ChildNodeIterator.hxx @@ -21,27 +21,28 @@ #ifndef _SALOMEDSImpl_ChildNodeIterator_HeaderFile #define _SALOMEDSImpl_ChildNodeIterator_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "SALOMEDSImpl_AttributeTreeNode.hxx" -class SALOMEDSImpl_ChildNodeIterator +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_ChildNodeIterator { public: -Standard_EXPORT SALOMEDSImpl_ChildNodeIterator(); -Standard_EXPORT SALOMEDSImpl_ChildNodeIterator(const SALOMEDSImpl_AttributeTreeNode* aTreeNode, - const bool allLevels = false); -Standard_EXPORT void Initialize(const SALOMEDSImpl_AttributeTreeNode* aTreeNode, - const bool allLevels = false) ; -Standard_EXPORT bool More() const { return (myNode); } -Standard_EXPORT void Next() ; -Standard_EXPORT void NextBrother() ; -Standard_EXPORT SALOMEDSImpl_AttributeTreeNode* Value() const { return myNode; } + SALOMEDSImpl_ChildNodeIterator(); + SALOMEDSImpl_ChildNodeIterator(const SALOMEDSImpl_AttributeTreeNode* aTreeNode, + const bool allLevels = false); + void Initialize(const SALOMEDSImpl_AttributeTreeNode* aTreeNode, + const bool allLevels = false) ; + bool More() const { return (myNode); } + void Next() ; + void NextBrother() ; + SALOMEDSImpl_AttributeTreeNode* Value() const { return myNode; } private: -SALOMEDSImpl_AttributeTreeNode* myNode; -int myFirstLevel; + SALOMEDSImpl_AttributeTreeNode* myNode; + int myFirstLevel; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Defines.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Defines.hxx new file mode 100755 index 000000000..ddd99cda6 --- /dev/null +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Defines.hxx @@ -0,0 +1,39 @@ +// Copyright (C) 2003 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. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SALOMEDSImpl_Defines.hxx +// Author : Alexander A. BORODIN +// Module : KERNEL + +#ifndef _SALOMEDSImpl_Defines_HXX_ +#define _SALOMEDSImpl_Defines_HXX_ + +#ifdef WIN32 +# if defined SALOMEDSIMPL_EXPORTS +# define SALOMEDSIMPL_EXPORT __declspec( dllexport ) +# else +# define SALOMEDSIMPL_EXPORT __declspec( dllimport ) +# endif +#else +# define SALOMEDSIMPL_EXPORT +#endif + +#endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx index 88fac75f5..ff2c0475d 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx @@ -20,78 +20,79 @@ #ifndef __SALOMEDSIMPL_DRIVER_H__ #define __SALOMEDSIMPL_DRIVER_H__ +#include "SALOMEDSImpl_Defines.hxx" #include #include #include #include -class SALOMEDSImpl_Driver +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Driver { public: virtual std::string GetIOR() = 0; virtual SALOMEDSImpl_TMPFile* Save(const SALOMEDSImpl_SComponent& theComponent, - const std::string& theURL, - long& theStreamLength, - bool isMultiFile) = 0; + const std::string& theURL, + long& theStreamLength, + bool isMultiFile) = 0; virtual SALOMEDSImpl_TMPFile* SaveASCII(const SALOMEDSImpl_SComponent& theComponent, - const std::string& theURL, - long& theStreamLength, - bool isMultiFile) = 0; - + const std::string& theURL, + long& theStreamLength, + bool isMultiFile) = 0; + virtual bool Load(const SALOMEDSImpl_SComponent& theComponent, - const unsigned char* theStream, - const long theStreamLength, - const std::string& theURL, - bool isMultiFile) = 0; + const unsigned char* theStream, + const long theStreamLength, + const std::string& theURL, + bool isMultiFile) = 0; virtual bool LoadASCII(const SALOMEDSImpl_SComponent& theComponent, - const unsigned char* theStream, - const long theStreamLength, - const std::string& theURL, - bool isMultiFile) = 0; + const unsigned char* theStream, + const long theStreamLength, + const std::string& theURL, + bool isMultiFile) = 0; virtual void Close(const SALOMEDSImpl_SComponent& theComponent) = 0; - + virtual std::string ComponentDataType() = 0; virtual std::string IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject, - const std::string& IORString, - bool isMultiFile, - bool isASCII) = 0; + const std::string& IORString, + bool isMultiFile, + bool isASCII) = 0; virtual std::string LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theSObject, - const std::string& aLocalPersistentID, - bool isMultiFile, - bool isASCII) = 0; + const std::string& aLocalPersistentID, + bool isMultiFile, + bool isASCII) = 0; virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject) = 0; virtual SALOMEDSImpl_TMPFile* CopyFrom(const SALOMEDSImpl_SObject& theObject, - int& theObjectID, - long& theStreamLength) = 0; - + int& theObjectID, + long& theStreamLength) = 0; + virtual bool CanPaste(const std::string& theComponentName, int theObjectID) = 0; virtual std::string PasteInto(const unsigned char* theStream, - const long theStreamLength, - int theObjectID, - const SALOMEDSImpl_SObject& theObject) = 0; + const long theStreamLength, + int theObjectID, + const SALOMEDSImpl_SObject& theObject) = 0; virtual SALOMEDSImpl_TMPFile* DumpPython(SALOMEDSImpl_Study* theStudy, - bool isPublished, - bool& isValidScript, - long& theStreamLength) = 0; + bool isPublished, + bool& isValidScript, + long& theStreamLength) = 0; }; class SALOMEDSImpl_DriverFactory { public: - + virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType) = 0; virtual SALOMEDSImpl_Driver* GetDriverByIOR(const std::string& theIOR) = 0; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx index 168645bb0..37caac3fb 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx @@ -28,16 +28,22 @@ using namespace std; -char* SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr) +string SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr) { SALOMEDSImpl_GenericAttribute* ga = dynamic_cast(theAttr); - return (char*)ga->Type().c_str(); + if (ga) + return ga->Type(); + + return ""; } -char* SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr) +string SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr) { SALOMEDSImpl_GenericAttribute* ga = dynamic_cast(theAttr); - return (char*)ga->GetClassType().c_str(); + if (ga) + return ga->GetClassType(); + + return ""; } void SALOMEDSImpl_GenericAttribute::Impl_CheckLocked(DF_Attribute* theAttr) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx index 345e0fd64..0fcdb3f5c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx @@ -24,13 +24,15 @@ #ifndef _GENERICIMPL_ATTRIBUTE_HXX_ #define _GENERICIMPL_ATTRIBUTE_HXX_ +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Label.hxx" #include "DF_Attribute.hxx" #include #include "SALOMEDSImpl_SObject.hxx" -class SALOMEDSImpl_GenericAttribute: public DF_Attribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_GenericAttribute: + public DF_Attribute { protected: @@ -38,19 +40,19 @@ protected: public: -Standard_EXPORT SALOMEDSImpl_GenericAttribute(const std::string& theType) -:_type(theType) -{} + SALOMEDSImpl_GenericAttribute(const std::string& theType) + :_type(theType) + {} -Standard_EXPORT virtual std::string Type(); -Standard_EXPORT virtual void CheckLocked(); -Standard_EXPORT std::string GetClassType() { return _type; } -Standard_EXPORT SALOMEDSImpl_SObject GetSObject(); -Standard_EXPORT void SetModifyFlag(); + virtual std::string Type(); + virtual void CheckLocked(); + std::string GetClassType() { return _type; } + SALOMEDSImpl_SObject GetSObject(); + void SetModifyFlag(); -Standard_EXPORT static char* Impl_GetType(DF_Attribute* theAttr); -Standard_EXPORT static char* Impl_GetClassType(DF_Attribute* theAttr); -Standard_EXPORT static void Impl_CheckLocked(DF_Attribute* theAttr); + static std::string Impl_GetType(DF_Attribute* theAttr); + static std::string Impl_GetClassType(DF_Attribute* theAttr); + static void Impl_CheckLocked(DF_Attribute* theAttr); }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.hxx index a197b28ef..69d8beaef 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.hxx @@ -19,6 +19,7 @@ #ifndef SALOMEDSImpl_IParameters_H #define SALOMEDSImpl_IParameters_H +#include "SALOMEDSImpl_Defines.hxx" #include #include #include @@ -27,9 +28,9 @@ #include "SALOMEDSImpl_Study.hxx" /*! - Class which an interface to store the parameters of the objects +Class which an interface to store the parameters of the objects */ -class Standard_EXPORT SALOMEDSImpl_IParameters +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_IParameters { public: SALOMEDSImpl_IParameters(SALOMEDSImpl_AttributeParameter* ap); @@ -37,109 +38,109 @@ public: virtual ~SALOMEDSImpl_IParameters(); /*! - Appends a string value to a named list. - Returns a number of the added value. - Note: the name of the list MUST be unique - */ + Appends a string value to a named list. + Returns a number of the added value. + Note: the name of the list MUST be unique + */ virtual int append(const std::string& listName, const std::string& value); /*! - Returns a number elements in the list - */ + Returns a number elements in the list + */ virtual int nbValues(const std::string& listName); /*! - Returns a list of values in the list - */ + Returns a list of values in the list + */ virtual std::vector getValues(const std::string& listName); /*! - Returns a value with given %index, where %index is in range [0:nbValues-1] - */ + Returns a value with given %index, where %index is in range [0:nbValues-1] + */ virtual std::string getValue(const std::string& listName, int index); /*! - Returns a list all entries lists - */ + Returns a list all entries lists + */ virtual std::vector getLists(); /*! - Sets a new named parameter value for the given entry - */ + Sets a new named parameter value for the given entry + */ virtual void setParameter(const std::string& entry, const std::string& parameterName, const std::string& value); /*! - Gets a named parameter value for the given entry - */ + Gets a named parameter value for the given entry + */ virtual std::string getParameter(const std::string& entry, const std::string& parameterName); /*! - Returns all parameter names of the given entry - */ + Returns all parameter names of the given entry + */ virtual std::vector getAllParameterNames(const std::string& entry); /*! - Returns all parameter values of the given entry - */ + Returns all parameter values of the given entry + */ virtual std::vector getAllParameterValues(const std::string& entry); /*! - Returns a number of parameters of the given entry - */ + Returns a number of parameters of the given entry + */ virtual int getNbParameters(const std::string& entry); /*! - Returns a list all entries - */ + Returns a list all entries + */ virtual std::vector getEntries(); /*! - Sets a global named property value - */ + Sets a global named property value + */ virtual void setProperty(const std::string& name, const std::string& value); /*! - Gets a value of global named property - */ + Gets a value of global named property + */ virtual std::string getProperty(const std::string& name); /*! - Returns a list all properties - */ + Returns a list all properties + */ virtual std::vector getProperties(); /*! - Returns decoded entry that is an absolute entry - */ + Returns decoded entry that is an absolute entry + */ virtual std::string decodeEntry(const std::string& entry); /*! - Returns whether there is the dumping visual parameters - */ + Returns whether there is the dumping visual parameters + */ static bool isDumpPython(SALOMEDSImpl_Study* study, const std::string& theID = ""); /*! - Returns an ID of the last save point + Returns an ID of the last save point */ static int getLastSavePoint(SALOMEDSImpl_Study* study, const std::string& theID = ""); /*! - Returns a Python script for the study, which sets up visual parameters + Returns a Python script for the study, which sets up visual parameters */ static std::string getStudyScript(SALOMEDSImpl_Study* study, int savePoint, const std::string& theID = ""); /*! - Returns a default Python script that set ups visual parameters for the given module - shift is a string that contain spaces to make valid Python script indentaion + Returns a default Python script that set ups visual parameters for the given module + shift is a string that contain spaces to make valid Python script indentaion */ static std::string getDefaultScript(SALOMEDSImpl_Study* study, - const std::string& moduleName, - const std::string& shift, - const std::string& theID = ""); + const std::string& moduleName, + const std::string& shift, + const std::string& theID = ""); /*! - Returns a default name of the component where the visula parameters are stored. + Returns a default name of the component where the visula parameters are stored. */ static std::string getDefaultVisualComponent(); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.hxx index 1803e537a..ecd8123dc 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.hxx @@ -25,33 +25,34 @@ #define __SALOMEDSIMPL_SCOMPONENT_H__ //SALOMEDSImpl headers +#include "SALOMEDSImpl_Defines.hxx" #include "SALOMEDSImpl_SObject.hxx" // std C++ headers #include #include -// Cascade headers #include "DF_Label.hxx" #include "SALOMEDSImpl_SObject.hxx" #include -class SALOMEDSImpl_SComponent : public virtual SALOMEDSImpl_SObject +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_SComponent : + public virtual SALOMEDSImpl_SObject { public: - - Standard_EXPORT SALOMEDSImpl_SComponent(); - Standard_EXPORT SALOMEDSImpl_SComponent(const SALOMEDSImpl_SComponent& theSCO); - Standard_EXPORT SALOMEDSImpl_SComponent(const DF_Label& lab); - - Standard_EXPORT ~SALOMEDSImpl_SComponent(); - - Standard_EXPORT virtual std::string ComponentDataType(); - Standard_EXPORT virtual bool ComponentIOR(std::string& theID); - - Standard_EXPORT static bool IsA(const DF_Label& theLabel); - - Standard_EXPORT SALOMEDSImpl_SComponent* GetPersistentCopy() const; + + SALOMEDSImpl_SComponent(); + SALOMEDSImpl_SComponent(const SALOMEDSImpl_SComponent& theSCO); + SALOMEDSImpl_SComponent(const DF_Label& lab); + + ~SALOMEDSImpl_SComponent(); + + virtual std::string ComponentDataType(); + virtual bool ComponentIOR(std::string& theID); + + static bool IsA(const DF_Label& theLabel); + + SALOMEDSImpl_SComponent* GetPersistentCopy() const; }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.hxx index 1194fc191..ec4386e48 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.hxx @@ -26,15 +26,15 @@ //SALOMEDSImpl headers +#include "SALOMEDSImpl_Defines.hxx" #include "SALOMEDSImpl_SComponent.hxx" -// Cascade headers #include "DF_ChildIterator.hxx" #include "DF_Label.hxx" #include "DF_Document.hxx" #include -class Standard_EXPORT SALOMEDSImpl_SComponentIterator +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_SComponentIterator { private: @@ -42,7 +42,7 @@ private: DF_Label _lab; public: - + SALOMEDSImpl_SComponentIterator(const SALOMEDSImpl_SComponentIterator& theIterator) { _it = theIterator._it; @@ -50,11 +50,11 @@ public: } SALOMEDSImpl_SComponentIterator() {}; - + SALOMEDSImpl_SComponentIterator(DF_Document* theDocument); - + ~SALOMEDSImpl_SComponentIterator() {}; - + virtual void Init(); virtual bool More(); virtual void Next(); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SObject.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_SObject.hxx index 80d797e41..64f630a44 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SObject.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SObject.hxx @@ -24,6 +24,8 @@ #ifndef __SALOMEDSIMPL_SOBJECT_H__ #define __SALOMEDSIMPL_SOBJECT_H__ +#include "SALOMEDSImpl_Defines.hxx" + #include "DF_Label.hxx" #include "DF_Attribute.hxx" #include @@ -32,7 +34,7 @@ class SALOMEDSImpl_SComponent; class SALOMEDSImpl_Study; -class SALOMEDSImpl_SObject +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_SObject { protected: DF_Label _lab; @@ -41,45 +43,45 @@ protected: std::string _type; public: - - Standard_EXPORT SALOMEDSImpl_SObject(); - Standard_EXPORT SALOMEDSImpl_SObject(const DF_Label& theLabel); - Standard_EXPORT SALOMEDSImpl_SObject(const SALOMEDSImpl_SObject& theSObject); - Standard_EXPORT virtual ~SALOMEDSImpl_SObject(); - - Standard_EXPORT virtual std::string GetID() const; - Standard_EXPORT virtual SALOMEDSImpl_SComponent GetFatherComponent() const; - Standard_EXPORT virtual SALOMEDSImpl_SObject GetFather() const ; - Standard_EXPORT virtual bool FindAttribute(DF_Attribute*& theAttribute, const std::string& theTypeOfAttribute) const; - Standard_EXPORT virtual bool ReferencedObject(SALOMEDSImpl_SObject& theObject) const ; - Standard_EXPORT virtual bool FindSubObject(int theTag, SALOMEDSImpl_SObject& theObject); - Standard_EXPORT virtual SALOMEDSImpl_Study* GetStudy() const; - Standard_EXPORT virtual std::string Name() const { return _name; } - Standard_EXPORT virtual void Name(const std::string& theName) { _name = theName; } - Standard_EXPORT virtual std::vector GetAllAttributes() const; + SALOMEDSImpl_SObject(); + SALOMEDSImpl_SObject(const DF_Label& theLabel); + SALOMEDSImpl_SObject(const SALOMEDSImpl_SObject& theSObject); + virtual ~SALOMEDSImpl_SObject(); + + virtual std::string GetID() const; + virtual SALOMEDSImpl_SComponent GetFatherComponent() const; + virtual SALOMEDSImpl_SObject GetFather() const ; + virtual bool FindAttribute(DF_Attribute*& theAttribute, const std::string& theTypeOfAttribute) const; + virtual bool ReferencedObject(SALOMEDSImpl_SObject& theObject) const ; + virtual bool FindSubObject(int theTag, SALOMEDSImpl_SObject& theObject); + + virtual SALOMEDSImpl_Study* GetStudy() const; + virtual std::string Name() const { return _name; } + virtual void Name(const std::string& theName) { _name = theName; } + virtual std::vector GetAllAttributes() const; + + virtual std::string GetName() const ; + virtual std::string GetComment() const; + virtual std::string GetIOR() const; + + virtual int Tag() const { return _lab.Tag(); } + virtual int Depth() const { return _lab.Depth(); } - Standard_EXPORT virtual std::string GetName() const ; - Standard_EXPORT virtual std::string GetComment() const; - Standard_EXPORT virtual std::string GetIOR() const; + virtual DF_Label GetLabel() const { return _lab; } - Standard_EXPORT virtual int Tag() const { return _lab.Tag(); } - Standard_EXPORT virtual int Depth() const { return _lab.Depth(); } + bool IsNull() const { return _lab.IsNull(); } - Standard_EXPORT virtual DF_Label GetLabel() const { return _lab; } + bool IsComponent() const; - Standard_EXPORT bool IsNull() const { return _lab.IsNull(); } + operator SALOMEDSImpl_SComponent() const; - Standard_EXPORT bool IsComponent() const; + operator bool () const { return !IsNull(); } - Standard_EXPORT operator SALOMEDSImpl_SComponent() const; + SALOMEDSImpl_SObject* GetPersistentCopy() const; - Standard_EXPORT operator bool () const { return !IsNull(); } - - Standard_EXPORT SALOMEDSImpl_SObject* GetPersistentCopy() const; + static std::string GetGUID(const std::string& theTypeOfAttribute); - Standard_EXPORT static std::string GetGUID(const std::string& theTypeOfAttribute); - }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx index cfddeb627..a28f2d164 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx @@ -30,12 +30,12 @@ #include #include -// Cascade headers #include "DF_Document.hxx" #include "DF_Label.hxx" #include //SALOMEDSImpl headers +#include "SALOMEDSImpl_Defines.hxx" #include "SALOMEDSImpl_SComponentIterator.hxx" #include "SALOMEDSImpl_SObject.hxx" #include "SALOMEDSImpl_StudyBuilder.hxx" @@ -51,7 +51,7 @@ class SALOMEDSImpl_StudyManager; class SALOMEDSImpl_GenericAttribute; -class SALOMEDSImpl_Study +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Study { private: std::string _name; @@ -70,194 +70,193 @@ private: std::map _mapOfSO; std::map _mapOfSCO; std::map myIORLabels; - + SALOMEDSImpl_SObject _FindObject(const SALOMEDSImpl_SObject& SO, - const std::string& anObjectName, - bool& _find); - + const std::string& anObjectName, + bool& _find); + SALOMEDSImpl_SObject _FindObjectIOR(const SALOMEDSImpl_SObject& SO, - const std::string& anObjectIOR, - bool& _find); + const std::string& anObjectIOR, + bool& _find); public: - Standard_EXPORT static SALOMEDSImpl_Study* GetStudy(const DF_Label& theLabel); - Standard_EXPORT static SALOMEDSImpl_SObject SObject(const DF_Label& theLabel); - Standard_EXPORT static SALOMEDSImpl_SComponent SComponent(const DF_Label& theLabel); - Standard_EXPORT static void IORUpdated(const SALOMEDSImpl_AttributeIOR* theAttribute); + static SALOMEDSImpl_Study* GetStudy(const DF_Label& theLabel); + static SALOMEDSImpl_SObject SObject(const DF_Label& theLabel); + static SALOMEDSImpl_SComponent SComponent(const DF_Label& theLabel); + static void IORUpdated(const SALOMEDSImpl_AttributeIOR* theAttribute); - //! standard constructor - Standard_EXPORT SALOMEDSImpl_Study(const DF_Document*, const std::string& study_name); + //! standard constructor + SALOMEDSImpl_Study(const DF_Document*, const std::string& study_name); //! standard destructor - Standard_EXPORT virtual ~SALOMEDSImpl_Study(); + virtual ~SALOMEDSImpl_Study(); //! method to Get persistent reference of study (idem URL()) - Standard_EXPORT virtual std::string GetPersistentReference(); + virtual std::string GetPersistentReference(); //! method to Get transient reference of study - Standard_EXPORT virtual std::string GetTransientReference(); + virtual std::string GetTransientReference(); - Standard_EXPORT virtual void SetTransientReference(const std::string& theIOR); + virtual void SetTransientReference(const std::string& theIOR); //! method to detect if a study is empty - Standard_EXPORT virtual bool IsEmpty(); + virtual bool IsEmpty(); //! method to Find a Component with ComponentDataType = aComponentName - Standard_EXPORT virtual SALOMEDSImpl_SComponent FindComponent (const std::string& aComponentName); + virtual SALOMEDSImpl_SComponent FindComponent (const std::string& aComponentName); //! method to Find a Component Find a Component from it's ID - Standard_EXPORT virtual SALOMEDSImpl_SComponent FindComponentID(const std::string& aComponentID); + virtual SALOMEDSImpl_SComponent FindComponentID(const std::string& aComponentID); //! method to Find an Object with SALOMEDSImpl::Name = anObjectName - Standard_EXPORT virtual SALOMEDSImpl_SObject FindObject(const std::string& anObjectName); + virtual SALOMEDSImpl_SObject FindObject(const std::string& anObjectName); //! method to Find Object(s) with SALOMEDSImpl::Name=anObjectName in a component with ComponentDataType = aComponentName - Standard_EXPORT virtual std::vector FindObjectByName( const std::string& anObjectName, + virtual std::vector FindObjectByName( const std::string& anObjectName, const std::string& aComponentName ) ; //! method to Find an Object with ID = anObjectID - Standard_EXPORT virtual SALOMEDSImpl_SObject FindObjectID(const std::string& anObjectID); - + virtual SALOMEDSImpl_SObject FindObjectID(const std::string& anObjectID); + //! method to Create an Object with ID = anObjectID - Standard_EXPORT virtual SALOMEDSImpl_SObject CreateObjectID(const std::string& anObjectID); + virtual SALOMEDSImpl_SObject CreateObjectID(const std::string& anObjectID); //! method to Find an Object with ID = anObjectIOR - Standard_EXPORT virtual SALOMEDSImpl_SObject FindObjectIOR(const std::string& anObjectIOR); + virtual SALOMEDSImpl_SObject FindObjectIOR(const std::string& anObjectIOR); //! method to Find an Object by its path - Standard_EXPORT virtual SALOMEDSImpl_SObject FindObjectByPath(const std::string& thePath); + virtual SALOMEDSImpl_SObject FindObjectByPath(const std::string& thePath); //! method to get a path of SObject - Standard_EXPORT virtual std::string GetObjectPath(const SALOMEDSImpl_SObject& theObject); + virtual std::string GetObjectPath(const SALOMEDSImpl_SObject& theObject); - Standard_EXPORT std::string GetObjectPathByIOR(const std::string& theIOR); + std::string GetObjectPathByIOR(const std::string& theIOR); //! method to set a context: root ('/') is UserData component - Standard_EXPORT virtual bool SetContext(const std::string& thePath); + virtual bool SetContext(const std::string& thePath); //! method to get a context - Standard_EXPORT virtual std::string GetContext(); + virtual std::string GetContext(); //! method to get all object names in the given context (or in the current context, if 'theContext' is empty) - Standard_EXPORT virtual std::vector GetObjectNames(const std::string& theContext); + virtual std::vector GetObjectNames(const std::string& theContext); //! method to get all directory names in the given context (or in the current context, if 'theContext' is empty) - Standard_EXPORT virtual std::vector GetDirectoryNames(const std::string& theContext); + virtual std::vector GetDirectoryNames(const std::string& theContext); //! method to get all file names in the given context (or in the current context, if 'theContext' is empty) - Standard_EXPORT virtual std::vector GetFileNames(const std::string& theContext); + virtual std::vector GetFileNames(const std::string& theContext); //! method to get all components names - Standard_EXPORT virtual std::vector GetComponentNames(const std::string& theContext); + virtual std::vector GetComponentNames(const std::string& theContext); //! method to Create a ChildIterator from an SObject - Standard_EXPORT virtual SALOMEDSImpl_ChildIterator NewChildIterator(const SALOMEDSImpl_SObject& aSO); + virtual SALOMEDSImpl_ChildIterator NewChildIterator(const SALOMEDSImpl_SObject& aSO); //! method to Create a SComponentIterator - Standard_EXPORT virtual SALOMEDSImpl_SComponentIterator NewComponentIterator(); + virtual SALOMEDSImpl_SComponentIterator NewComponentIterator(); //! method to Create a StudyBuilder - Standard_EXPORT virtual SALOMEDSImpl_StudyBuilder* NewBuilder(); + virtual SALOMEDSImpl_StudyBuilder* NewBuilder(); //! method to get study name - Standard_EXPORT virtual std::string Name(); + virtual std::string Name(); //! method to set study name - Standard_EXPORT virtual void Name(const std::string& name); - + virtual void Name(const std::string& name); + //! method to get if study has been saved - Standard_EXPORT virtual bool IsSaved(); + virtual bool IsSaved(); //! method to set if study has been saved - Standard_EXPORT virtual void IsSaved(bool save); + virtual void IsSaved(bool save); //! method to Detect if a Study has been modified since it has been saved - Standard_EXPORT virtual bool IsModified(); - + virtual bool IsModified(); + //! method to get URL of the study (idem GetPersistentReference) - Standard_EXPORT virtual std::string URL(); + virtual std::string URL(); //! method to set URL of the study - Standard_EXPORT virtual void URL(const std::string& url); - - Standard_EXPORT virtual bool IsLocked(); - - Standard_EXPORT virtual int StudyId(); - - Standard_EXPORT virtual void StudyId(int id); + virtual void URL(const std::string& url); - Standard_EXPORT virtual void UpdateIORLabelMap(const std::string& anIOR, const std::string& aLabel); + virtual bool IsLocked(); - Standard_EXPORT virtual std::vector FindDependances(const SALOMEDSImpl_SObject& anObject); - - Standard_EXPORT virtual SALOMEDSImpl_AttributeStudyProperties* GetProperties(); - - Standard_EXPORT virtual std::string GetLastModificationDate(); - - Standard_EXPORT virtual std::vector GetModificationsDate(); - - Standard_EXPORT virtual SALOMEDSImpl_UseCaseBuilder* GetUseCaseBuilder(); + virtual int StudyId(); - Standard_EXPORT virtual void Close(); - - Standard_EXPORT void EnableUseCaseAutoFilling(bool isEnabled); - - Standard_EXPORT virtual std::string GetErrorCode() { return _errorCode; } - Standard_EXPORT virtual bool IsError() { return _errorCode != ""; } - - Standard_EXPORT virtual SALOMEDSImpl_SComponent GetSComponent(const std::string& theEntry); - Standard_EXPORT virtual SALOMEDSImpl_SComponent GetSComponent(const DF_Label& theLabel); - Standard_EXPORT virtual SALOMEDSImpl_SObject GetSObject(const std::string& theEntry); - Standard_EXPORT virtual SALOMEDSImpl_SObject GetSObject(const DF_Label& theEntryLabel); - Standard_EXPORT virtual DF_Attribute* GetAttribute(const std::string& theEntry, + virtual void StudyId(int id); + + virtual void UpdateIORLabelMap(const std::string& anIOR, const std::string& aLabel); + + virtual std::vector FindDependances(const SALOMEDSImpl_SObject& anObject); + + virtual SALOMEDSImpl_AttributeStudyProperties* GetProperties(); + + virtual std::string GetLastModificationDate(); + + virtual std::vector GetModificationsDate(); + + virtual SALOMEDSImpl_UseCaseBuilder* GetUseCaseBuilder(); + + virtual void Close(); + + void EnableUseCaseAutoFilling(bool isEnabled); + + virtual std::string GetErrorCode() { return _errorCode; } + virtual bool IsError() { return _errorCode != ""; } + + virtual SALOMEDSImpl_SComponent GetSComponent(const std::string& theEntry); + virtual SALOMEDSImpl_SComponent GetSComponent(const DF_Label& theLabel); + virtual SALOMEDSImpl_SObject GetSObject(const std::string& theEntry); + virtual SALOMEDSImpl_SObject GetSObject(const DF_Label& theEntryLabel); + virtual DF_Attribute* GetAttribute(const std::string& theEntry, const std::string& theType); - Standard_EXPORT virtual bool HasCurrentContext() { return !_current.IsNull(); } + virtual bool HasCurrentContext() { return !_current.IsNull(); } - Standard_EXPORT virtual bool DumpStudy(const std::string& thePath, + virtual bool DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished, SALOMEDSImpl_DriverFactory* theFactory); - Standard_EXPORT static std::string GetDumpStudyComment(const char* theComponentName = 0); - - Standard_EXPORT virtual DF_Document* GetDocument() { return _doc; } + static std::string GetDumpStudyComment(const char* theComponentName = 0); + + virtual DF_Document* GetDocument() { return _doc; } //The method dump creates a txt file that contain a dump of the study, for debug use - Standard_EXPORT void dump(const std::string& theFileName); + void dump(const std::string& theFileName); //This method marks the study as being modified - Standard_EXPORT void Modify(); + void Modify(); - Standard_EXPORT SALOMEDSImpl_AttributeParameter* GetCommonParameters(const char* theID, int theSavePoint); + SALOMEDSImpl_AttributeParameter* GetCommonParameters(const char* theID, int theSavePoint); - Standard_EXPORT SALOMEDSImpl_AttributeParameter* GetModuleParameters(const char* theID, + SALOMEDSImpl_AttributeParameter* GetModuleParameters(const char* theID, const char* theModuleName, int theSavePoint); //Locks the study, theLockerID is identificator of the of the one who locked the study for ex. IOR - Standard_EXPORT void SetStudyLock(const char* theLockerID); + void SetStudyLock(const char* theLockerID); //Returns True if the study is locked - Standard_EXPORT bool IsStudyLocked(); + bool IsStudyLocked(); //Unlocks the study - Standard_EXPORT void UnLockStudy(const char* theLockerID); + void UnLockStudy(const char* theLockerID); //Returns an ID of the study locker - Standard_EXPORT std::vector GetLockerID(); + std::vector GetLockerID(); //Returns a callback - Standard_EXPORT SALOMEDSImpl_Callback* GetCallback() { return _cb; } + SALOMEDSImpl_Callback* GetCallback() { return _cb; } //Returns a list of IOR's stored in the study - Standard_EXPORT std::vector GetIORs(); - + std::vector GetIORs(); -friend class SALOMEDSImpl_StudyManager; -friend class SALOMEDSImpl_GenericAttribute; + friend class SALOMEDSImpl_StudyManager; + friend class SALOMEDSImpl_GenericAttribute; }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.hxx index 781103cb6..e6a996e70 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.hxx @@ -24,17 +24,18 @@ #ifndef __SALOMEDSImpl_STUDYBUILDER_H__ #define __SALOMEDSImpl_STUDYBUILDER_H__ +#include "SALOMEDSImpl_Defines.hxx" // std C++ headers #include #include #include - + #include "SALOMEDSImpl_Callback.hxx" #include "SALOMEDSImpl_Driver.hxx" class SALOMEDSImpl_Study; -class SALOMEDSImpl_StudyBuilder +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_StudyBuilder { private: DF_Document* _doc; @@ -44,74 +45,74 @@ private: std::string _errorCode; public: - - Standard_EXPORT SALOMEDSImpl_StudyBuilder(const SALOMEDSImpl_Study* theOwner); - Standard_EXPORT ~SALOMEDSImpl_StudyBuilder(); + SALOMEDSImpl_StudyBuilder(const SALOMEDSImpl_Study* theOwner); + + ~SALOMEDSImpl_StudyBuilder(); + + virtual SALOMEDSImpl_SComponent NewComponent(const std::string& ComponentDataType); - Standard_EXPORT virtual SALOMEDSImpl_SComponent NewComponent(const std::string& ComponentDataType); + virtual bool DefineComponentInstance (const SALOMEDSImpl_SComponent&, const std::string& ComponentIOR); - Standard_EXPORT virtual bool DefineComponentInstance (const SALOMEDSImpl_SComponent&, const std::string& ComponentIOR); - - Standard_EXPORT virtual bool RemoveComponent(const SALOMEDSImpl_SComponent& aComponent); + virtual bool RemoveComponent(const SALOMEDSImpl_SComponent& aComponent); - Standard_EXPORT virtual SALOMEDSImpl_SObject NewObject(const SALOMEDSImpl_SObject& theFatherObject); + virtual SALOMEDSImpl_SObject NewObject(const SALOMEDSImpl_SObject& theFatherObject); - Standard_EXPORT virtual SALOMEDSImpl_SObject NewObjectToTag(const SALOMEDSImpl_SObject& theFatherObject, - const int theTag); + virtual SALOMEDSImpl_SObject NewObjectToTag(const SALOMEDSImpl_SObject& theFatherObject, + const int theTag); //! The methods adds a new subdirectory, the path can be absolute or relative (then the current context is used) - Standard_EXPORT virtual bool AddDirectory(const std::string& thePath); + virtual bool AddDirectory(const std::string& thePath); - Standard_EXPORT virtual bool LoadWith(const SALOMEDSImpl_SComponent& sco, SALOMEDSImpl_Driver* Engine); - Standard_EXPORT virtual bool Load(const SALOMEDSImpl_SObject& sco); + virtual bool LoadWith(const SALOMEDSImpl_SComponent& sco, SALOMEDSImpl_Driver* Engine); + virtual bool Load(const SALOMEDSImpl_SObject& sco); - Standard_EXPORT virtual bool RemoveObject(const SALOMEDSImpl_SObject& anObject); - Standard_EXPORT virtual bool RemoveObjectWithChildren(const SALOMEDSImpl_SObject& anObject); + virtual bool RemoveObject(const SALOMEDSImpl_SObject& anObject); + virtual bool RemoveObjectWithChildren(const SALOMEDSImpl_SObject& anObject); - Standard_EXPORT virtual DF_Attribute* FindOrCreateAttribute(const SALOMEDSImpl_SObject& anObject, - const std::string& aTypeOfAttribute); - Standard_EXPORT virtual bool FindAttribute(const SALOMEDSImpl_SObject& anObject, - DF_Attribute*& anAttribute, - const std::string& aTypeOfAttribute); + virtual DF_Attribute* FindOrCreateAttribute(const SALOMEDSImpl_SObject& anObject, + const std::string& aTypeOfAttribute); + virtual bool FindAttribute(const SALOMEDSImpl_SObject& anObject, + DF_Attribute*& anAttribute, + const std::string& aTypeOfAttribute); - Standard_EXPORT virtual bool RemoveAttribute(const SALOMEDSImpl_SObject& anObject, const std::string& aTypeOfAttribute); + virtual bool RemoveAttribute(const SALOMEDSImpl_SObject& anObject, const std::string& aTypeOfAttribute); - Standard_EXPORT virtual bool Addreference(const SALOMEDSImpl_SObject& me, - const SALOMEDSImpl_SObject& thereferencedObject); + virtual bool Addreference(const SALOMEDSImpl_SObject& me, + const SALOMEDSImpl_SObject& thereferencedObject); - Standard_EXPORT virtual bool RemoveReference(const SALOMEDSImpl_SObject& me); + virtual bool RemoveReference(const SALOMEDSImpl_SObject& me); - Standard_EXPORT virtual bool SetGUID(const SALOMEDSImpl_SObject& anObject, const std::string& theGUID); - Standard_EXPORT virtual bool IsGUID(const SALOMEDSImpl_SObject& anObject, const std::string& theGUID); + virtual bool SetGUID(const SALOMEDSImpl_SObject& anObject, const std::string& theGUID); + virtual bool IsGUID(const SALOMEDSImpl_SObject& anObject, const std::string& theGUID); - Standard_EXPORT virtual void NewCommand(); - Standard_EXPORT virtual void CommitCommand(); - Standard_EXPORT virtual bool HasOpenCommand(); - Standard_EXPORT virtual void AbortCommand(); - Standard_EXPORT virtual void Undo(); - Standard_EXPORT virtual void Redo(); - Standard_EXPORT bool GetAvailableUndos(); - Standard_EXPORT bool GetAvailableRedos(); - Standard_EXPORT bool IsSaved(); - Standard_EXPORT bool IsModified(); - Standard_EXPORT virtual int UndoLimit(); - Standard_EXPORT virtual void UndoLimit(const int); + virtual void NewCommand(); + virtual void CommitCommand(); + virtual bool HasOpenCommand(); + virtual void AbortCommand(); + virtual void Undo(); + virtual void Redo(); + bool GetAvailableUndos(); + bool GetAvailableRedos(); + bool IsSaved(); + bool IsModified(); + virtual int UndoLimit(); + virtual void UndoLimit(const int); - Standard_EXPORT void CheckLocked(); + void CheckLocked(); - Standard_EXPORT virtual SALOMEDSImpl_Callback* SetOnAddSObject(const SALOMEDSImpl_Callback* theCallback); - Standard_EXPORT virtual SALOMEDSImpl_Callback* SetOnRemoveSObject(const SALOMEDSImpl_Callback* theCallback); + virtual SALOMEDSImpl_Callback* SetOnAddSObject(const SALOMEDSImpl_Callback* theCallback); + virtual SALOMEDSImpl_Callback* SetOnRemoveSObject(const SALOMEDSImpl_Callback* theCallback); - Standard_EXPORT virtual bool SetName(const SALOMEDSImpl_SObject& theSO, const std::string& theValue); + virtual bool SetName(const SALOMEDSImpl_SObject& theSO, const std::string& theValue); - Standard_EXPORT virtual bool SetComment(const SALOMEDSImpl_SObject& theSO, const std::string& theValue); + virtual bool SetComment(const SALOMEDSImpl_SObject& theSO, const std::string& theValue); - Standard_EXPORT virtual bool SetIOR(const SALOMEDSImpl_SObject& theSO, const std::string& theValue); + virtual bool SetIOR(const SALOMEDSImpl_SObject& theSO, const std::string& theValue); - Standard_EXPORT virtual std::string GetErrorCode() { return _errorCode; } - Standard_EXPORT virtual bool IsError() { return _errorCode != ""; } + virtual std::string GetErrorCode() { return _errorCode; } + virtual bool IsError() { return _errorCode != ""; } - Standard_EXPORT virtual SALOMEDSImpl_Study* GetOwner() { return _study; } + virtual SALOMEDSImpl_Study* GetOwner() { return _study; } }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.hxx index 5d8cff6a2..fe13af984 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.hxx @@ -24,37 +24,35 @@ #ifndef SALOMEDSImpl_StudyHandle_HeaderFile #define SALOMEDSImpl_StudyHandle_HeaderFile +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Attribute.hxx" #include "DF_Label.hxx" /* - Class : SALOMEDSImpl_StudyHandle - Description : PRIVATE: This class is intended for storing of the study handle +Class : SALOMEDSImpl_StudyHandle +Description : PRIVATE: This class is intended for storing of the study handle */ #include "SALOMEDSImpl_Study.hxx" -#ifndef WNT -class Standard_EXPORT SALOMEDSImpl_StudyHandle : public DF_Attribute -#else -class SALOMEDSImpl_StudyHandle : public DF_Attribute -#endif +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_StudyHandle : + public DF_Attribute { public: -Standard_EXPORT SALOMEDSImpl_StudyHandle(); -Standard_EXPORT ~SALOMEDSImpl_StudyHandle() {; } - -Standard_EXPORT static SALOMEDSImpl_StudyHandle* Set(const DF_Label& theLabel, SALOMEDSImpl_Study* theStudy); -Standard_EXPORT static const std::string& GetID() ; - -Standard_EXPORT void Set(SALOMEDSImpl_Study* theStudy) { myHandle = theStudy; } -Standard_EXPORT SALOMEDSImpl_Study* Get() { return myHandle; } -Standard_EXPORT const std::string& ID() const; -Standard_EXPORT void Restore( DF_Attribute* theWith ); -Standard_EXPORT DF_Attribute* NewEmpty() const; -Standard_EXPORT void Paste( DF_Attribute* theInto); - + SALOMEDSImpl_StudyHandle(); + ~SALOMEDSImpl_StudyHandle() {; } + + static SALOMEDSImpl_StudyHandle* Set(const DF_Label& theLabel, SALOMEDSImpl_Study* theStudy); + static const std::string& GetID() ; + + void Set(SALOMEDSImpl_Study* theStudy) { myHandle = theStudy; } + SALOMEDSImpl_Study* Get() { return myHandle; } + const std::string& ID() const; + void Restore( DF_Attribute* theWith ); + DF_Attribute* NewEmpty() const; + void Paste( DF_Attribute* theInto); + private: SALOMEDSImpl_Study* myHandle; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx index 428c5b636..bd904c91b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx @@ -462,7 +462,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aUrl, HDFdataset *hdf_dataset =0; hdf_size size[1]; hdf_int32 name_len = 0; - char *component_name = 0; + string component_name; if(!aStudy) { _errorCode = "Study is null"; @@ -609,12 +609,12 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aUrl, hdf_sco_group2->CreateOnDisk(); SaveAttributes(SC, hdf_sco_group2); // ComponentDataType treatment - component_name = (char*)SC.ComponentDataType().c_str(); - name_len = (hdf_int32)strlen(component_name); + component_name = SC.ComponentDataType(); + name_len = (hdf_int32)component_name.length(); size[0] = name_len +1 ; hdf_dataset = new HDFdataset("COMPONENTDATATYPE",hdf_sco_group2,HDF_STRING,size,1); hdf_dataset->CreateOnDisk(); - hdf_dataset->WriteOnDisk(component_name); + hdf_dataset->WriteOnDisk((char*)component_name.c_str()); hdf_dataset->CloseOnDisk(); hdf_dataset=0; //will be deleted by hdf_sco_group destructor Impl_SaveObject(SC, hdf_sco_group2); @@ -638,12 +638,12 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aUrl, //----------------------------------------------------------------------- //5 - Write the Study Properties //----------------------------------------------------------------------- - name_len = (hdf_int32) aStudy->Name().size(); + string study_name = aStudy->Name(); + name_len = (hdf_int32) study_name.size(); size[0] = name_len +1 ; hdf_dataset = new HDFdataset("STUDY_NAME",hdf_group_study_structure,HDF_STRING,size,1); hdf_dataset->CreateOnDisk(); - char* studid = (char*)aStudy->Name().c_str(); - hdf_dataset->WriteOnDisk(studid); + hdf_dataset->WriteOnDisk((char*)study_name.c_str()); hdf_dataset->CloseOnDisk(); hdf_dataset=0; // will be deleted by hdf_group_study_structure destructor @@ -717,8 +717,8 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveObject(const SALOMEDSImpl_SObject& SC, SALOMEDSImpl_SObject SO = SALOMEDSImpl_Study::SObject(itchild.Value()); - char* scoid = (char*) SO.GetID().c_str(); - hdf_group_sobject = new HDFgroup(scoid, hdf_group_datatype); + string scoid = SO.GetID(); + hdf_group_sobject = new HDFgroup(scoid.c_str(), hdf_group_datatype); hdf_group_sobject->CreateOnDisk(); SaveAttributes(SO, hdf_group_sobject); Impl_SaveObject(SO, hdf_group_sobject); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.hxx index 190317bbc..b42dd8451 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.hxx @@ -24,6 +24,8 @@ #ifndef __SALOMEDSImpl_STUDYMANAGER_I_H__ #define __SALOMEDSImpl_STUDYMANAGER_I_H__ +#include "SALOMEDSImpl_Defines.hxx" + // std C++ headers #include #include @@ -39,7 +41,7 @@ class HDFgroup; -class SALOMEDSImpl_StudyManager +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_StudyManager { private: @@ -52,87 +54,87 @@ private: public: //! standard constructor - Standard_EXPORT SALOMEDSImpl_StudyManager(); + SALOMEDSImpl_StudyManager(); //! standard destructor - Standard_EXPORT virtual ~SALOMEDSImpl_StudyManager(); + virtual ~SALOMEDSImpl_StudyManager(); //! method to Create a New Study of name study_name - Standard_EXPORT virtual SALOMEDSImpl_Study* NewStudy(const std::string& study_name); + virtual SALOMEDSImpl_Study* NewStudy(const std::string& study_name); //! method to Open a Study from it's persistent reference - Standard_EXPORT virtual SALOMEDSImpl_Study* Open(const std::string& aStudyUrl); + virtual SALOMEDSImpl_Study* Open(const std::string& aStudyUrl); //! method to close a Study - Standard_EXPORT virtual void Close(SALOMEDSImpl_Study* aStudy); + virtual void Close(SALOMEDSImpl_Study* aStudy); //! method to save a Study - Standard_EXPORT virtual bool Save(SALOMEDSImpl_Study* aStudy, SALOMEDSImpl_DriverFactory* aFactory, bool theMultiFile); + virtual bool Save(SALOMEDSImpl_Study* aStudy, SALOMEDSImpl_DriverFactory* aFactory, bool theMultiFile); - Standard_EXPORT virtual bool SaveASCII(SALOMEDSImpl_Study* aStudy, - SALOMEDSImpl_DriverFactory* aFactory, - bool theMultiFile); + virtual bool SaveASCII(SALOMEDSImpl_Study* aStudy, + SALOMEDSImpl_DriverFactory* aFactory, + bool theMultiFile); //! method to save a Study to the persistent reference aUrl - Standard_EXPORT virtual bool SaveAs(const std::string& aUrl, - SALOMEDSImpl_Study* aStudy, - SALOMEDSImpl_DriverFactory* aFactory, - bool theMultiFile); + virtual bool SaveAs(const std::string& aUrl, + SALOMEDSImpl_Study* aStudy, + SALOMEDSImpl_DriverFactory* aFactory, + bool theMultiFile); - Standard_EXPORT virtual bool SaveAsASCII(const std::string& aUrl, - SALOMEDSImpl_Study* aStudy, - SALOMEDSImpl_DriverFactory* aFactory, - bool theMultiFile); + virtual bool SaveAsASCII(const std::string& aUrl, + SALOMEDSImpl_Study* aStudy, + SALOMEDSImpl_DriverFactory* aFactory, + bool theMultiFile); //! method to Get name list of open studies in the session - Standard_EXPORT virtual std::vector GetOpenStudies(); + virtual std::vector GetOpenStudies(); //! method to get a Study from it's name - Standard_EXPORT virtual SALOMEDSImpl_Study* GetStudyByName(const std::string& aStudyName) ; + virtual SALOMEDSImpl_Study* GetStudyByName(const std::string& aStudyName) ; //! method to get a Study from it's ID - Standard_EXPORT virtual SALOMEDSImpl_Study* GetStudyByID(int aStudyID) ; - - - Standard_EXPORT DF_Document* GetDocumentOfStudy(SALOMEDSImpl_Study* theStudy); - - Standard_EXPORT DF_Document* GetClipboard() { return _clipboard; } - - Standard_EXPORT bool CopyLabel(SALOMEDSImpl_Study* theSourceStudy, - SALOMEDSImpl_Driver* theEngine, - const int theSourceStartDepth, - const DF_Label& theSource, - const DF_Label& theDestinationMain); - - Standard_EXPORT DF_Label PasteLabel(SALOMEDSImpl_Study* theDestinationStudy, - SALOMEDSImpl_Driver* theEngine, - const DF_Label& theSource, - const DF_Label& theDestinationStart, - const int theCopiedStudyID, - const bool isFirstElement); - - Standard_EXPORT virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); - Standard_EXPORT virtual bool Copy(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); - Standard_EXPORT virtual bool CanPaste(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); - Standard_EXPORT virtual SALOMEDSImpl_SObject Paste(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); + virtual SALOMEDSImpl_Study* GetStudyByID(int aStudyID) ; + + + DF_Document* GetDocumentOfStudy(SALOMEDSImpl_Study* theStudy); + + DF_Document* GetClipboard() { return _clipboard; } + + bool CopyLabel(SALOMEDSImpl_Study* theSourceStudy, + SALOMEDSImpl_Driver* theEngine, + const int theSourceStartDepth, + const DF_Label& theSource, + const DF_Label& theDestinationMain); + + DF_Label PasteLabel(SALOMEDSImpl_Study* theDestinationStudy, + SALOMEDSImpl_Driver* theEngine, + const DF_Label& theSource, + const DF_Label& theDestinationStart, + const int theCopiedStudyID, + const bool isFirstElement); + + virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); + virtual bool Copy(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); + virtual bool CanPaste(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); + virtual SALOMEDSImpl_SObject Paste(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_Driver* Engine); // _SaveAs private function called by Save and SaveAs - Standard_EXPORT virtual bool Impl_SaveAs(const std::string& aUrl, - SALOMEDSImpl_Study* aStudy, - SALOMEDSImpl_DriverFactory* aFactory, - bool theMultiFile, - bool theASCII); + virtual bool Impl_SaveAs(const std::string& aUrl, + SALOMEDSImpl_Study* aStudy, + SALOMEDSImpl_DriverFactory* aFactory, + bool theMultiFile, + bool theASCII); // _SaveObject private function called by _SaveAs - Standard_EXPORT virtual bool Impl_SaveObject(const SALOMEDSImpl_SObject& SC, HDFgroup *hdf_group_datatype); + virtual bool Impl_SaveObject(const SALOMEDSImpl_SObject& SC, HDFgroup *hdf_group_datatype); // _SubstituteSlash function called by Open and GetStudyByName - Standard_EXPORT virtual std::string Impl_SubstituteSlash(const std::string& aUrl); + virtual std::string Impl_SubstituteSlash(const std::string& aUrl); - Standard_EXPORT virtual bool Impl_SaveProperties(SALOMEDSImpl_Study* aStudy, HDFgroup *hdf_group); + virtual bool Impl_SaveProperties(SALOMEDSImpl_Study* aStudy, HDFgroup *hdf_group); - Standard_EXPORT std::string GetErrorCode() { return _errorCode; } - Standard_EXPORT virtual bool IsError() { return _errorCode != ""; } + std::string GetErrorCode() { return _errorCode; } + virtual bool IsError() { return _errorCode != ""; } }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.hxx index 3d63b66cd..a9ee8d706 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.hxx @@ -21,19 +21,20 @@ #ifndef __SALOMEDSIMPL_TMPFILE_H__ #define __SALOMEDSIMPL_TMPFILE_H__ +#include "SALOMEDSImpl_Defines.hxx" #include "DF_definitions.hxx" -struct SALOMEDSImpl_TMPFile +struct SALOMEDSIMPL_EXPORT SALOMEDSImpl_TMPFile { typedef unsigned char TOctet; //typedef unsigned int size_t; - Standard_EXPORT virtual size_t Size() = 0; + virtual size_t Size() = 0; - Standard_EXPORT virtual TOctet* Data(); + virtual TOctet* Data(); - Standard_EXPORT virtual TOctet& Get(size_t) = 0; + virtual TOctet& Get(size_t) = 0; }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx index 7d817c961..fcc1745e8 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx @@ -24,12 +24,12 @@ // Project : SALOME // Module : SALOMEDSImpl -#include "SALOMEDSImpl_Tool.hxx" - #include #include #include +#include +#include "SALOMEDSImpl_Tool.hxx" #ifndef WNT #include @@ -40,10 +40,10 @@ #else #include #include +//#include +#include #endif -#include - using namespace std; @@ -153,7 +153,7 @@ void SALOMEDSImpl_Tool::RemoveTemporaryFiles(const string& theDirectory, if(IsDirDeleted) { if(Exists(aDirName)) { #ifdef WNT - RemoveDirectory(aDireName.c_str()); + RemoveDirectory(aDirName.c_str()); #else rmdir(aDirName.c_str()); #endif @@ -202,7 +202,7 @@ string SALOMEDSImpl_Tool::GetDirFromPath(const string& thePath) { } #ifdef WNT //Check if the only disk letter is given as path - if(path.size() == 2 && path[1] == ":") path +='\\'; + if(path.size() == 2 && path[1] == ':') path +='\\'; #endif for(int i = 0, len = path.size(); i #include #include "DF_Label.hxx" -class SALOMEDSImpl_Tool +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Tool { public: diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.hxx index c54a5dd93..d9413c443 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.hxx @@ -24,6 +24,8 @@ #ifndef __SALOMEDSIMPL_USECaseBuilder_H__ #define __SALOMEDSIMPL_USECaseBuilder_H__ +#include "SALOMEDSImpl_Defines.hxx" + #include #include "DF_Document.hxx" @@ -31,7 +33,7 @@ #include "SALOMEDSImpl_AttributeTreeNode.hxx" #include "SALOMEDSImpl_UseCaseIterator.hxx" -class SALOMEDSImpl_UseCaseBuilder +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_UseCaseBuilder { private: @@ -41,38 +43,38 @@ private: public: //! standard constructor - Standard_EXPORT SALOMEDSImpl_UseCaseBuilder(DF_Document* theDocument); - + SALOMEDSImpl_UseCaseBuilder(DF_Document* theDocument); + //! standard destructor - Standard_EXPORT ~SALOMEDSImpl_UseCaseBuilder(); - - Standard_EXPORT virtual bool Append(const SALOMEDSImpl_SObject& theObject); + ~SALOMEDSImpl_UseCaseBuilder(); + + virtual bool Append(const SALOMEDSImpl_SObject& theObject); + + virtual bool Remove(const SALOMEDSImpl_SObject& theObject); - Standard_EXPORT virtual bool Remove(const SALOMEDSImpl_SObject& theObject); + virtual bool AppendTo(const SALOMEDSImpl_SObject& theFather, const SALOMEDSImpl_SObject& theObject); - Standard_EXPORT virtual bool AppendTo(const SALOMEDSImpl_SObject& theFather, const SALOMEDSImpl_SObject& theObject); + virtual bool InsertBefore(const SALOMEDSImpl_SObject& theFirst, const SALOMEDSImpl_SObject& theNext); - Standard_EXPORT virtual bool InsertBefore(const SALOMEDSImpl_SObject& theFirst, const SALOMEDSImpl_SObject& theNext); + virtual bool SetCurrentObject(const SALOMEDSImpl_SObject& theObject); - Standard_EXPORT virtual bool SetCurrentObject(const SALOMEDSImpl_SObject& theObject); - - Standard_EXPORT virtual bool SetRootCurrent(); + virtual bool SetRootCurrent(); - Standard_EXPORT virtual bool HasChildren(const SALOMEDSImpl_SObject& theObject); + virtual bool HasChildren(const SALOMEDSImpl_SObject& theObject); - Standard_EXPORT virtual bool IsUseCase(const SALOMEDSImpl_SObject& theObject); + virtual bool IsUseCase(const SALOMEDSImpl_SObject& theObject); - Standard_EXPORT virtual bool SetName(const std::string& theName); + virtual bool SetName(const std::string& theName); - Standard_EXPORT virtual SALOMEDSImpl_SObject GetCurrentObject(); + virtual SALOMEDSImpl_SObject GetCurrentObject(); - Standard_EXPORT virtual std::string GetName(); + virtual std::string GetName(); - Standard_EXPORT virtual SALOMEDSImpl_SObject AddUseCase(const std::string& theName); + virtual SALOMEDSImpl_SObject AddUseCase(const std::string& theName); - Standard_EXPORT virtual SALOMEDSImpl_UseCaseIterator GetUseCaseIterator(const SALOMEDSImpl_SObject& anObject); + virtual SALOMEDSImpl_UseCaseIterator GetUseCaseIterator(const SALOMEDSImpl_SObject& anObject); - Standard_EXPORT SALOMEDSImpl_SObject GetSObject(const std::string& theEntry); + SALOMEDSImpl_SObject GetSObject(const std::string& theEntry); }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.hxx index a01cb1040..7d0182eb0 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.hxx @@ -24,13 +24,15 @@ #ifndef __SALOMEDSIMPL_USECASEITERATOR_H__ #define __SALOMEDSIMPL_USECASEITERATOR_H__ +#include "SALOMEDSImpl_Defines.hxx" + #include "SALOMEDSImpl_SObject.hxx" #include "DF_ChildIterator.hxx" #include "SALOMEDSImpl_ChildNodeIterator.hxx" #include -class Standard_EXPORT SALOMEDSImpl_UseCaseIterator +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_UseCaseIterator { private: @@ -45,12 +47,12 @@ public: //! standard constructor SALOMEDSImpl_UseCaseIterator(const DF_Label& theLabel, - const std::string& theGUID, - const bool allLevels); - + const std::string& theGUID, + const bool allLevels); + //! standard destructor ~SALOMEDSImpl_UseCaseIterator(); - + virtual void Init(bool); virtual bool More(); virtual void Next(); diff --git a/src/TOOLSDS/SALOMEDS_Tool.cxx b/src/TOOLSDS/SALOMEDS_Tool.cxx index fcf2be69d..290206e08 100644 --- a/src/TOOLSDS/SALOMEDS_Tool.cxx +++ b/src/TOOLSDS/SALOMEDS_Tool.cxx @@ -27,13 +27,12 @@ #include "SALOMEDS_Tool.hxx" #include "utilities.h" +#include "OpUtil.hxx" #ifndef WNT #include #include #include -#include -#include #include #include #else @@ -41,6 +40,8 @@ #include #endif +#include +#include #include #include @@ -52,7 +53,7 @@ bool Exists(const string thePath) { #ifdef WNT if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) { - if ( GetLastError () != ERROR_FILE_NOT_FOUND ) { + if ( GetLastError () == ERROR_FILE_NOT_FOUND ) { return false; } } @@ -70,9 +71,10 @@ bool Exists(const string thePath) //============================================================================ std::string SALOMEDS_Tool::GetTmpDir() { + return OpUtil_Dir::GetTmpDirByEnv("SALOME_TMP_DIR"); //Find a temporary directory to store a file - string aTmpDir = ""; + /*string aTmpDir = ""; char *Tmp_dir = getenv("SALOME_TMP_DIR"); if(Tmp_dir != NULL) { @@ -122,7 +124,7 @@ std::string SALOMEDS_Tool::GetTmpDir() mkdir(aDir.c_str(), 0x1ff); #endif - return aDir; + return aDir;*/ } //============================================================================ @@ -151,7 +153,7 @@ void SALOMEDS_Tool::RemoveTemporaryFiles(const std::string& theDirectory, if(IsDirDeleted) { if(Exists(aDirName)) { #ifdef WNT - RemoveDirectory(aDireName.c_str()); + RemoveDirectory(aDirName.c_str()); #else rmdir(aDirName.c_str()); #endif @@ -408,7 +410,7 @@ std::string SALOMEDS_Tool::GetDirFromPath(const std::string& thePath) { } #ifdef WNT //Check if the only disk letter is given as path - if(path.size() == 2 && path[1] == ":") path +='\\'; + if(path.size() == 2 && path[1] == ':') path +='\\'; #endif for(int i = 0, len = path.size(); i +#include #else #include #endif using namespace std; + //int gethostname(char *name, size_t len); std::string GetHostname() @@ -76,3 +78,170 @@ std::string GetHostname() return p; } + +std::string OpUtil_Dir::GetTmpDirByEnv( const std::string& tmp_path_env ) +{ + string dir; + char* val = getenv( tmp_path_env.c_str() ); + val ? dir = string( val ) : ""; + return GetTmpDirByPath( dir ); +} + +std::string OpUtil_Dir::GetTmpDirByPath( const std::string& tmp_path ) +{ + string aTmpDir = tmp_path; + char sep = +#ifdef WNT + '\\'; +#else + '/'; +#endif + /*if ( tmp_path.length() > 0 ) + { + char *Tmp_dir = getenv(tmp_path_env.c_str()); + if( Tmp_dir != NULL ) + { + aTmpDir = string(Tmp_dir); + if(aTmpDir[aTmpDir.size()-1] != sep) + aTmpDir+=sep; + } + }*/ + if ( aTmpDir == "" ) + { +#ifdef WNT + char *Tmp_dir = getenv("TEMP"); + if( Tmp_dir == NULL ) + { + Tmp_dir = getenv("TMP"); + if (Tmp_dir == NULL) + aTmpDir = string("C:\\"); + else + aTmpDir = string(Tmp_dir); + } + else + aTmpDir = string(Tmp_dir); +#else + aTmpDir = string("/tmp/"); +#endif + } + + if(aTmpDir[aTmpDir.size()-1] != sep) + aTmpDir+=sep; + + srand((unsigned int)time(NULL)); + int aRND = 999 + (int)(100000.0*rand()/(RAND_MAX+1.0)); //Get a random number to present a name of a sub directory + char buffer[127]; + sprintf(buffer, "%d", aRND); + string aSubDir(buffer); + if(aSubDir.size() <= 1) aSubDir = string("123409876"); + + aTmpDir += aSubDir; //Get RND sub directory + + string aDir = aTmpDir; + + if(IsExists(aDir)) { + for(aRND = 0; IsExists(aDir); aRND++) { + sprintf(buffer, "%d", aRND); + aDir = aTmpDir+buffer; //Build a unique directory name + } + } + + if(aDir[aDir.size()-1] != sep) aDir+=sep; + +#ifdef WNT + CreateDirectory(aDir.c_str(), NULL); +#else + mkdir(aDir.c_str(), 0x1ff); +#endif + + return aDir; +} + +//============================================================================ +// function : GetTempDir +// purpose : Return a temp directory to store created files like "/tmp/sub_dir/" +//============================================================================ +std::string OpUtil_Dir::GetTmpDir() +{ + return GetTmpDirByPath( "" ); + //Find a temporary directory to store a file +/* + string aTmpDir = ""; + char sep = +#ifdef WNT + '\\'; +#else + '/'; +#endif + if ( tmp_path_env.length() > 0 ) + { + char *Tmp_dir = getenv(tmp_path_env.c_str()); + if( Tmp_dir != NULL ) + { + aTmpDir = string(Tmp_dir); + if(aTmpDir[aTmpDir.size()-1] != sep) + aTmpDir+=sep; + } + } + if ( aTmpDir == "" ) + { +#ifdef WNT + char *Tmp_dir = getenv("TEMP"); + if( Tmp_dir == NULL ) + { + Tmp_dir = getenv("TMP"); + if (Tmp_dir == NULL) + aTmpDir = string("C:\\"); + else + aTmpDir = string(Tmp_dir); + } + else + aTmpDir = string(Tmp_dir); +#else + aTmpDir = string("/tmp/"); +#endif + } + + srand((unsigned int)time(NULL)); + int aRND = 999 + (int)(100000.0*rand()/(RAND_MAX+1.0)); //Get a random number to present a name of a sub directory + char buffer[127]; + sprintf(buffer, "%d", aRND); + string aSubDir(buffer); + if(aSubDir.size() <= 1) aSubDir = string("123409876"); + + aTmpDir += aSubDir; //Get RND sub directory + + string aDir = aTmpDir; + + if(Exists(aDir)) { + for(aRND = 0; Exists(aDir); aRND++) { + sprintf(buffer, "%d", aRND); + aDir = aTmpDir+buffer; //Build a unique directory name + } + } + + if(aDir[aDir.size()-1] != sep) aDir+=sep; + +#ifdef WNT + CreateDirectory(aDir.c_str(), NULL); +#else + mkdir(aDir.c_str(), 0x1ff); +#endif + + return aDir;*/ +} + +bool OpUtil_Dir::IsExists(const string& thePath) +{ +#ifdef WNT + if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) { + if ( GetLastError () == ERROR_FILE_NOT_FOUND ) { + return false; + } + } +#else + int status = access ( thePath.c_str() , F_OK ); + if (status != 0) return false; +#endif + return true; +} \ No newline at end of file diff --git a/src/Utils/OpUtil.hxx b/src/Utils/OpUtil.hxx index ba5d5eb42..f462726a4 100644 --- a/src/Utils/OpUtil.hxx +++ b/src/Utils/OpUtil.hxx @@ -34,4 +34,24 @@ UTILS_EXPORT std::string GetHostname(); UTILS_EXPORT const char *duplicate(const char * const); +class UTILS_EXPORT OpUtil_Dir +{ +public: + // Returns the unique temporary directory, that is defined in tmp_path_env if this variable is set + // otherwise return /tmp/something/ for Unix or c:\something\ for WNT + static std::string GetTmpDirByEnv( const std::string& tmp_path_env ); + + // Returns the unique temporary directory, that is defined in tmp_path if this variable is set + // otherwise return /tmp/something/ for Unix or c:\something\ for WNT + static std::string GetTmpDirByPath( const std::string& tmp_path ); + + // Returns the unique temporary directory in + // /tmp/something/ for Unix or c:\something\ for WNT + static std::string GetTmpDir(); + + // Returns True(False) if the path (not)exists + static bool IsExists( const std::string& path ); + +}; + #endif -- 2.39.2