From bfb17f2f7eaca38e8174a07cb64ae199fb64b3fe Mon Sep 17 00:00:00 2001 From: srn Date: Thu, 26 Jan 2006 07:13:03 +0000 Subject: [PATCH] Implementation of AttributeParameter --- idl/SALOMEDS_Attributes.idl | 125 +++ src/SALOMEDS/Makefile.in | 4 +- src/SALOMEDS/SALOMEDS_AttributeParameter.cxx | 440 ++++++++++ src/SALOMEDS/SALOMEDS_AttributeParameter.hxx | 77 ++ .../SALOMEDS_AttributeParameter_i.cxx | 347 ++++++++ .../SALOMEDS_AttributeParameter_i.hxx | 89 ++ src/SALOMEDS/SALOMEDS_Attributes.hxx | 5 +- src/SALOMEDS/SALOMEDS_ClientAttributes.hxx | 8 +- src/SALOMEDSClient/Makefile.in | 1 + src/SALOMEDSClient/SALOMEDSClient.hxx | 1 + .../SALOMEDSClient_AttributeParameter.hxx | 71 ++ src/SALOMEDSImpl/Makefile.in | 2 + .../SALOMEDSImpl_AttributeParameter.cxx | 767 ++++++++++++++++++ .../SALOMEDSImpl_AttributeParameter.hxx | 119 +++ src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx | 5 +- src/SALOMEDSImpl/testDS.cxx | 100 ++- 16 files changed, 2152 insertions(+), 9 deletions(-) create mode 100644 src/SALOMEDS/SALOMEDS_AttributeParameter.cxx create mode 100644 src/SALOMEDS/SALOMEDS_AttributeParameter.hxx create mode 100644 src/SALOMEDS/SALOMEDS_AttributeParameter_i.cxx create mode 100644 src/SALOMEDS/SALOMEDS_AttributeParameter_i.hxx create mode 100644 src/SALOMEDSClient/SALOMEDSClient_AttributeParameter.hxx create mode 100644 src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.cxx create mode 100644 src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx diff --git a/idl/SALOMEDS_Attributes.idl b/idl/SALOMEDS_Attributes.idl index 80afd5603..e1ca3d8bc 100644 --- a/idl/SALOMEDS_Attributes.idl +++ b/idl/SALOMEDS_Attributes.idl @@ -1334,5 +1334,130 @@ Sets the item to be selectable */ boolean IsScript(); }; + //========================================================================== +/*! \brief %AttributeParameter interface + + Attribute is a universal container of basic types +*/ + //========================================================================== + interface AttributeParameter : GenericAttribute + { +/*! + Associates a integer value with the ID + \param theID An ID of a parameter. + \param theValue A value of the parameter +*/ + void SetInt(in long theID, in long theValue); +/*! + Returns a int value associated with the given ID + \param theID An ID of a parameter. +*/ + long GetInt(in long theID); + +/*! + Associates a real value with the ID + \param theID An ID of a parameter. + \param theValue A value of the parameter +*/ + void SetReal(in long theID, in double theValue); +/*! + Returns a real value associated with the given ID + \param theID An ID of a parameter. +*/ + double GetReal(in long theID); + +/*! + Associates a string value with the ID + \param theID An ID of a parameter. + \param theValue A value of the parameter +*/ + void SetString(in long theID, in string theValue); +/*! + Returns a string value associated with the given ID + \param theID An ID of a parameter. +*/ + string GetString(in long theID); + +/*! + Associates a boolean value with the ID + \param theID An ID of a parameter. + \param theValue A value of the parameter +*/ + void SetBool(in long theID, in boolean theValue); +/*! + Returns a boolean value associated with the given ID + \param theID An ID of a parameter. +*/ + boolean GetBool(in long theID); + +/*! + Associates an array of real values with the ID + \param theID An ID of a parameter. + \param theArray The array of real values +*/ + void SetRealArray(in long theID, in DoubleSeq theArray); +/*! + Returns an array of real values associated with the ID + \param theID An ID of a parameter. +*/ + DoubleSeq GetRealArray(in long theID); + +/*! + Associates an array of integer values with the ID + \param theID An ID of a parameter. + \param theArray The array of integer values +*/ + void SetIntArray(in long theID, in LongSeq theArray); +/*! + Returns an array of integer values associated with the ID + \param theID An ID of a parameter. +*/ + LongSeq GetIntArray(in long theID); + +/*! + Associates an array of string values with the ID + \param theID An ID of a parameter. + \param theArray The array of string values +*/ + void SetStrArray(in long theID, in StringSeq theArray); +/*! + Returns an array of string values associated with the ID + \param theID An ID of a parameter. +*/ + StringSeq GetStrArray(in long theID); +/*! + Returns True if for the ID of given type was assigned a value in the attribute + \param theID An ID of a parameter. + \param theType A type of parameter [0(Int), 1(Real), 2(Boolean), 3(String), 4(Triplet)]. +*/ + boolean IsSet(in long theID, in long theType); +/*! + Removes a parameter with given ID and Type, returns True if succeded + \param theID An ID of a parameter. + \param theType A type of parameter [0(Int), 1(Real), 2(Boolean), 3(String), 4(Triplet)]. +*/ + boolean RemoveID(in long theID, in long theType); +/*! + Returns a father attribute of this attribute +*/ + AttributeParameter GetFather(); +/*! + Returns True if this attribute has a father attribute +*/ + boolean HasFather(); +/*! + Returns True if this attribute is a root attribute +*/ + boolean IsRoot(); +/*! + Clears the content of the attribute +*/ + void Clear(); +/*! + Returns a sequence of ID's of the give type + \param theType A type of parameter [0(Int), 1(Real), 2(Boolean), 3(String), 4(Triplet)]. + */ + LongSeq GetIDs(in long theType); + }; }; #endif diff --git a/src/SALOMEDS/Makefile.in b/src/SALOMEDS/Makefile.in index 96fb1ae2a..9a686f4d5 100644 --- a/src/SALOMEDS/Makefile.in +++ b/src/SALOMEDS/Makefile.in @@ -70,6 +70,7 @@ LIB_SRC = \ SALOMEDS_AttributeTableOfString_i.cxx \ SALOMEDS_AttributeStudyProperties_i.cxx \ SALOMEDS_AttributePythonObject_i.cxx \ + SALOMEDS_AttributeParameter_i.cxx \ SALOMEDS_SObject.cxx \ SALOMEDS_SComponent.cxx \ SALOMEDS_GenericAttribute.cxx \ @@ -107,7 +108,8 @@ LIB_SRC = \ SALOMEDS_AttributeTextColor.cxx \ SALOMEDS_AttributeTextHighlightColor.cxx \ SALOMEDS_AttributeTreeNode.cxx \ - SALOMEDS_AttributeUserID.cxx + SALOMEDS_AttributeUserID.cxx \ + SALOMEDS_AttributeParameter.cxx # Executables targets diff --git a/src/SALOMEDS/SALOMEDS_AttributeParameter.cxx b/src/SALOMEDS/SALOMEDS_AttributeParameter.cxx new file mode 100644 index 000000000..056ea49ea --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_AttributeParameter.cxx @@ -0,0 +1,440 @@ +// 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/ +// +// File : SALOMEDS_AttributeParameter.cxx +// Author : Sergey RUIN +// Module : SALOME + +#include "SALOMEDS_AttributeParameter.hxx" + +#include +#include + +//======================================================================= +/*! + * Function : Constructor + * Purpose : Creates a new instance of SALOMEDS_AttributeParameter + */ +//======================================================================= +SALOMEDS_AttributeParameter::SALOMEDS_AttributeParameter(const Handle(SALOMEDSImpl_AttributeParameter)& theAttr) +:SALOMEDS_GenericAttribute(theAttr) +{} + +//======================================================================= +/*! + * Function : Constructor + * Purpose : Creates a new instance of SALOMEDS_AttributeParameter + */ +//======================================================================= +SALOMEDS_AttributeParameter::SALOMEDS_AttributeParameter(SALOMEDS::AttributeParameter_ptr theAttr) +:SALOMEDS_GenericAttribute(theAttr) +{} + +//======================================================================= +/*! + * Function : Destructor + * Purpose : Destroys the instance of SALOMEDS_AttributeParameter + */ +//======================================================================= +SALOMEDS_AttributeParameter::~SALOMEDS_AttributeParameter() +{} + +//======================================================================= +/*! + * Function : SetInt + * Purpose : Associates a integer value with the ID + */ +//======================================================================= +void SALOMEDS_AttributeParameter::SetInt(const int theID, const int& theValue) +{ + CheckLocked(); + + if(_isLocal) + Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->SetInt(theID, theValue); + else + SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetInt(theID, theValue); +} + +//======================================================================= +/*! + * Function : GetInt + * Purpose : Returns a int value associated with the given ID + */ +//======================================================================= +int SALOMEDS_AttributeParameter::GetInt(const int theID) +{ + int aValue; + if(_isLocal) + aValue = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetInt(theID); + else + aValue = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetInt(theID); + return aValue; +} + +//======================================================================= +/*! + * Function : SetReal + * Purpose : Associates a double value with the ID + */ +//======================================================================= +void SALOMEDS_AttributeParameter::SetReal(const int theID, const double& theValue) +{ + CheckLocked(); + + if(_isLocal) + Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->SetReal(theID, theValue); + else + SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetReal(theID, theValue); +} + +//======================================================================= +/*! + * Function : GetReal + * Purpose : Returns a double value associated with the given ID + */ +//======================================================================= +double SALOMEDS_AttributeParameter::GetReal(const int theID) +{ + double aValue; + if(_isLocal) + aValue = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetReal(theID); + else + aValue = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetReal(theID); + return aValue; +} + +//======================================================================= +/*! + * Function : SetString + * Purpose : Associates a string with the ID + */ +//======================================================================= +void SALOMEDS_AttributeParameter::SetString(const int theID, const string& theValue) +{ + CheckLocked(); + + if(_isLocal) + Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->SetString(theID, (char*)theValue.c_str()); + else + SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetString(theID, theValue.c_str()); +} + +//======================================================================= +/*! + * Function : GetString + * Purpose : Returns a string associated with the given ID + */ +//======================================================================= +string SALOMEDS_AttributeParameter::GetString(const int theID) +{ + string aValue; + if(_isLocal) + aValue = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetString(theID).ToCString(); + else + aValue = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetString(theID); + return aValue; +} + +//======================================================================= +/*! + * Function : SetBool + * Purpose : Associates a bool value with the ID + */ +//======================================================================= +void SALOMEDS_AttributeParameter::SetBool(const int theID, const bool& theValue) +{ + CheckLocked(); + + if(_isLocal) + Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->SetBool(theID, theValue); + else + SALOMEDS::AttributeParameter::_narrow(_corba_impl)->SetBool(theID, theValue); +} + +//======================================================================= +/*! + * Function : GetBool + * Purpose : Returns a bool value associated with the ID + */ +//======================================================================= +bool SALOMEDS_AttributeParameter::GetBool(const int theID) +{ + if(_isLocal) + return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetBool(theID); + else + return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetBool(theID); +} + +//======================================================================= +/*! + * Function : SetRealArray + * Purpose : Associates an array of double values with the given ID + */ +//======================================================================= +void SALOMEDS_AttributeParameter::SetRealArray(const int theID, const vector& theArray) +{ + CheckLocked(); + + if(_isLocal) + Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->SetRealArray(theID, theArray); + else { + SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq; + int length = theArray.size(); + if(length) { + aSeq->length(length); + for(int i = 0; iSetRealArray(theID, aSeq); + } +} + +//======================================================================= +/*! + * Function : GetRealArray + * Purpose : Returns an array of double values associated with the ID + */ +//======================================================================= +vector SALOMEDS_AttributeParameter::GetRealArray(const int theID) +{ + vector v; + if(_isLocal) + return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetRealArray(theID); + else { + SALOMEDS::DoubleSeq_var aSeq = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetRealArray(theID); + int length = aSeq->length(); + if(length) { + v.resize(length); + for(int i = 0; i < length; i++) v[i] = aSeq[i]; + } + } + return v; +} + +//======================================================================= +/*! + * Function : SetIntArray + * Purpose : Associates an array of int values with the given ID + */ +//======================================================================= +void SALOMEDS_AttributeParameter::SetIntArray(const int theID, const vector& theArray) +{ + CheckLocked(); + + if(_isLocal) + Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->SetIntArray(theID, theArray); + else { + SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq; + int length = theArray.size(); + if(length) { + aSeq->length(length); + for(int i = 0; iSetIntArray(theID, aSeq); + } +} + +//======================================================================= +/*! + * Function : GetIntArray + * Purpose : Returns an array of int values associated with the ID + */ +//======================================================================= +vector SALOMEDS_AttributeParameter::GetIntArray(const int theID) +{ + vector v; + if(_isLocal) + return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetIntArray(theID); + else { + SALOMEDS::LongSeq_var aSeq = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetIntArray(theID); + int length = aSeq->length(); + if(length) { + v.resize(length); + for(int i = 0; i < length; i++) v[i] = aSeq[i]; + } + } + return v; +} + +//======================================================================= +/*! + * Function : SetStrArray + * Purpose : Associates an array of string values with the given ID + */ +//======================================================================= +void SALOMEDS_AttributeParameter::SetStrArray(const int theID, const vector& theArray) +{ + CheckLocked(); + + if(_isLocal) + Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->SetStrArray(theID, theArray); + else { + SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq; + int length = theArray.size(); + if(length) { + aSeq->length(length); + for(int i = 0; iSetStrArray(theID, aSeq); + } +} + +//======================================================================= +/*! + * Function : GetStrArray + * Purpose : Returns an array of string values associated with the ID + */ +//======================================================================= +vector SALOMEDS_AttributeParameter::GetStrArray(const int theID) +{ + vector v; + if(_isLocal) + return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetStrArray(theID); + else { + SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetStrArray(theID); + int length = aSeq->length(); + if(length) { + v.resize(length); + for(int i = 0; i < length; i++) v[i] = string(aSeq[i].in()); + } + } + return v; +} + + +//======================================================================= +/*! + * Function : IsSet + * Purpose : Returns true if for the ID of given type was assigned \n + * a value in the attribute + */ +//======================================================================= +bool SALOMEDS_AttributeParameter::IsSet(const int theID, const int theType) +{ + if(_isLocal) + return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->IsSet(theID, (Parameter_Types)theType); + else + return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->IsSet(theID, theType); +} + +//======================================================================= +/*! + * Function : RemoveID + * Purpose : Removes a parameter with given ID + */ +//======================================================================= +bool SALOMEDS_AttributeParameter::RemoveID(const int theID, const int theType) +{ + CheckLocked(); + + if(_isLocal) + return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->RemoveID(theID, (Parameter_Types)theType); + else + return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->RemoveID(theID, theType); +} + +//======================================================================= +/*! + * Function : GetFather + * Purpose : Returns a father attribute for this attribute + */ +//======================================================================= +_PTR(AttributeParameter) SALOMEDS_AttributeParameter::GetFather() +{ + SALOMEDSClient_AttributeParameter* AP = NULL; + if(_isLocal) { + Handle(SALOMEDSImpl_AttributeParameter) AP_impl = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->GetFather(); + if(AP_impl.IsNull()) return _PTR(AttributeParameter)(AP); + AP = new SALOMEDS_AttributeParameter(AP_impl); + } + else { + SALOMEDS::AttributeParameter_var AP_impl = SALOMEDS::AttributeParameter::_narrow(_corba_impl)->GetFather(); + if(CORBA::is_nil(AP_impl)) return _PTR(AttributeParameter)(AP); + AP = new SALOMEDS_AttributeParameter(AP_impl); + } + + return _PTR(AttributeParameter)(AP); +} + +//======================================================================= +/*! + * Function : HasFather + * Purpose : Returns True if the attribute has a father attribute + */ +//======================================================================= +bool SALOMEDS_AttributeParameter::HasFather() +{ + if(_isLocal) + return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->HasFather(); + else + return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->HasFather(); +} + +//======================================================================= +/*! + * Function : IsRoot + * Purpose : Returns True is the attribute is highest in an hierachy + */ +//======================================================================= +bool SALOMEDS_AttributeParameter::IsRoot() +{ + if(_isLocal) + return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->IsRoot(); + else + return SALOMEDS::AttributeParameter::_narrow(_corba_impl)->IsRoot(); +} + +//======================================================================= +/*! + * Function : Clear + * Purpose : Clears the content of the attribute + */ +//======================================================================= +void SALOMEDS_AttributeParameter::Clear() +{ + if(_isLocal) + Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl)->Clear(); + else + SALOMEDS::AttributeParameter::_narrow(_corba_impl)->Clear(); +} + +//======================================================================= +/*! + * Function : GetIDs + * Purpose : Returns an array of all ID's of the given type + */ +//======================================================================= +vector SALOMEDS_AttributeParameter::GetIDs(const int theType) +{ + vector v; + if(_isLocal) { + Handle(SALOMEDSImpl_AttributeParameter) AP_impl = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_local_impl); + return AP_impl->GetIDs((Parameter_Types)theType); + } + else { + SALOMEDS::AttributeParameter_var AP_impl = SALOMEDS::AttributeParameter::_narrow(_corba_impl); + SALOMEDS::LongSeq_var CorbaSeq = AP_impl->GetIDs(theType); + int length = CorbaSeq->length(); + if(length) { + v.resize(length); + for(int i = 0; i +#include CORBA_SERVER_HEADER(SALOMEDS) +#include CORBA_SERVER_HEADER(SALOMEDS_Attributes) + +class SALOMEDS_AttributeParameter: public SALOMEDS_GenericAttribute, public SALOMEDSClient_AttributeParameter +{ +public: + SALOMEDS_AttributeParameter(const Handle(SALOMEDSImpl_AttributeParameter)& theAttr); + SALOMEDS_AttributeParameter(SALOMEDS::AttributeParameter_ptr theAttr); + ~SALOMEDS_AttributeParameter(); + + virtual void SetInt(const int theID, const int& theValue); + virtual int GetInt(const int theID); + + virtual void SetReal(const int theID, const double& theValue); + virtual double GetReal(const int theID); + + virtual void SetString(const int theID, const std::string& theValue); + virtual std::string GetString(const int theID); + + virtual void SetBool(const int theID, const bool& theValue); + virtual bool GetBool(const int theID); + + virtual void SetRealArray(const int theID, const std::vector& theArray); + virtual std::vector GetRealArray(const int theID); + + virtual void SetIntArray(const int theID, const std::vector& theArray); + virtual std::vector GetIntArray(const int theID); + + virtual void SetStrArray(const int theID, const std::vector& theArray); + virtual std::vector GetStrArray(const int theID); + + virtual bool IsSet(const int theID, const int theType); + + virtual bool RemoveID(const int theID, const int theType); + + virtual _PTR(AttributeParameter) GetFather(); + virtual bool HasFather(); + virtual bool IsRoot(); + + virtual void Clear(); + + virtual std::vector GetIDs(const int theType); +}; + +#endif diff --git a/src/SALOMEDS/SALOMEDS_AttributeParameter_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeParameter_i.cxx new file mode 100644 index 000000000..653edce65 --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_AttributeParameter_i.cxx @@ -0,0 +1,347 @@ +// 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/ +// +// File : SALOMEDS_AttributeParameter_i.cxx +// Author : Sergey RUIN +// Module : SALOME + + +#include "SALOMEDS_AttributeParameter_i.hxx" +#include "SALOMEDS.hxx" +#include + +#include + +using namespace std; + +//======================================================================= +/*! + * Function : SetInt + * Purpose : Associates a integer value with the ID + */ +//======================================================================= +void SALOMEDS_AttributeParameter_i::SetInt(CORBA::Long theID, CORBA::Long theValue) +{ + SALOMEDS::Locker lock; + CheckLocked(); + Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->SetInt(theID, theValue); +} + +//======================================================================= +/*! + * Function : GetInt + * Purpose : Returns a int value associated with the given ID + */ +//======================================================================= +CORBA::Long SALOMEDS_AttributeParameter_i::GetInt(CORBA::Long theID) +{ + SALOMEDS::Locker lock; + return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->GetInt(theID); +} + +//======================================================================= +/*! + * Function : SetReal + * Purpose : Associates a double value with the ID + */ +//======================================================================= +void SALOMEDS_AttributeParameter_i::SetReal(CORBA::Long theID, const CORBA::Double theValue) +{ + SALOMEDS::Locker lock; + CheckLocked(); + Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->SetReal(theID, theValue); +} + +//======================================================================= +/*! + * Function : GetReal + * Purpose : Returns a double value associated with the given ID + */ +//======================================================================= +CORBA::Double SALOMEDS_AttributeParameter_i::GetReal(CORBA::Long theID) +{ + SALOMEDS::Locker lock; + return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->GetReal(theID); +} + +//======================================================================= +/*! + * Function : SetString + * Purpose : Associates a string with the ID + */ +//======================================================================= +void SALOMEDS_AttributeParameter_i::SetString(CORBA::Long theID, const char* theValue) +{ + SALOMEDS::Locker lock; + CheckLocked(); + Handle(SALOMEDSImpl_AttributeParameter) impl = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl); + impl->SetString(theID, TCollection_AsciiString((char*)theValue)); +} + +//======================================================================= +/*! + * Function : GetString + * Purpose : Returns a string associated with the given ID + */ +//======================================================================= +char* SALOMEDS_AttributeParameter_i::GetString(CORBA::Long theID) +{ + SALOMEDS::Locker lock; + Handle(SALOMEDSImpl_AttributeParameter) impl = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl); + CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(impl->GetString(theID)).ToCString()); + return c_s._retn(); +} + +//======================================================================= +/*! + * Function : SetBool + * Purpose : Associates a bool value with the ID + */ +//======================================================================= +void SALOMEDS_AttributeParameter_i::SetBool(CORBA::Long theID, CORBA::Boolean theValue) +{ + SALOMEDS::Locker lock; + CheckLocked(); + Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->SetBool(theID, theValue); +} + +//======================================================================= +/*! + * Function : GetBool + * Purpose : Returns a bool value associated with the ID + */ +//======================================================================= +CORBA::Boolean SALOMEDS_AttributeParameter_i::GetBool(CORBA::Long theID) +{ + SALOMEDS::Locker lock; + return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->GetBool(theID); +} + +//======================================================================= +/*! + * Function : SetRealArray + * Purpose : Associates an array of double values with the given ID + */ +//======================================================================= +void SALOMEDS_AttributeParameter_i::SetRealArray(CORBA::Long theID, const SALOMEDS::DoubleSeq& theArray) +{ + SALOMEDS::Locker lock; + CheckLocked(); + vector v; + int length = theArray.length(); + if(length) { + v.resize(length); + for(int i = 0; iSetRealArray(theID, v); +} + +//======================================================================= +/*! + * Function : GetRealArray + * Purpose : Returns an array of double values associated with the ID + */ +//======================================================================= +SALOMEDS::DoubleSeq* SALOMEDS_AttributeParameter_i::GetRealArray(CORBA::Long theID) +{ + SALOMEDS::Locker lock; + SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq; + vector v = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->GetRealArray(theID); + int length = v.size(); + if(length) { + aSeq->length(length); + for(int i = 0; i v; + int length = theArray.length(); + if(length) { + v.resize(length); + for(int i = 0; iSetIntArray(theID, v); +} + +//======================================================================= +/*! + * Function : GetIntArray + * Purpose : Returns an array of int values associated with the ID + */ +//======================================================================= +SALOMEDS::LongSeq* SALOMEDS_AttributeParameter_i::GetIntArray(CORBA::Long theID) +{ + SALOMEDS::Locker lock; + SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq; + vector v = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->GetIntArray(theID); + int length = v.size(); + if(length) { + aSeq->length(length); + for(int i = 0; i v; + int length = theArray.length(); + if(length) { + v.resize(length); + for(int i = 0; iSetStrArray(theID, v); +} + +//======================================================================= +/*! + * Function : GetStrArray + * Purpose : Returns an array of string values associated with the ID + */ +//======================================================================= +SALOMEDS::StringSeq* SALOMEDS_AttributeParameter_i::GetStrArray(CORBA::Long theID) +{ + SALOMEDS::Locker lock; + SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq; + vector v = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->GetStrArray(theID); + int length = v.size(); + if(length) { + aSeq->length(length); + for(int i = 0; iIsSet(theID, (Parameter_Types)theType); +} + +//======================================================================= +/*! + * Function : RemoveID + * Purpose : Removes a parameter with given ID + */ +//======================================================================= +CORBA::Boolean SALOMEDS_AttributeParameter_i::RemoveID(CORBA::Long theID, CORBA::Long theType) +{ + SALOMEDS::Locker lock; + CheckLocked(); + return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->RemoveID(theID, (Parameter_Types)theType); +} + +//======================================================================= +/*! + * Function : GetFather + * Purpose : Returns a father attribute for this attribute + */ +//======================================================================= +SALOMEDS::AttributeParameter_ptr SALOMEDS_AttributeParameter_i::GetFather() +{ + SALOMEDS::Locker lock; + Handle(SALOMEDSImpl_AttributeParameter) impl = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl); + SALOMEDS_AttributeParameter_i* attr = new SALOMEDS_AttributeParameter_i(impl, _orb); + return attr->AttributeParameter::_this(); +} + +//======================================================================= +/*! + * Function : HasFather + * Purpose : Returns True if the attribute has a father attribute + */ +//======================================================================= +CORBA::Boolean SALOMEDS_AttributeParameter_i::HasFather() +{ + SALOMEDS::Locker lock; + return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->HasFather(); +} + +//======================================================================= +/*! + * Function : IsRoot + * Purpose : Returns True is the attribute is highest in an hierachy + */ +//======================================================================= +CORBA::Boolean SALOMEDS_AttributeParameter_i::IsRoot() +{ + SALOMEDS::Locker lock; + return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->IsRoot(); +} + +//======================================================================= +/*! + * Function : IsRoot + * Purpose : Clears the content of the attribute + */ +//======================================================================= +void SALOMEDS_AttributeParameter_i::Clear() +{ + SALOMEDS::Locker lock; + Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->Clear(); +} + + +//======================================================================= +/*! + * Function : GetIDs + * Purpose : Returns an array of all ID's of the given type + */ +//======================================================================= +SALOMEDS::LongSeq* SALOMEDS_AttributeParameter_i::GetIDs(CORBA::Long theType) +{ + SALOMEDS::Locker lock; + SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq; + vector A = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(_impl)->GetIDs((Parameter_Types)theType); + + if(A.size()) { + int length = A.size(); + CorbaSeq->length(length); + for (int i = 0; i < length; i++) CorbaSeq[i] = A[i];; + } + + return CorbaSeq._retn(); +} diff --git a/src/SALOMEDS/SALOMEDS_AttributeParameter_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeParameter_i.hxx new file mode 100644 index 000000000..c732a518a --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_AttributeParameter_i.hxx @@ -0,0 +1,89 @@ +// 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/ +// +// File : SALOMEDS_AttributeParameter_i.hxx +// Author : Sergey RUIN +// Module : SALOME +// $Header: + +#ifndef SALOMEDS_AttributeParameter_i_HeaderFile +#define SALOMEDS_AttributeParameter_i_HeaderFile + +// IDL headers +#include +#include CORBA_SERVER_HEADER(SALOMEDS_Attributes) + +#include "SALOMEDS_GenericAttribute_i.hxx" +#include "SALOMEDSImpl_AttributeParameter.hxx" + +/*! + Class: SALOMEDS_AttributeParameter + Description : AttributeParameter is a universal container of basic types +*/ + +class SALOMEDS_AttributeParameter_i: public virtual POA_SALOMEDS::AttributeParameter, + public virtual SALOMEDS_GenericAttribute_i +{ +public: + + SALOMEDS_AttributeParameter_i(const Handle(SALOMEDSImpl_AttributeParameter)& theAttr, CORBA::ORB_ptr orb) + :SALOMEDS_GenericAttribute_i(theAttr, orb) {}; + + ~SALOMEDS_AttributeParameter_i() {}; + + + virtual void SetInt(CORBA::Long theID, CORBA::Long theValue); + virtual CORBA::Long GetInt(CORBA::Long theID); + + virtual void SetReal(CORBA::Long theID, const CORBA::Double theValue); + virtual CORBA::Double GetReal(CORBA::Long theID); + + virtual void SetString(CORBA::Long theID, const char* theValue); + virtual char* GetString(CORBA::Long theID); + + virtual void SetBool(CORBA::Long theID, CORBA::Boolean theValue); + virtual CORBA::Boolean GetBool(CORBA::Long theID); + + virtual void SetRealArray(CORBA::Long theID, const SALOMEDS::DoubleSeq& theArray); + virtual SALOMEDS::DoubleSeq* GetRealArray(CORBA::Long theID); + + virtual void SetIntArray(CORBA::Long theID, const SALOMEDS::LongSeq& theArray); + virtual SALOMEDS::LongSeq* GetIntArray(CORBA::Long theID); + + virtual void SetStrArray(CORBA::Long theID, const SALOMEDS::StringSeq& theArray); + virtual SALOMEDS::StringSeq* GetStrArray(CORBA::Long theID); + + virtual CORBA::Boolean IsSet(CORBA::Long theID, CORBA::Long theType); + + virtual CORBA::Boolean RemoveID(CORBA::Long theID, CORBA::Long theType); + + virtual SALOMEDS::AttributeParameter_ptr GetFather(); + virtual CORBA::Boolean HasFather(); + virtual CORBA::Boolean IsRoot(); + + virtual void Clear(); + + virtual SALOMEDS::LongSeq* GetIDs(CORBA::Long theType); + +}; + + + + +#endif diff --git a/src/SALOMEDS/SALOMEDS_Attributes.hxx b/src/SALOMEDS/SALOMEDS_Attributes.hxx index a0c5586eb..e21925101 100644 --- a/src/SALOMEDS/SALOMEDS_Attributes.hxx +++ b/src/SALOMEDS/SALOMEDS_Attributes.hxx @@ -54,6 +54,7 @@ #include "SALOMEDSImpl_AttributeFileType.hxx" #include "SALOMEDSImpl_AttributeFlags.hxx" #include "SALOMEDSImpl_AttributeGraphic.hxx" +#include "SALOMEDSImpl_AttributeParameter.hxx" #include "SALOMEDS_GenericAttribute_i.hxx" #include "SALOMEDS_AttributeName_i.hxx" @@ -84,6 +85,7 @@ #include "SALOMEDS_AttributeFileType_i.hxx" #include "SALOMEDS_AttributeFlags_i.hxx" #include "SALOMEDS_AttributeGraphic_i.hxx" +#include "SALOMEDS_AttributeParameter_i.hxx" #define __CreateCORBAAttribute(CORBA_Name) if (strcmp(aTypeOfAttribute, #CORBA_Name) == 0) { \ Handle(SALOMEDSImpl_##CORBA_Name) A = Handle(SALOMEDSImpl_##CORBA_Name)::DownCast(theAttr); \ @@ -121,6 +123,7 @@ __CreateCORBAAttribute(AttributeFileType) \ __CreateCORBAAttribute(AttributeFlags) \ __CreateCORBAAttribute(AttributeGraphic) \ __CreateCORBAAttribute(AttributeTreeNode) \ -__CreateCORBAAttribute(AttributeUserID) +__CreateCORBAAttribute(AttributeUserID) \ +__CreateCORBAAttribute(AttributeParameter) #endif diff --git a/src/SALOMEDS/SALOMEDS_ClientAttributes.hxx b/src/SALOMEDS/SALOMEDS_ClientAttributes.hxx index 47105d5f3..c0bd6ecac 100644 --- a/src/SALOMEDS/SALOMEDS_ClientAttributes.hxx +++ b/src/SALOMEDS/SALOMEDS_ClientAttributes.hxx @@ -55,6 +55,7 @@ #include "SALOMEDSImpl_AttributeFileType.hxx" #include "SALOMEDSImpl_AttributeFlags.hxx" #include "SALOMEDSImpl_AttributeGraphic.hxx" +#include "SALOMEDSImpl_AttributeParameter.hxx" #include "SALOMEDS_GenericAttribute.hxx" #include "SALOMEDS_AttributeName.hxx" @@ -85,6 +86,7 @@ #include "SALOMEDS_AttributeFileType.hxx" #include "SALOMEDS_AttributeFlags.hxx" #include "SALOMEDS_AttributeGraphic.hxx" +#include "SALOMEDS_AttributeParameter.hxx" #define __CreateClientAttributeLocal(CORBA_Name) if (strcmp(aTypeOfAttribute.c_str(), #CORBA_Name) == 0) { \ Handle(SALOMEDSImpl_##CORBA_Name) A = Handle(SALOMEDSImpl_##CORBA_Name)::DownCast(theGA); \ @@ -124,7 +126,8 @@ __CreateClientAttributeLocal(AttributeFileType) \ __CreateClientAttributeLocal(AttributeFlags) \ __CreateClientAttributeLocal(AttributeGraphic) \ __CreateClientAttributeLocal(AttributeTreeNode) \ -__CreateClientAttributeLocal(AttributeUserID) +__CreateClientAttributeLocal(AttributeUserID) \ +__CreateClientAttributeLocal(AttributeParameter) #define __CreateGenericClientAttributeCORBA \ __CreateClientAttributeCORBA(AttributeReal) \ @@ -154,6 +157,7 @@ __CreateClientAttributeCORBA(AttributeFileType) \ __CreateClientAttributeCORBA(AttributeFlags) \ __CreateClientAttributeCORBA(AttributeGraphic) \ __CreateClientAttributeCORBA(AttributeTreeNode) \ -__CreateClientAttributeCORBA(AttributeUserID) +__CreateClientAttributeCORBA(AttributeUserID) \ +__CreateClientAttributeCORBA(AttributeParameter) #endif diff --git a/src/SALOMEDSClient/Makefile.in b/src/SALOMEDSClient/Makefile.in index c3c92b5e2..b29a1d0e3 100644 --- a/src/SALOMEDSClient/Makefile.in +++ b/src/SALOMEDSClient/Makefile.in @@ -39,6 +39,7 @@ EXPORT_HEADERS= SALOMEDSClient_definitions.hxx \ SALOMEDSClient_AttributeTextHighlightColor.hxx \ SALOMEDSClient_AttributeTreeNode.hxx \ SALOMEDSClient_AttributeUserID.hxx \ + SALOMEDSClient_AttributeParameter.hxx \ SALOMEDSClient_ChildIterator.hxx \ SALOMEDSClient_GenericAttribute.hxx \ SALOMEDSClient_SComponent.hxx \ diff --git a/src/SALOMEDSClient/SALOMEDSClient.hxx b/src/SALOMEDSClient/SALOMEDSClient.hxx index e604320e0..5adb67120 100644 --- a/src/SALOMEDSClient/SALOMEDSClient.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient.hxx @@ -49,6 +49,7 @@ #include "SALOMEDSClient_AttributeTextHighlightColor.hxx" #include "SALOMEDSClient_AttributeTreeNode.hxx" #include "SALOMEDSClient_AttributeUserID.hxx" +#include "SALOMEDSClient_AttributeParameter.hxx" #include "SALOMEDSClient_ChildIterator.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" #include "SALOMEDSClient_SComponent.hxx" diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeParameter.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeParameter.hxx new file mode 100644 index 000000000..118d84cce --- /dev/null +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeParameter.hxx @@ -0,0 +1,71 @@ +// 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/ +// +// File : SALOMEDSImpl_AttributeIOR.hxx +// Author : Sergey RUIN +// Module : SALOME + +#ifndef _SALOMEDSClient_AttributeParameter_HeaderFile +#define _SALOMEDSClient_AttributeParameter_HeaderFile + +#include "SALOMEDSClient_definitions.hxx" +#include "SALOMEDSClient_GenericAttribute.hxx" +#include +#include + +class SALOMEDSClient_AttributeParameter : public virtual SALOMEDSClient_GenericAttribute +{ + +public: + + virtual void SetInt(const int theID, const int& theValue) = 0; + virtual int GetInt(const int theID) = 0; + + virtual void SetReal(const int theID, const double& theValue) = 0; + virtual double GetReal(const int theID) = 0; + + virtual void SetString(const int theID, const std::string& theValue) = 0; + virtual std::string GetString(const int theID) = 0; + + virtual void SetBool(const int theID, const bool& theValue) = 0; + virtual bool GetBool(const int theID) = 0; + + virtual void SetRealArray(const int theID, const std::vector& theArray) = 0; + virtual std::vector GetRealArray(const int theID) = 0; + + virtual void SetIntArray(const int theID, const std::vector& theArray) = 0; + virtual std::vector GetIntArray(const int theID) = 0; + + virtual void SetStrArray(const int theID, const std::vector& theArray) = 0; + virtual std::vector GetStrArray(const int theID) = 0; + + virtual bool IsSet(const int theID, const int theType) = 0; + + virtual bool RemoveID(const int theID, const int theType) = 0; + + virtual _PTR(AttributeParameter) GetFather() = 0; + virtual bool HasFather() = 0; + virtual bool IsRoot() = 0; + + virtual void Clear() = 0; + + virtual std::vector GetIDs(const int theType) = 0; +}; + +#endif diff --git a/src/SALOMEDSImpl/Makefile.in b/src/SALOMEDSImpl/Makefile.in index fa73429a9..b64478a7e 100644 --- a/src/SALOMEDSImpl/Makefile.in +++ b/src/SALOMEDSImpl/Makefile.in @@ -47,6 +47,7 @@ EXPORT_HEADERS= \ SALOMEDSImpl_AttributeName.hxx \ SALOMEDSImpl_AttributeComment.hxx \ SALOMEDSImpl_AttributeReference.hxx \ + SALOMEDSImpl_AttributeParameter.hxx \ SALOMEDSImpl_UseCaseBuilder.hxx \ SALOMEDSImpl_UseCaseIterator.hxx \ SALOMEDSImpl_SComponentIterator.hxx \ @@ -105,6 +106,7 @@ LIB_SRC = SALOMEDSImpl_Tool.cxx \ SALOMEDSImpl_AttributeName.cxx \ SALOMEDSImpl_AttributeComment.cxx \ SALOMEDSImpl_AttributeReference.cxx \ + SALOMEDSImpl_AttributeParameter.cxx \ SALOMEDSImpl_ChildNodeIterator.cxx \ SALOMEDSImpl_UseCaseBuilder.cxx \ SALOMEDSImpl_UseCaseIterator.cxx \ diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.cxx new file mode 100644 index 000000000..ccf0e96f3 --- /dev/null +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.cxx @@ -0,0 +1,767 @@ +// 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/ +// +// File : SALOMEDSImpl_AttributeParameter.cxx +// Author : Sergey RUIN +// Module : SALOME + + +#include "SALOMEDSImpl_AttributeParameter.hxx" +#include + +#include +#include +#include + +using namespace std; + + + +IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeParameter, SALOMEDSImpl_GenericAttribute ) +IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeParameter, SALOMEDSImpl_GenericAttribute ) + + +// Purpose: Each character in the string is replaced by 3 characters: '%' and hex number +// of the character (2 characters) +string convertString(const string& S) +{ + int length = S.size(); + const char *s = S.c_str(); + char *c = new char[3], *buffer = new char[length*3+1]; + buffer[length*3] = (char)0; + for(int i = 0, pos = 0; i& theArray) +{ + CheckLocked(); + + Backup(); + + _realarrays[theID] = theArray; + + SetModifyFlag(); +} + +//======================================================================= +/*! + * Function : GetRealArray + * Purpose : Returns double values associated with the ID + */ +//======================================================================= +vector SALOMEDSImpl_AttributeParameter::GetRealArray(const int theID) +{ + if(!IsSet(theID, PT_REALARRAY)) Standard_Failure::Raise("Invalid ID"); + return _realarrays[theID]; +} + + +//======================================================================= +/*! + * Function : SetIntArray + * Purpose : Associates an array of int values with the given ID + */ +//======================================================================= +void SALOMEDSImpl_AttributeParameter::SetIntArray(const int theID, const vector& theArray) +{ + CheckLocked(); + + Backup(); + + _intarrays[theID] = theArray; + + SetModifyFlag(); +} + +//======================================================================= +/*! + * Function : GetIntArray + * Purpose : Returns int values associated with the ID + */ +//======================================================================= +vector SALOMEDSImpl_AttributeParameter::GetIntArray(const int theID) +{ + if(!IsSet(theID, PT_INTARRAY)) Standard_Failure::Raise("Invalid ID"); + return _intarrays[theID]; +} + + +//======================================================================= +/*! + * Function : SetStrArray + * Purpose : Associates an array of string values with the given ID + */ +//======================================================================= +void SALOMEDSImpl_AttributeParameter::SetStrArray(const int theID, const vector& theArray) +{ + CheckLocked(); + + Backup(); + + _strarrays[theID] = theArray; + + SetModifyFlag(); +} + +//======================================================================= +/*! + * Function : GetStrArray + * Purpose : Returns string values associated with the ID + */ +//======================================================================= +vector SALOMEDSImpl_AttributeParameter::GetStrArray(const int theID) +{ + if(!IsSet(theID, PT_STRARRAY)) Standard_Failure::Raise("Invalid ID"); + return _strarrays[theID]; +} + + +//======================================================================= +/*! + * Function : IsSet + * Purpose : Returns true if for the ID of given type was assigned \n + * a value in the attribute + */ +//======================================================================= +bool SALOMEDSImpl_AttributeParameter::IsSet(const int theID, const Parameter_Types theType) +{ + switch(theType) { + case PT_INTEGER: { + if(_ints.find(theID) != _ints.end()) return true; + break; + } + case PT_REAL: { + if(_reals.find(theID) != _reals.end()) return true; + break; + } + case PT_BOOLEAN: { + if(_bools.find(theID) != _bools.end()) return true; + break; + } + case PT_STRING: { + if(_strings.find(theID) != _strings.end()) return true; + break; + } + case PT_REALARRAY: { + if(_realarrays.find(theID) != _realarrays.end()) return true; + break; + } + case PT_INTARRAY: { + if(_intarrays.find(theID) != _intarrays.end()) return true; + break; + } + case PT_STRARRAY: { + if(_strarrays.find(theID) != _strarrays.end()) return true; + break; + } + default: return false; + } + + return false; +} + +//======================================================================= +/*! + * Function : RemoveID + * Purpose : Removes a parameter with given ID + */ +//======================================================================= +bool SALOMEDSImpl_AttributeParameter::RemoveID(const int theID, const Parameter_Types theType) +{ + Backup(); + SetModifyFlag(); + + switch(theType) { + case PT_INTEGER: { + if(_ints.erase(theID)) return true; + break; + } + case PT_REAL: { + if(_reals.erase(theID)) return true; + break; + } + case PT_BOOLEAN: { + if(_bools.erase(theID)) return true; + break; + } + case PT_STRING: { + if(_strings.erase(theID)) return true; + break; + } + case PT_REALARRAY: { + if(_realarrays.erase(theID)) return true; + break; + } + case PT_INTARRAY: { + if(_intarrays.erase(theID)) return true; + break; + } + case PT_STRARRAY: { + if(_strarrays.erase(theID)) return true; + break; + } + default: return false; + } + + + return false; +} + + +//======================================================================= +/*! + * Function : GetFather + * Purpose : Returns a father attribute for this attribute + */ +//======================================================================= +Handle(SALOMEDSImpl_AttributeParameter) SALOMEDSImpl_AttributeParameter::GetFather() +{ + Handle(SALOMEDSImpl_AttributeParameter) aFather; + TDF_Label L = Label(); + if(L.IsRoot()) return aFather; + + while(!L.IsRoot()) { + L = L.Father(); + if(L.FindAttribute(SALOMEDSImpl_AttributeParameter::GetID(), aFather)) break; + } + + return aFather; +} + +//======================================================================= +/*! + * Function : HasFather + * Purpose : Returns True if the attribute has a father attribute + */ +//======================================================================= +bool SALOMEDSImpl_AttributeParameter::HasFather() +{ + TDF_Label L = Label(); + if(L.IsRoot()) return false; + while(!L.IsRoot()) { + L = L.Father(); + if(L.IsAttribute(SALOMEDSImpl_AttributeParameter::GetID())) return true; + } + + return false; +} + +//======================================================================= +/*! + * Function : IsRoot + * Purpose : Returns True is the attribute is highest in an hierachy + */ +//======================================================================= +bool SALOMEDSImpl_AttributeParameter::IsRoot() +{ + return ((HasFather())?false:true); +} + +//======================================================================= +/*! + * Function : Clear + * Purpose : Clears the content of the attribute + */ +//======================================================================= +void SALOMEDSImpl_AttributeParameter::Clear() +{ + Backup(); + + _ints.clear(); + _reals.clear(); + _bools.clear(); + _strings.clear(); + _realarrays.clear(); + _intarrays.clear(); + _strarrays.clear(); + + SetModifyFlag(); +} + +//======================================================================= +/*! + * Function : GetIDs + * Purpose : Returns an array of all ID's of the given type + */ +//======================================================================= +vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types theType) +{ + + vector anArray; + int i = 0; + + switch(theType) { + case PT_INTEGER: { + if(_ints.size()) { + anArray.resize(_ints.size()); + for(map::const_iterator p = _ints.begin(); p != _ints.end(); p++, i++) + anArray[i] = p->first; + } + break; + } + case PT_REAL: { + if(_reals.size()) { + anArray.resize(_reals.size()); + for(map::const_iterator p = _reals.begin(); p != _reals.end(); p++, i++) + anArray[i] = p->first; + } + break; + } + case PT_BOOLEAN: { + if(_bools.size()) { + anArray.resize(_bools.size()); + for(map::const_iterator p = _bools.begin(); p != _bools.end(); p++, i++) + anArray[i] = p->first; + } + break; + } + case PT_STRING: { + if(_strings.size()) { + anArray.resize(_strings.size()); + for(map::const_iterator p = _strings.begin(); p!= _strings.end(); p++) + anArray[i] = p->first; + } + break; + } + case PT_REALARRAY: { + if(_realarrays.size()) { + anArray.resize(_realarrays.size()); + for(map< int, vector >::const_iterator p = _realarrays.begin(); p!= _realarrays.end(); p++) + anArray[i] = p->first; + } + break; + } + case PT_INTARRAY: { + if(_intarrays.size()) { + anArray.resize(_intarrays.size()); + for(map< int, vector >::const_iterator p = _intarrays.begin(); p!= _intarrays.end(); p++) + anArray[i] = p->first; + } + break; + } + case PT_STRARRAY: { + if(_strarrays.size()) { + anArray.resize(_strarrays.size()); + for(map< int, vector >::const_iterator p = _strarrays.begin(); p!= _strarrays.end(); p++) + anArray[i] = p->first; + } + break; + } + default: return anArray; + } + + return anArray; +} + +//======================================================================= +/*! + * Function : ID + * Purpose : Rteurns an GUID of the attribute + */ +//======================================================================= +const Standard_GUID& SALOMEDSImpl_AttributeParameter::ID () const { return GetID(); } + + +Handle(TDF_Attribute) SALOMEDSImpl_AttributeParameter::NewEmpty () const +{ + return new SALOMEDSImpl_AttributeParameter(); +} + +//======================================================================= +/*! + * Function : Restore + * Purpose : Restors the content of the attribute from another + */ +//======================================================================= +void SALOMEDSImpl_AttributeParameter::Restore(const Handle(TDF_Attribute)& with) +{ + Handle(SALOMEDSImpl_AttributeParameter) A = Handle(SALOMEDSImpl_AttributeParameter)::DownCast (with); + _ints.clear(); + _reals.clear(); + _bools.clear(); + _strings.clear(); + _realarrays.clear(); + _intarrays.clear(); + _strarrays.clear(); + + for(map::const_iterator p = A->_ints.begin(); p!= A->_ints.end(); p++) _ints[p->first] = p->second; + for(map::const_iterator p = A->_reals.begin(); p!= A->_reals.end(); p++) _reals[p->first] = p->second; + for(map::const_iterator p = A->_bools.begin(); p!= A->_bools.end(); p++) _bools[p->first] = p->second; + for(map::const_iterator p = A->_strings.begin(); p!= A->_strings.end(); p++) + _strings[p->first] = p->second; + for(map< int,vector >::const_iterator p = A->_realarrays.begin(); p!= A->_realarrays.end(); p++) + _realarrays[p->first] = p->second; + for(map< int,vector >::const_iterator p = A->_intarrays.begin(); p!= A->_intarrays.end(); p++) + _intarrays[p->first] = p->second; + for(map< int,vector >::const_iterator p = A->_strarrays.begin(); p!= A->_strarrays.end(); p++) + _strarrays[p->first] = p->second; +} + +//======================================================================= +/*! + * Function : Paste + * Purpose : Pastes the content of attribute to another + */ +//======================================================================= +void SALOMEDSImpl_AttributeParameter::Paste (const Handle(TDF_Attribute)& into, + const Handle(TDF_RelocationTable)& RT) const +{ + into->Restore(this); +} + +//======================================================================= +/*! + * Function : Save + * Purpose : Saves a content of the attribute as a string + */ +//======================================================================= +TCollection_AsciiString SALOMEDSImpl_AttributeParameter::Save() +{ + ostrstream buffer; + char *tmpBuffer = new char[255]; + + buffer << _ints.size() << " "; + + for(map::const_iterator p = _ints.begin(); p != _ints.end(); p++) { + buffer << p->first << " " << p->second << " "; + } + + buffer << _reals.size() << " "; + for(map::const_iterator p =_reals.begin(); p != _reals.end(); p++) { + sprintf(tmpBuffer, "%.64e", p->second); + buffer << p->first << " " << tmpBuffer << " "; + } + + buffer << _bools.size() << " "; + for(map::const_iterator p = _bools.begin(); p != _bools.end(); p++) { + buffer << p->first << " " << p->second << " "; + } + + buffer << _strings.size() << " "; + for(map::const_iterator p = _strings.begin(); p != _strings.end(); p++) { + buffer << p->first << " " << convertString(p->second) << " "; + } + + buffer << _realarrays.size() << " "; + for(map< int,vector >::const_iterator p = _realarrays.begin(); p != _realarrays.end(); p++) { + vector v(p->second); + sprintf(tmpBuffer, " %d %d ", p->first, v.size()); + buffer << tmpBuffer; + for(int i = 0; i >::const_iterator p = _intarrays.begin(); p != _intarrays.end(); p++) { + vector v(p->second); + sprintf(tmpBuffer, " %d %d ", p->first, v.size()); + buffer << tmpBuffer; + for(int i = 0; i >::const_iterator p = _strarrays.begin(); p != _strarrays.end(); p++) { + vector v(p->second); + sprintf(tmpBuffer, " %d %d ", p->first, v.size()); + buffer << tmpBuffer; + for(int i = 0; istr()); + + return AS; +} + +//======================================================================= +/*! + * Function : Load + * Purpose : Restores the attribute from the string + */ +//======================================================================= +void SALOMEDSImpl_AttributeParameter::Load(const TCollection_AsciiString& theValue) +{ + Backup(); + + _ints.clear(); + _reals.clear(); + _bools.clear(); + _strings.clear(); + _realarrays.clear(); + _intarrays.clear(); + + istrstream buffer(theValue.ToCString(), strlen(theValue.ToCString())); + + int size, id, val, ival; + double val2; + string s; + + buffer >> size; + for(int i = 1; i<=size; i++) { + buffer >> id >> val; + _ints[id] = val; + } + + buffer >> size; + for(int i = 1; i<=size; i++) { + buffer >> id >> val2; + _reals[id] = val2; + } + + buffer >> size; + for(int i = 1; i<=size; i++) { + buffer >> id >> val; + _bools[id] = val; + } + + buffer >> size; + for(int i = 1; i<=size; i++) { + buffer >> id >> s; + _strings[id] = restoreString(s); + } + + buffer >> size; + for(int i = 1; i<=size; i++) { + buffer >> id >> val; + vector v; + v.resize(val); + for(int j = 0; j> val2; + v[j] = val2; + } + _realarrays[id] = v; + } + + buffer >> size; + for(int i = 1; i<=size; i++) { + buffer >> id >> val; + vector v; + v.resize(val); + for(int j = 0; j> ival; + v[j] = ival; + } + _intarrays[id] = v; + } + + buffer >> size; + for(int i = 1; i<=size; i++) { + buffer >> id >> val; + vector v; + v.resize(val); + for(int j = 0; j> s; + v[j] = restoreString(s); + } + _strarrays[id] = v; + } +} diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx new file mode 100644 index 000000000..92b2e16b3 --- /dev/null +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx @@ -0,0 +1,119 @@ +// 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/ +// +// File : SALOMEDSImpl_AttributeIOR.hxx +// Author : Sergey RUIN +// Module : SALOME + +#ifndef _SALOMEDSImpl_AttributeParameter_HeaderFile +#define _SALOMEDSImpl_AttributeParameter_HeaderFile + +#include +#include +#include +#include +#include +#include "SALOMEDSImpl_GenericAttribute.hxx" + +#include +#include +#include + +class Standard_GUID; +class Handle(TDF_Attribute); +class Handle(TDF_RelocationTable); + + +DEFINE_STANDARD_HANDLE( SALOMEDSImpl_AttributeParameter, SALOMEDSImpl_GenericAttribute ) + +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 : public SALOMEDSImpl_GenericAttribute +{ + +private: + + std::map _ints; + std::map _reals; + std::map _strings; + std::map _bools; + std::map< int, vector > _realarrays; + std::map< int, vector > _intarrays; + std::map< int, vector > _strarrays; + +public: + Standard_EXPORT static const Standard_GUID& GetID() ; + + Standard_EXPORT SALOMEDSImpl_AttributeParameter():SALOMEDSImpl_GenericAttribute("AttributeParameter") {} + Standard_EXPORT static Handle(SALOMEDSImpl_AttributeParameter) Set (const TDF_Label& L); + + + Standard_EXPORT void SetInt(const int theID, const int& theValue); + Standard_EXPORT int GetInt(const int theID); + + Standard_EXPORT void SetReal(const int theID, const double& theValue); + Standard_EXPORT double GetReal(const int theID); + + Standard_EXPORT void SetString(const int theID, const TCollection_AsciiString& theValue); + Standard_EXPORT TCollection_AsciiString GetString(const int theID); + + Standard_EXPORT void SetBool(const int theID, const bool& theValue); + Standard_EXPORT bool GetBool(const int theID); + + Standard_EXPORT void SetRealArray(const int theID, const std::vector& theArray); + Standard_EXPORT std::vector GetRealArray(const int theID); + + Standard_EXPORT void SetIntArray(const int theID, const std::vector& theArray); + Standard_EXPORT std::vector GetIntArray(const int theID); + + Standard_EXPORT void SetStrArray(const int theID, const std::vector& theArray); + Standard_EXPORT std::vector GetStrArray(const int theID); + + Standard_EXPORT bool IsSet(const int theID, const Parameter_Types theType); + + Standard_EXPORT bool RemoveID(const int theID, const Parameter_Types theType); + + Standard_EXPORT Handle(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 TCollection_AsciiString Save(); + Standard_EXPORT virtual void Load(const TCollection_AsciiString& 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_AttributeParameter() {} + +public: + DEFINE_STANDARD_RTTI( SALOMEDSImpl_AttributeParameter ) +}; + +#endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx index e593350f0..4be4e027e 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx @@ -63,6 +63,7 @@ public : #include "SALOMEDSImpl_AttributeFileType.hxx" #include "SALOMEDSImpl_AttributeFlags.hxx" #include "SALOMEDSImpl_AttributeGraphic.hxx" +#include "SALOMEDSImpl_AttributeParameter.hxx" #define __AttributeTypeToGUIDForSObject \ @@ -93,7 +94,8 @@ public : if(theType == "AttributeFileType") return SALOMEDSImpl_AttributeFileType::GetID(); \ if(theType == "AttributeFlags") return SALOMEDSImpl_AttributeFlags::GetID(); \ if(theType == "AttributeGraphic") return SALOMEDSImpl_AttributeGraphic::GetID(); \ - if(theType == "AttributeReference") return SALOMEDSImpl_AttributeReference::GetID(); + if(theType == "AttributeReference") return SALOMEDSImpl_AttributeReference::GetID(); \ + if(theType == "AttributeParameter") return SALOMEDSImpl_AttributeParameter::GetID(); #define __FindOrCreateAttributeLocked(ClassName) if (strcmp(aTypeOfAttribute.ToCString(), #ClassName) == 0) { \ @@ -129,6 +131,7 @@ __FindOrCreateAttributeLocked(AttributeTableOfInteger) \ __FindOrCreateAttributeLocked(AttributeTableOfReal) \ __FindOrCreateAttributeLocked(AttributeTableOfString) \ __FindOrCreateAttributeLocked(AttributePythonObject) \ +__FindOrCreateAttributeLocked(AttributeParameter) \ __FindOrCreateAttribute(AttributePersistentRef) \ __FindOrCreateAttribute(AttributeDrawable) \ __FindOrCreateAttribute(AttributeSelectable) \ diff --git a/src/SALOMEDSImpl/testDS.cxx b/src/SALOMEDSImpl/testDS.cxx index 8adcc07b5..b430b3dc1 100644 --- a/src/SALOMEDSImpl/testDS.cxx +++ b/src/SALOMEDSImpl/testDS.cxx @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -37,6 +38,8 @@ #include "SALOMEDSImpl_StudyBuilder.hxx" #include "SALOMEDSImpl_SObject.hxx" #include "SALOMEDSImpl_SComponent.hxx" +#include "SALOMEDSImpl_AttributeParameter.hxx" + //#include "SALOMEDSImpl_.hxx" int main (int argc, char * argv[]) @@ -81,15 +84,104 @@ int main (int argc, char * argv[]) aBuilder->RemoveObject(aSubSO); cout << "Remove: done" << endl; + cout << "Check AttributeTreeNode " << endl; + aTDFAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeTreeNode"); + cout << Handle(SALOMEDSImpl_GenericAttribute)::DownCast(aTDFAttr)->Type() << endl; + cout << "Check AttributeTreeNode : done " << endl; + + aTDFAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeParameter"); + cout << Handle(SALOMEDSImpl_GenericAttribute)::DownCast(aTDFAttr)->Type() << endl; + cout << "Check the attributes on SObject" << endl; Handle(TColStd_HSequenceOfTransient) aSeq = aSO->GetAllAttributes(); for(int i = 1; i <= aSeq->Length(); i++) cout << "Found: " << Handle(SALOMEDSImpl_GenericAttribute)::DownCast(aSeq->Value(i))->Type() << endl; - cout << "Check AttributeTreeNode " << endl; - aTDFAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeTreeNode"); - cout << Handle(SALOMEDSImpl_GenericAttribute)::DownCast(aTDFAttr)->Type() << endl; - cout << "Check AttributeTreeNode : done " << endl; + + + cout << "Check AttributeParameter " << endl; + + Handle(SALOMEDSImpl_AttributeParameter) AP = Handle(SALOMEDSImpl_AttributeParameter)::DownCast(aTDFAttr); + + cout << "AttributeParameter with type : " << AP->Type() << endl; + + AP->SetInt(1, 123); + cout << "IsSet for int: " << AP->IsSet(1, PT_INTEGER) << " value : " << AP->GetInt(1) << endl; + for(int i = 2; i < 5; i++) AP->SetInt(i, i*i); + + AP->SetReal(1, 123.123); + cout << "IsSet for real: " << AP->IsSet(1, PT_REAL) << " value : " << AP->GetReal(1) << endl; + for(int i = 2; i < 5; i++) AP->SetReal(i, 0.1); + + AP->SetString(1, "value is 123.123!"); + cout << "IsSet for string: " << AP->IsSet(1, PT_STRING) << " value : " << AP->GetString(1) << endl; + for(int i = 2; i < 5; i++) { + TCollection_AsciiString s((double)(1.0/i)); + cout << "Setting for " << i << " value : " << s << endl; + AP->SetString(i, s); + } + + AP->SetBool(1, true); + cout << "IsSet for bool: " << AP->IsSet(1, PT_BOOLEAN) << " value : " << AP->GetBool(1) << endl; + for(int i = 2; i < 5; i++) AP->SetBool(i, 0); + + vector v; + v.push_back(111.111); + v.push_back(222.22222); + v.push_back(333.3333333); + AP->SetRealArray(1, v); + cout << "IsSet for array: " << AP->IsSet(1, PT_REALARRAY); + vector v2 = AP->GetRealArray(1); + cout.precision(10); + cout << " values : "; + for(int i = 0; iSetRealArray(2, v); + + vector vi; + vi.push_back(1); + vi.push_back(2); + AP->SetIntArray(2, vi); + + vector vs; + vs.push_back("hello, "); + vs.push_back("world!"); + AP->SetStrArray(3, vs); + + TCollection_AsciiString as = AP->Save(); + cout << "AS = " << as << endl; + AP->Load(as); + + cout << "Restored string with id = 1 is: " << AP->GetString(1) << endl; + cout << "Restored int with id = 2 is: " << AP->GetInt(2) << endl; + cout << "Restored real with id = 3 is: " << AP->GetReal(3) << endl; + cout << "Restored bool with id = 1 is: " << AP->GetBool(1) << endl; + + v2 = AP->GetRealArray(2); + cout << "Restored real array with id = 2 is: "; + for(int i = 0; iGetIntArray(2); + cout << "Restored int array with id = 2 is: "; + for(int i = 0; iGetStrArray(3); + cout << "Restored string array with id = 2 is: "; + for(int i = 0; iRemoveID(1, PT_INTEGER); + cout << "IsSet with id = 1, type = PT_INTEGER : " << AP->IsSet(1, PT_INTEGER) << endl; + cout << "Check RemoveID is done" << endl; + + cout << "Check AttributeParameter : done" << endl; cout << "Test finished " << endl; return 0; -- 2.39.2