\param value This string parameter defines the value of this attribute - a description of a %SObject.
<BR><VAR>See also <A href="exemple/Example1.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
+*/
+ void SetValue(in string value);
+ };
+ //==========================================================================
+/*! \brief String attribute
+
+ This attribute stores a string value containing arbitrary information.
+*/
+ //==========================================================================
+ interface AttributeString : GenericAttribute
+ {
+/*!
+ Returns the value of this attribute
+*/
+ string Value();
+/*!
+ Sets the value of this attribute
+ \param value This string parameter defines the value of this attribute.
*/
void SetValue(in string value);
};
SALOMEDS_AttributeStudyProperties_i.cxx \
SALOMEDS_AttributePythonObject_i.cxx \
SALOMEDS_AttributeParameter_i.cxx \
+ SALOMEDS_AttributeString_i.cxx \
SALOMEDS_SObject.cxx \
SALOMEDS_SComponent.cxx \
SALOMEDS_GenericAttribute.cxx \
SALOMEDS_AttributeUserID.cxx \
SALOMEDS_TMPFile_i.cxx \
SALOMEDS_AttributeParameter.cxx \
+ SALOMEDS_AttributeString.cxx \
SALOMEDS_IParameters.cxx \
\
Handle_SALOMEDS_DataMapNodeOfDataMapOfIntegerString.hxx \
SALOMEDS_UseCaseIterator_i.hxx \
SALOMEDS_AttributeParameter.hxx \
SALOMEDS_AttributeParameter_i.hxx \
+ SALOMEDS_AttributeString.hxx \
+ SALOMEDS_AttributeString_i.hxx \
SALOMEDS_TMPFile_i.hxx
libSalomeDS_la_CPPFLAGS = $(COMMON_CPPFLAGS)
--- /dev/null
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : SALOMEDS_AttributeString.cxx
+// Author : Sergey RUIN
+// Module : SALOME
+
+#include "SALOMEDS_AttributeString.hxx"
+#include "SALOMEDS.hxx"
+
+#include <string>
+#include <TCollection_AsciiString.hxx>
+#include <TCollection_ExtendedString.hxx>
+
+SALOMEDS_AttributeString::SALOMEDS_AttributeString(const Handle(SALOMEDSImpl_AttributeString)& theAttr)
+:SALOMEDS_GenericAttribute(theAttr)
+{}
+
+SALOMEDS_AttributeString::SALOMEDS_AttributeString(SALOMEDS::AttributeString_ptr theAttr)
+:SALOMEDS_GenericAttribute(theAttr)
+{}
+
+SALOMEDS_AttributeString::~SALOMEDS_AttributeString()
+{}
+
+std::string SALOMEDS_AttributeString::Value()
+{
+ std::string aValue;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeString)::
+ DownCast(_local_impl)->Value()).ToCString();
+ }
+ else aValue = SALOMEDS::AttributeString::_narrow(_corba_impl)->Value();
+ return aValue;
+}
+
+void SALOMEDS_AttributeString::SetValue(const std::string& value)
+{
+ if (_isLocal) {
+ CheckLocked();
+ SALOMEDS::Locker lock;
+ Handle(SALOMEDSImpl_AttributeString)::DownCast(_local_impl)->SetValue((char*)value.c_str());
+ }
+ else SALOMEDS::AttributeString::_narrow(_corba_impl)->SetValue(value.c_str());
+}
--- /dev/null
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : SALOMEDS_AttributeString.hxx
+// Author : Sergey RUIN
+// Module : SALOME
+
+#ifndef SALOMEDS_AttributeString_HeaderFile
+#define SALOMEDS_AttributeString_HeaderFile
+
+#include "SALOMEDSClient_AttributeString.hxx"
+#include "SALOMEDS_GenericAttribute.hxx"
+#include "SALOMEDSImpl_AttributeString.hxx"
+
+// IDL headers
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SALOMEDS)
+#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
+
+class SALOMEDS_AttributeString: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeString
+{
+public:
+ SALOMEDS_AttributeString(const Handle(SALOMEDSImpl_AttributeString)& theAttr);
+ SALOMEDS_AttributeString(SALOMEDS::AttributeString_ptr theAttr);
+ ~SALOMEDS_AttributeString();
+
+ virtual std::string Value();
+ virtual void SetValue(const std::string& value);
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : SALOMEDS_AttributeString_i.cxx
+// Author : Sergey RUIN
+// Module : SALOME
+
+
+#include "SALOMEDS_AttributeString_i.hxx"
+
+#include <TCollection_ExtendedString.hxx>
+#include "SALOMEDS_SObject_i.hxx"
+#include "SALOMEDS.hxx"
+
+using namespace std;
+
+char* SALOMEDS_AttributeString_i::Value()
+{
+ SALOMEDS::Locker lock;
+
+ CORBA::String_var c_s =
+ CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeString)::DownCast(_impl)->Value()).ToCString());
+ return c_s._retn();
+}
+
+void SALOMEDS_AttributeString_i::SetValue(const char* value)
+{
+ SALOMEDS::Locker lock;
+
+ CheckLocked();
+ TCollection_AsciiString aStr((char*)value);
+ Handle(SALOMEDSImpl_AttributeString)::DownCast(_impl)->SetValue(TCollection_ExtendedString(aStr));
+}
--- /dev/null
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : SALOMEDS_AttributeString_i.hxx
+// Author : Sergey RUIN
+// Module : SALOME
+
+#ifndef SALOMEDS_AttributeString_i_HeaderFile
+#define SALOMEDS_AttributeString_i_HeaderFile
+
+// IDL headers
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
+
+#include "SALOMEDS_GenericAttribute_i.hxx"
+#include "SALOMEDSImpl_AttributeString.hxx"
+
+class SALOMEDS_AttributeString_i: public virtual POA_SALOMEDS::AttributeString,
+ public virtual SALOMEDS_GenericAttribute_i
+{
+public:
+ SALOMEDS_AttributeString_i(const Handle(SALOMEDSImpl_AttributeString)& theAttr, CORBA::ORB_ptr orb)
+ :SALOMEDS_GenericAttribute_i(theAttr, orb) {};
+
+ virtual ~SALOMEDS_AttributeString_i() {};
+
+ char* Value();
+ void SetValue(const char* value);
+};
+
+#endif
#include "SALOMEDSImpl_AttributeFlags.hxx"
#include "SALOMEDSImpl_AttributeGraphic.hxx"
#include "SALOMEDSImpl_AttributeParameter.hxx"
+#include "SALOMEDSImpl_AttributeString.hxx"
#include "SALOMEDS_GenericAttribute_i.hxx"
#include "SALOMEDS_AttributeName_i.hxx"
#include "SALOMEDS_AttributeFlags_i.hxx"
#include "SALOMEDS_AttributeGraphic_i.hxx"
#include "SALOMEDS_AttributeParameter_i.hxx"
+#include "SALOMEDS_AttributeString_i.hxx"
#define __CreateCORBAAttribute(CORBA_Name) if (strcmp(aTypeOfAttribute, #CORBA_Name) == 0) { \
Handle(SALOMEDSImpl_##CORBA_Name) A = Handle(SALOMEDSImpl_##CORBA_Name)::DownCast(theAttr); \
__CreateCORBAAttribute(AttributeGraphic) \
__CreateCORBAAttribute(AttributeTreeNode) \
__CreateCORBAAttribute(AttributeUserID) \
-__CreateCORBAAttribute(AttributeParameter)
+__CreateCORBAAttribute(AttributeParameter) \
+__CreateCORBAAttribute(AttributeString)
#endif
#include "SALOMEDSImpl_AttributeFlags.hxx"
#include "SALOMEDSImpl_AttributeGraphic.hxx"
#include "SALOMEDSImpl_AttributeParameter.hxx"
+#include "SALOMEDSImpl_AttributeString.hxx"
#include "SALOMEDS_GenericAttribute.hxx"
#include "SALOMEDS_AttributeName.hxx"
#include "SALOMEDS_AttributeFlags.hxx"
#include "SALOMEDS_AttributeGraphic.hxx"
#include "SALOMEDS_AttributeParameter.hxx"
+#include "SALOMEDS_AttributeString.hxx"
#define __CreateClientAttributeLocal(CORBA_Name) if (strcmp(aTypeOfAttribute.c_str(), #CORBA_Name) == 0) { \
Handle(SALOMEDSImpl_##CORBA_Name) A = Handle(SALOMEDSImpl_##CORBA_Name)::DownCast(theGA); \
__CreateClientAttributeLocal(AttributeGraphic) \
__CreateClientAttributeLocal(AttributeTreeNode) \
__CreateClientAttributeLocal(AttributeUserID) \
-__CreateClientAttributeLocal(AttributeParameter)
+__CreateClientAttributeLocal(AttributeParameter) \
+__CreateClientAttributeLocal(AttributeString)
#define __CreateGenericClientAttributeCORBA \
__CreateClientAttributeCORBA(AttributeReal) \
__CreateClientAttributeCORBA(AttributeGraphic) \
__CreateClientAttributeCORBA(AttributeTreeNode) \
__CreateClientAttributeCORBA(AttributeUserID) \
-__CreateClientAttributeCORBA(AttributeParameter)
+__CreateClientAttributeCORBA(AttributeParameter) \
+__CreateClientAttributeCORBA(AttributeString)
#endif
SALOMEDSClient_AttributeTreeNode.hxx \
SALOMEDSClient_AttributeUserID.hxx \
SALOMEDSClient_AttributeParameter.hxx \
+ SALOMEDSClient_AttributeString.hxx \
SALOMEDSClient_ChildIterator.hxx \
SALOMEDSClient_GenericAttribute.hxx \
SALOMEDSClient_SComponent.hxx \
#include "SALOMEDSClient_AttributeTreeNode.hxx"
#include "SALOMEDSClient_AttributeUserID.hxx"
#include "SALOMEDSClient_AttributeParameter.hxx"
+#include "SALOMEDSClient_AttributeString.hxx"
#include "SALOMEDSClient_ChildIterator.hxx"
#include "SALOMEDSClient_GenericAttribute.hxx"
#include "SALOMEDSClient_SComponent.hxx"
SALOMEDSImpl_AttributeComment.hxx \
SALOMEDSImpl_AttributeReference.hxx \
SALOMEDSImpl_AttributeParameter.hxx \
+ SALOMEDSImpl_AttributeString.hxx \
SALOMEDSImpl_UseCaseBuilder.hxx \
SALOMEDSImpl_UseCaseIterator.hxx \
SALOMEDSImpl_SComponentIterator.hxx \
SALOMEDSImpl_AttributeComment.cxx \
SALOMEDSImpl_AttributeReference.cxx \
SALOMEDSImpl_AttributeParameter.cxx \
+ SALOMEDSImpl_AttributeString.cxx \
SALOMEDSImpl_ChildNodeIterator.cxx \
SALOMEDSImpl_UseCaseBuilder.cxx \
SALOMEDSImpl_UseCaseIterator.cxx \
SALOMEDSImpl_AttributeTextHighlightColor.hxx \
SALOMEDSImpl_AttributeTreeNode.hxx \
SALOMEDSImpl_AttributeUserID.hxx \
+ SALOMEDSImpl_AttributeParameter.hxx \
+ SALOMEDSImpl_AttributeString.hxx \
SALOMEDSImpl_Callback.hxx \
SALOMEDSImpl_ChildIterator.hxx \
SALOMEDSImpl_ChildNodeIterator.hxx \
--- /dev/null
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : SALOMEDSImpl_AttributeString.cxx
+// Author : Sergey RUIN
+// Module : SALOME
+
+#include "SALOMEDSImpl_AttributeString.hxx"
+
+#ifndef WNT
+using namespace std;
+#endif
+
+IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeString, SALOMEDSImpl_GenericAttribute )
+IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeString, SALOMEDSImpl_GenericAttribute )
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& SALOMEDSImpl_AttributeString::GetID ()
+{
+ static Standard_GUID CommentID ("1808A12F-AD0E-4a6a-B58A-395DCF469FE9");
+ return CommentID;
+}
+
+Handle(SALOMEDSImpl_AttributeString) SALOMEDSImpl_AttributeString::Set (const TDF_Label& L,
+ const TCollection_ExtendedString& Val)
+{
+ Handle(SALOMEDSImpl_AttributeString) A;
+ if (!L.FindAttribute(SALOMEDSImpl_AttributeString::GetID(), A)) {
+ A = new SALOMEDSImpl_AttributeString();
+ L.AddAttribute(A);
+ }
+
+ A->SetValue(Val);
+
+ return A;
+}
+
+//=======================================================================
+//function : SetValue
+//purpose :
+//=======================================================================
+void SALOMEDSImpl_AttributeString::SetValue (const TCollection_ExtendedString& S)
+{
+ CheckLocked();
+
+ if(myString == S) return;
+
+ Backup();
+
+ myString = S;
+
+ SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
+}
+
+
+//=======================================================================
+//function : ID
+//purpose :
+//=======================================================================
+const Standard_GUID& SALOMEDSImpl_AttributeString::ID () const { return GetID(); }
+
+//=======================================================================
+//function : NewEmpty
+//purpose :
+//=======================================================================
+Handle(TDF_Attribute) SALOMEDSImpl_AttributeString::NewEmpty () const
+{
+ return new SALOMEDSImpl_AttributeString();
+}
+
+//=======================================================================
+//function : Restore
+//purpose :
+//=======================================================================
+void SALOMEDSImpl_AttributeString::Restore(const Handle(TDF_Attribute)& with)
+{
+ myString = Handle(SALOMEDSImpl_AttributeString)::DownCast (with)->Value ();
+}
+
+//=======================================================================
+//function : Paste
+//purpose :
+//=======================================================================
+
+void SALOMEDSImpl_AttributeString::Paste (const Handle(TDF_Attribute)& into,
+ const Handle(TDF_RelocationTable)& RT) const
+{
+ Handle(SALOMEDSImpl_AttributeString)::DownCast (into)->SetValue(myString);
+}
--- /dev/null
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : SALOMEDSImpl_AttributeIOR.hxx
+// Author : Sergey RUIN
+// Module : SALOME
+
+#ifndef _SALOMEDSImpl_AttributeString_HeaderFile
+#define _SALOMEDSImpl_AttributeString_HeaderFile
+
+#include <Standard_DefineHandle.hxx>
+#include <TDF_Attribute.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <TCollection_ExtendedString.hxx>
+#include <TDF_Label.hxx>
+#include <Standard_GUID.hxx>
+#include "SALOMEDSImpl_GenericAttribute.hxx"
+
+class Handle(TDF_Attribute);
+class Handle(TDF_RelocationTable);
+
+DEFINE_STANDARD_HANDLE( SALOMEDSImpl_AttributeString, SALOMEDSImpl_GenericAttribute )
+
+class SALOMEDSImpl_AttributeString : public SALOMEDSImpl_GenericAttribute
+{
+private:
+
+ TCollection_ExtendedString myString;
+
+public:
+
+Standard_EXPORT static const Standard_GUID& GetID() ;
+
+Standard_EXPORT SALOMEDSImpl_AttributeString() :SALOMEDSImpl_GenericAttribute("AttributeString") {}
+
+Standard_EXPORT static Handle(SALOMEDSImpl_AttributeString) Set(const TDF_Label& L, const TCollection_ExtendedString& Val);
+Standard_EXPORT void SetValue (const TCollection_ExtendedString& S);
+Standard_EXPORT TCollection_ExtendedString Value() const { return myString; }
+
+Standard_EXPORT virtual TCollection_AsciiString Save() { return myString; }
+Standard_EXPORT virtual void Load(const TCollection_AsciiString& theValue) { myString = theValue; }
+
+Standard_EXPORT const Standard_GUID& ID() const;
+Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) ;
+Standard_EXPORT Handle_TDF_Attribute NewEmpty() const;
+Standard_EXPORT void Paste(const Handle(TDF_Attribute)& into,const Handle(TDF_RelocationTable)& RT) const;
+
+Standard_EXPORT ~SALOMEDSImpl_AttributeString() {}
+
+public:
+ DEFINE_STANDARD_RTTI( SALOMEDSImpl_AttributeString )
+};
+
+#endif
#include "SALOMEDSImpl_AttributeFlags.hxx"
#include "SALOMEDSImpl_AttributeGraphic.hxx"
#include "SALOMEDSImpl_AttributeParameter.hxx"
+#include "SALOMEDSImpl_AttributeString.hxx"
#define __AttributeTypeToGUIDForSObject \
if(theType == "AttributeFlags") return SALOMEDSImpl_AttributeFlags::GetID(); \
if(theType == "AttributeGraphic") return SALOMEDSImpl_AttributeGraphic::GetID(); \
if(theType == "AttributeReference") return SALOMEDSImpl_AttributeReference::GetID(); \
- if(theType == "AttributeParameter") return SALOMEDSImpl_AttributeParameter::GetID();
+ if(theType == "AttributeParameter") return SALOMEDSImpl_AttributeParameter::GetID(); \
+ if(theType == "AttributeString") return SALOMEDSImpl_AttributeString::GetID();
#define __FindOrCreateAttributeLocked(ClassName) if (strcmp(aTypeOfAttribute.ToCString(), #ClassName) == 0) { \
__FindOrCreateAttributeLocked(AttributeTableOfString) \
__FindOrCreateAttributeLocked(AttributePythonObject) \
__FindOrCreateAttributeLocked(AttributeParameter) \
+__FindOrCreateAttributeLocked(AttributeString) \
__FindOrCreateAttribute(AttributePersistentRef) \
__FindOrCreateAttribute(AttributeDrawable) \
__FindOrCreateAttribute(AttributeSelectable) \