From: srn Date: Mon, 4 Apr 2005 06:57:25 +0000 (+0000) Subject: Make most of attribute have method's names coinciding with that in IDL X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8670caf657be36b8e5392fed67ceb1d104147409;p=modules%2Fkernel.git Make most of attribute have method's names coinciding with that in IDL --- diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx index 403d1ee67..ee3950094 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx @@ -27,15 +27,15 @@ Handle(SALOMEDSImpl_AttributeComment) SALOMEDSImpl_AttributeComment::Set (const L.AddAttribute(A); } - A->Set(Val); + A->SetValue(Val); return A; } //======================================================================= -//function : Set +//function : SetValue //purpose : //======================================================================= -void SALOMEDSImpl_AttributeComment::Set (const TCollection_ExtendedString& S) +void SALOMEDSImpl_AttributeComment::SetValue (const TCollection_ExtendedString& S) { CheckLocked(); @@ -68,7 +68,7 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributeComment::NewEmpty () const //======================================================================= void SALOMEDSImpl_AttributeComment::Restore(const Handle(TDF_Attribute)& with) { - myString = Handle(SALOMEDSImpl_AttributeComment)::DownCast (with)->Get (); + myString = Handle(SALOMEDSImpl_AttributeComment)::DownCast (with)->Value (); } //======================================================================= @@ -79,5 +79,5 @@ void SALOMEDSImpl_AttributeComment::Restore(const Handle(TDF_Attribute)& with) void SALOMEDSImpl_AttributeComment::Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const { - Handle(SALOMEDSImpl_AttributeComment)::DownCast (into)->Set(myString); + Handle(SALOMEDSImpl_AttributeComment)::DownCast (into)->SetValue(myString); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.hxx index ba6c7a6a6..86c5aee80 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.hxx @@ -31,8 +31,8 @@ Standard_EXPORT static const Standard_GUID& GetID() ; Standard_EXPORT SALOMEDSImpl_AttributeComment() :SALOMEDSImpl_GenericAttribute("AttributeComment") {} Standard_EXPORT static Handle(SALOMEDSImpl_AttributeComment) Set(const TDF_Label& L, const TCollection_ExtendedString& Val); -Standard_EXPORT void Set (const TCollection_ExtendedString& S); -Standard_EXPORT TCollection_ExtendedString Get() const { return myString; } +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; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.cxx index 5e059ecfd..31a94b518 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.cxx @@ -33,7 +33,7 @@ Handle(SALOMEDSImpl_AttributeDrawable) SALOMEDSImpl_AttributeDrawable::Set (cons L.AddAttribute(A); } - A->Set (value); + A->SetDrawable (value); return A; } @@ -49,10 +49,10 @@ SALOMEDSImpl_AttributeDrawable::SALOMEDSImpl_AttributeDrawable() } //======================================================================= -//function : Set +//function : SetDrawable //purpose : //======================================================================= -void SALOMEDSImpl_AttributeDrawable::Set(const Standard_Integer theValue) +void SALOMEDSImpl_AttributeDrawable::SetDrawable(const Standard_Integer theValue) { CheckLocked(); @@ -87,7 +87,7 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributeDrawable::NewEmpty () const void SALOMEDSImpl_AttributeDrawable::Restore(const Handle(TDF_Attribute)& with) { - myValue = Handle(SALOMEDSImpl_AttributeDrawable)::DownCast (with)->Get (); + myValue = Handle(SALOMEDSImpl_AttributeDrawable)::DownCast (with)->IsDrawable (); } //======================================================================= @@ -98,6 +98,6 @@ void SALOMEDSImpl_AttributeDrawable::Restore(const Handle(TDF_Attribute)& with) void SALOMEDSImpl_AttributeDrawable::Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const { - Handle(SALOMEDSImpl_AttributeDrawable)::DownCast (into)->Set (myValue); + Handle(SALOMEDSImpl_AttributeDrawable)::DownCast (into)->SetDrawable (myValue); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.hxx index cec1f2fc4..4ae08511c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.hxx @@ -31,8 +31,8 @@ Standard_EXPORT virtual void Load(const TCollection_AsciiString& theValue) { (t Standard_EXPORT static const Standard_GUID& GetID() ; Standard_EXPORT static Handle_SALOMEDSImpl_AttributeDrawable Set(const TDF_Label& label,const Standard_Integer value) ; -Standard_EXPORT void Set(const Standard_Integer theValue); -Standard_EXPORT Standard_Integer Get() const { return myValue; } +Standard_EXPORT void SetDrawable(const Standard_Integer theValue); +Standard_EXPORT Standard_Integer IsDrawable() const { return myValue; } Standard_EXPORT SALOMEDSImpl_AttributeDrawable(); Standard_EXPORT const Standard_GUID& ID() const; Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) ; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.cxx index 82fc82b79..0216a575c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.cxx @@ -33,7 +33,7 @@ Handle(SALOMEDSImpl_AttributeExpandable) SALOMEDSImpl_AttributeExpandable::Set ( L.AddAttribute(A); } - A->Set(value); + A->SetExpandable(value); return A; } @@ -49,10 +49,10 @@ SALOMEDSImpl_AttributeExpandable::SALOMEDSImpl_AttributeExpandable() } //======================================================================= -//function : Set +//function : SetExpandable //purpose : //======================================================================= -void SALOMEDSImpl_AttributeExpandable::Set(const Standard_Integer theValue) +void SALOMEDSImpl_AttributeExpandable::SetExpandable(const Standard_Integer theValue) { CheckLocked(); @@ -86,7 +86,7 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributeExpandable::NewEmpty () const void SALOMEDSImpl_AttributeExpandable::Restore(const Handle(TDF_Attribute)& with) { - myValue = Handle(SALOMEDSImpl_AttributeExpandable)::DownCast (with)->Get (); + myValue = Handle(SALOMEDSImpl_AttributeExpandable)::DownCast (with)->IsExpandable (); } //======================================================================= @@ -97,6 +97,6 @@ void SALOMEDSImpl_AttributeExpandable::Restore(const Handle(TDF_Attribute)& with void SALOMEDSImpl_AttributeExpandable::Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const { - Handle(SALOMEDSImpl_AttributeExpandable)::DownCast (into)->Set (myValue); + Handle(SALOMEDSImpl_AttributeExpandable)::DownCast (into)->SetExpandable (myValue); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.hxx index 4f6a360f0..a31cf02d5 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.hxx @@ -26,14 +26,14 @@ Standard_Integer myValue; public: -Standard_EXPORT virtual TCollection_AsciiString Save() { return (Get() == 0)?(char*)"0":(char*)"1"; } +Standard_EXPORT virtual TCollection_AsciiString Save() { return (myValue == 0)?(char*)"0":(char*)"1"; } Standard_EXPORT virtual void Load(const TCollection_AsciiString& theValue) { (theValue == "0")?myValue=0:myValue=1; } Standard_EXPORT static const Standard_GUID& GetID() ; Standard_EXPORT static Handle_SALOMEDSImpl_AttributeExpandable Set(const TDF_Label& label,const Standard_Integer value) ; Standard_EXPORT SALOMEDSImpl_AttributeExpandable(); -Standard_EXPORT void Set(const Standard_Integer value); -Standard_EXPORT int Get() const { return myValue; } +Standard_EXPORT void SetExpandable(const Standard_Integer value); +Standard_EXPORT int IsExpandable() const { return myValue; } Standard_EXPORT const Standard_GUID& ID() const; Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) ; Standard_EXPORT Handle_TDF_Attribute NewEmpty() const; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.cxx index 5b4a1dd72..29e743acb 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.cxx @@ -33,7 +33,7 @@ SALOMEDSImpl_AttributeExternalFileDef::Set (const TDF_Label& L, const TCollectio L.AddAttribute(A); } - A->Set (S); + A->SetValue (S); return A; } @@ -48,10 +48,10 @@ SALOMEDSImpl_AttributeExternalFileDef::SALOMEDSImpl_AttributeExternalFileDef() } //======================================================================= -//function : Set +//function : SetValue //purpose : //======================================================================= -void SALOMEDSImpl_AttributeExternalFileDef::Set (const TCollection_ExtendedString& S) +void SALOMEDSImpl_AttributeExternalFileDef::SetValue (const TCollection_ExtendedString& S) { CheckLocked(); @@ -86,7 +86,7 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributeExternalFileDef::NewEmpty () const //======================================================================= void SALOMEDSImpl_AttributeExternalFileDef::Restore(const Handle(TDF_Attribute)& with) { - myString = Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast (with)->Get (); + myString = Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast (with)->Value (); } //======================================================================= @@ -97,6 +97,6 @@ void SALOMEDSImpl_AttributeExternalFileDef::Paste (const Handle(TDF_Attribute)& const Handle(TDF_RelocationTable)& RT) const { Handle(SALOMEDSImpl_AttributeExternalFileDef) anAttr = Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast(into); - anAttr->Set(myString); + anAttr->SetValue(myString); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.hxx index 954fc5428..1d1551b57 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.hxx @@ -26,8 +26,8 @@ Standard_EXPORT static const Standard_GUID& GetID() ; Standard_EXPORT static Handle_SALOMEDSImpl_AttributeExternalFileDef Set(const TDF_Label& label, const TCollection_ExtendedString& Name); Standard_EXPORT SALOMEDSImpl_AttributeExternalFileDef(); -Standard_EXPORT void Set(const TCollection_ExtendedString& value); -Standard_EXPORT TCollection_ExtendedString Get() const { return myString; } +Standard_EXPORT void SetValue(const TCollection_ExtendedString& value); +Standard_EXPORT TCollection_ExtendedString Value() const { return myString; } Standard_EXPORT const Standard_GUID& ID() const; Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) ; Standard_EXPORT Handle_TDF_Attribute NewEmpty() const; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx index 0a0cbd72c..d880e387e 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx @@ -37,7 +37,7 @@ Handle(SALOMEDSImpl_AttributeFileType) SALOMEDSImpl_AttributeFileType::Set (cons L.AddAttribute(A); } - A->Set (S); + A->SetValue (S); return A; } @@ -52,10 +52,10 @@ SALOMEDSImpl_AttributeFileType::SALOMEDSImpl_AttributeFileType() } //======================================================================= -//function : Set +//function : SetValue //purpose : //======================================================================= -void SALOMEDSImpl_AttributeFileType::Set (const TCollection_ExtendedString& S) +void SALOMEDSImpl_AttributeFileType::SetValue (const TCollection_ExtendedString& S) { CheckLocked(); @@ -91,7 +91,7 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributeFileType::NewEmpty () const void SALOMEDSImpl_AttributeFileType::Restore(const Handle(TDF_Attribute)& with) { - myString = Handle(SALOMEDSImpl_AttributeFileType)::DownCast (with)->Get (); + myString = Handle(SALOMEDSImpl_AttributeFileType)::DownCast (with)->Value (); } //======================================================================= @@ -102,6 +102,6 @@ void SALOMEDSImpl_AttributeFileType::Restore(const Handle(TDF_Attribute)& with) void SALOMEDSImpl_AttributeFileType::Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const { - Handle(SALOMEDSImpl_AttributeFileType)::DownCast (into)->Set (myString); + Handle(SALOMEDSImpl_AttributeFileType)::DownCast (into)->SetValue (myString); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.hxx index 395e785f5..d56204fa0 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.hxx @@ -26,8 +26,8 @@ Standard_EXPORT static const Standard_GUID& GetID() ; Standard_EXPORT static Handle_SALOMEDSImpl_AttributeFileType Set(const TDF_Label& label, const TCollection_ExtendedString& Name) ; Standard_EXPORT SALOMEDSImpl_AttributeFileType(); -Standard_EXPORT void Set(const TCollection_ExtendedString& value); -Standard_EXPORT TCollection_ExtendedString Get() const { return myString; } +Standard_EXPORT void SetValue(const TCollection_ExtendedString& value); +Standard_EXPORT TCollection_ExtendedString Value() const { return myString; } Standard_EXPORT const Standard_GUID& ID() const; Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) ; Standard_EXPORT Handle_TDF_Attribute NewEmpty() const; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx index e3db67af1..78988c0b8 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx @@ -27,15 +27,15 @@ Handle(SALOMEDSImpl_AttributeInteger) SALOMEDSImpl_AttributeInteger::Set (const L.AddAttribute(A); } - A->Set(Val); + A->SetValue(Val); return A; } //======================================================================= -//function : Set +//function : SetValue //purpose : //======================================================================= -void SALOMEDSImpl_AttributeInteger::Set(const Standard_Integer v) +void SALOMEDSImpl_AttributeInteger::SetValue(const Standard_Integer v) { if(myValue == v) return; @@ -65,7 +65,7 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributeInteger::NewEmpty () const //======================================================================= void SALOMEDSImpl_AttributeInteger::Restore(const Handle(TDF_Attribute)& With) { - myValue = Handle(SALOMEDSImpl_AttributeInteger)::DownCast (With)->Get(); + myValue = Handle(SALOMEDSImpl_AttributeInteger)::DownCast (With)->Value(); } //======================================================================= @@ -75,5 +75,5 @@ void SALOMEDSImpl_AttributeInteger::Restore(const Handle(TDF_Attribute)& With) void SALOMEDSImpl_AttributeInteger::Paste (const Handle(TDF_Attribute)& Into, const Handle(TDF_RelocationTable)& RT) const { - Handle(SALOMEDSImpl_AttributeInteger)::DownCast(Into)->Set(myValue); + Handle(SALOMEDSImpl_AttributeInteger)::DownCast(Into)->SetValue(myValue); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.hxx index 4f31946ac..c9113ba2f 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.hxx @@ -29,8 +29,8 @@ Standard_EXPORT static const Standard_GUID& GetID() ; Standard_EXPORT SALOMEDSImpl_AttributeInteger():SALOMEDSImpl_GenericAttribute("AttributeInteger") {} Standard_EXPORT static Handle(SALOMEDSImpl_AttributeInteger) Set (const TDF_Label& L, Standard_Integer Val); -Standard_EXPORT void Set(const Standard_Integer theVal); -Standard_EXPORT Standard_Integer Get() const { return myValue; } +Standard_EXPORT void SetValue(const Standard_Integer theVal); +Standard_EXPORT Standard_Integer Value() const { return myValue; } Standard_EXPORT virtual TCollection_AsciiString Save() { return TCollection_AsciiString(myValue); } Standard_EXPORT virtual void Load(const TCollection_AsciiString& theValue) { myValue = theValue.IntegerValue(); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx index 934f9d3df..1aa7c3717 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx @@ -27,15 +27,15 @@ Handle(SALOMEDSImpl_AttributeName) SALOMEDSImpl_AttributeName::Set (const TDF_La L.AddAttribute(A); } - A->Set(Val); + A->SetValue(Val); return A; } //======================================================================= -//function : Set +//function : SetValue //purpose : //======================================================================= -void SALOMEDSImpl_AttributeName::Set (const TCollection_ExtendedString& S) +void SALOMEDSImpl_AttributeName::SetValue (const TCollection_ExtendedString& S) { CheckLocked(); @@ -68,7 +68,7 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributeName::NewEmpty () const //======================================================================= void SALOMEDSImpl_AttributeName::Restore(const Handle(TDF_Attribute)& with) { - myString = Handle(SALOMEDSImpl_AttributeName)::DownCast (with)->Get (); + myString = Handle(SALOMEDSImpl_AttributeName)::DownCast (with)->Value (); } //======================================================================= @@ -79,5 +79,5 @@ void SALOMEDSImpl_AttributeName::Restore(const Handle(TDF_Attribute)& with) void SALOMEDSImpl_AttributeName::Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const { - Handle(SALOMEDSImpl_AttributeName)::DownCast (into)->Set(myString); + Handle(SALOMEDSImpl_AttributeName)::DownCast (into)->SetValue(myString); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.hxx index ff0889100..299db5f92 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.hxx @@ -32,8 +32,8 @@ Standard_EXPORT static const Standard_GUID& GetID() ; Standard_EXPORT SALOMEDSImpl_AttributeName():SALOMEDSImpl_GenericAttribute("AttributeName") {} Standard_EXPORT static Handle(SALOMEDSImpl_AttributeName) Set (const TDF_Label& L, const TCollection_ExtendedString& Val); -Standard_EXPORT void Set(const TCollection_ExtendedString& theVal); -Standard_EXPORT TCollection_ExtendedString Get() const { return myString; } +Standard_EXPORT void SetValue(const TCollection_ExtendedString& theVal); +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; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.cxx index 846285041..a91afbbe2 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.cxx @@ -36,7 +36,7 @@ Handle(SALOMEDSImpl_AttributeOpened) SALOMEDSImpl_AttributeOpened::Set (const TD L.AddAttribute(A); } - A->Set (value); + A->SetOpened (value); return A; } @@ -52,10 +52,10 @@ SALOMEDSImpl_AttributeOpened::SALOMEDSImpl_AttributeOpened() } //======================================================================= -//function : Set +//function : SetOpened //purpose : //======================================================================= -void SALOMEDSImpl_AttributeOpened::Set(const Standard_Integer theValue) +void SALOMEDSImpl_AttributeOpened::SetOpened(const Standard_Integer theValue) { Backup(); @@ -87,7 +87,7 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributeOpened::NewEmpty () const void SALOMEDSImpl_AttributeOpened::Restore(const Handle(TDF_Attribute)& with) { - myValue = Handle(SALOMEDSImpl_AttributeOpened)::DownCast (with)->Get (); + myValue = Handle(SALOMEDSImpl_AttributeOpened)::DownCast (with)->IsOpened (); } //======================================================================= @@ -98,6 +98,6 @@ void SALOMEDSImpl_AttributeOpened::Restore(const Handle(TDF_Attribute)& with) void SALOMEDSImpl_AttributeOpened::Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const { - Handle(SALOMEDSImpl_AttributeOpened)::DownCast (into)->Set (myValue); + Handle(SALOMEDSImpl_AttributeOpened)::DownCast (into)->SetOpened (myValue); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.hxx index f5cb585a6..e72918267 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.hxx @@ -31,8 +31,8 @@ Standard_EXPORT virtual void Load(const TCollection_AsciiString& theValue) { (th Standard_EXPORT static const Standard_GUID& GetID() ; Standard_EXPORT static Handle_SALOMEDSImpl_AttributeOpened Set(const TDF_Label& label,const Standard_Integer value) ; Standard_EXPORT SALOMEDSImpl_AttributeOpened(); -Standard_EXPORT void Set(const Standard_Integer value); -Standard_EXPORT int Get() const { return myValue; } +Standard_EXPORT void SetOpened(const Standard_Integer value); +Standard_EXPORT int IsOpened() const { return myValue; } Standard_EXPORT const Standard_GUID& ID() const; Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) ; Standard_EXPORT Handle_TDF_Attribute NewEmpty() const; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx index e07d6d300..5b49e9876 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx @@ -36,7 +36,7 @@ Handle(SALOMEDSImpl_AttributePersistentRef) SALOMEDSImpl_AttributePersistentRef: L.AddAttribute(A); } - A->Set (S); + A->SetValue (S); return A; } @@ -59,10 +59,10 @@ const Standard_GUID& SALOMEDSImpl_AttributePersistentRef::ID () const { return G //======================================================================= -//function : Set +//function : SetValue //purpose : //======================================================================= -void SALOMEDSImpl_AttributePersistentRef::Set (const TCollection_ExtendedString& S) +void SALOMEDSImpl_AttributePersistentRef::SetValue (const TCollection_ExtendedString& S) { CheckLocked(); @@ -90,7 +90,7 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributePersistentRef::NewEmpty () const void SALOMEDSImpl_AttributePersistentRef::Restore(const Handle(TDF_Attribute)& with) { - myString = Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast (with)->Get (); + myString = Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast (with)->Value (); } //======================================================================= @@ -101,6 +101,6 @@ void SALOMEDSImpl_AttributePersistentRef::Restore(const Handle(TDF_Attribute)& w void SALOMEDSImpl_AttributePersistentRef::Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const { - Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast (into)->Set(myString); + Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast (into)->SetValue(myString); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.hxx index 406349e32..f660a28fd 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.hxx @@ -34,8 +34,8 @@ Standard_EXPORT static Handle_SALOMEDSImpl_AttributePersistentRef Set(const TDF const TCollection_ExtendedString& string) ; Standard_EXPORT SALOMEDSImpl_AttributePersistentRef(); Standard_EXPORT const Standard_GUID& ID() const; -Standard_EXPORT void Set(const TCollection_ExtendedString& value); -Standard_EXPORT TCollection_ExtendedString Get() const { return myString; } +Standard_EXPORT void SetValue(const TCollection_ExtendedString& value); +Standard_EXPORT TCollection_ExtendedString Value() const { return myString; } 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; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx index 013c95168..072341ba2 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx @@ -37,7 +37,7 @@ Handle(SALOMEDSImpl_AttributePixMap) SALOMEDSImpl_AttributePixMap::Set (const TD L.AddAttribute(A); } - A->Set (S); + A->SetPixMap (S); return A; } @@ -53,10 +53,10 @@ SALOMEDSImpl_AttributePixMap::SALOMEDSImpl_AttributePixMap() } //======================================================================= -//function : Set +//function : SetPixMap //purpose : //======================================================================= -void SALOMEDSImpl_AttributePixMap::Set (const TCollection_ExtendedString& S) +void SALOMEDSImpl_AttributePixMap::SetPixMap (const TCollection_ExtendedString& S) { CheckLocked(); @@ -92,7 +92,7 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributePixMap::NewEmpty () const void SALOMEDSImpl_AttributePixMap::Restore(const Handle(TDF_Attribute)& with) { - myString = Handle(SALOMEDSImpl_AttributePixMap)::DownCast (with)->Get (); + myString = Handle(SALOMEDSImpl_AttributePixMap)::DownCast (with)->GetPixMap (); } //======================================================================= @@ -103,6 +103,6 @@ void SALOMEDSImpl_AttributePixMap::Restore(const Handle(TDF_Attribute)& with) void SALOMEDSImpl_AttributePixMap::Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const { - Handle(SALOMEDSImpl_AttributePixMap)::DownCast (into)->Set (myString); + Handle(SALOMEDSImpl_AttributePixMap)::DownCast (into)->SetPixMap (myString); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.hxx index 6ccf4b3c9..521c79f45 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.hxx @@ -36,8 +36,9 @@ Standard_EXPORT static Handle_SALOMEDSImpl_AttributePixMap Set(const TDF_Label& const TCollection_ExtendedString& string) ; Standard_EXPORT SALOMEDSImpl_AttributePixMap(); Standard_EXPORT const Standard_GUID& ID() const; -Standard_EXPORT void Set(const TCollection_ExtendedString& value); -Standard_EXPORT TCollection_ExtendedString Get() const { return myString; } +Standard_EXPORT void SetPixMap(const TCollection_ExtendedString& value); +Standard_EXPORT TCollection_ExtendedString GetPixMap() const { return myString; } +Standard_EXPORT Standard_Boolean HasPixMap() const { return (myString != "None"); } 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; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.cxx index daedd7619..2d1e16f27 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.cxx @@ -26,15 +26,15 @@ Handle(SALOMEDSImpl_AttributeReal) SALOMEDSImpl_AttributeReal::Set (const TDF_La L.AddAttribute(A); } - A->Set(Val); + A->SetValue(Val); return A; } //======================================================================= -//function : Set +//function : SetValue //purpose : //======================================================================= -void SALOMEDSImpl_AttributeReal::Set(const Standard_Real v) +void SALOMEDSImpl_AttributeReal::SetValue(const Standard_Real v) { CheckLocked(); @@ -68,7 +68,7 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributeReal::NewEmpty () const //======================================================================= void SALOMEDSImpl_AttributeReal::Restore(const Handle(TDF_Attribute)& with) { - myValue = Handle(SALOMEDSImpl_AttributeReal)::DownCast (with)->Get (); + myValue = Handle(SALOMEDSImpl_AttributeReal)::DownCast (with)->Value (); } //======================================================================= @@ -78,5 +78,5 @@ void SALOMEDSImpl_AttributeReal::Restore(const Handle(TDF_Attribute)& with) void SALOMEDSImpl_AttributeReal::Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const { - Handle(SALOMEDSImpl_AttributeReal)::DownCast (into)->Set(myValue); + Handle(SALOMEDSImpl_AttributeReal)::DownCast (into)->SetValue(myValue); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.hxx index 9e8fd9993..de47ad445 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.hxx @@ -29,8 +29,8 @@ Standard_EXPORT Standard_EXPORT static const Standard_GUID& GetID() ; Standard_EXPORT SALOMEDSImpl_AttributeReal():SALOMEDSImpl_GenericAttribute("AttributeReal") {} Standard_EXPORT static Handle(SALOMEDSImpl_AttributeReal) Set (const TDF_Label& L, const Standard_Real Val); -Standard_EXPORT void Set(const Standard_Real theVal); -Standard_EXPORT Standard_Real Get() const { return myValue; } +Standard_EXPORT void SetValue(const Standard_Real theVal); +Standard_EXPORT Standard_Real Value() const { return myValue; } Standard_EXPORT virtual TCollection_AsciiString Save() { return TCollection_AsciiString(myValue); } Standard_EXPORT virtual void Load(const TCollection_AsciiString& theValue) { myValue = theValue.RealValue(); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.cxx index 563c9a8bc..9fc8088cf 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.cxx @@ -36,7 +36,7 @@ Handle(SALOMEDSImpl_AttributeSelectable) SALOMEDSImpl_AttributeSelectable::Set ( L.AddAttribute(A); } - A->Set (value); + A->SetSelectable (value); return A; } @@ -52,10 +52,10 @@ SALOMEDSImpl_AttributeSelectable::SALOMEDSImpl_AttributeSelectable() } //======================================================================= -//function : Set +//function : SetSelectable //purpose : //======================================================================= -void SALOMEDSImpl_AttributeSelectable::Set(const Standard_Integer theValue) +void SALOMEDSImpl_AttributeSelectable::SetSelectable(const Standard_Integer theValue) { Backup(); @@ -87,7 +87,7 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributeSelectable::NewEmpty () const void SALOMEDSImpl_AttributeSelectable::Restore(const Handle(TDF_Attribute)& with) { - myValue = Handle(SALOMEDSImpl_AttributeSelectable)::DownCast (with)->Get (); + myValue = Handle(SALOMEDSImpl_AttributeSelectable)::DownCast (with)->IsSelectable (); } //======================================================================= @@ -98,6 +98,6 @@ void SALOMEDSImpl_AttributeSelectable::Restore(const Handle(TDF_Attribute)& with void SALOMEDSImpl_AttributeSelectable::Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const { - Handle(SALOMEDSImpl_AttributeSelectable)::DownCast (into)->Set (myValue); + Handle(SALOMEDSImpl_AttributeSelectable)::DownCast (into)->SetSelectable (myValue); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.hxx index 3897dd08d..5f6ee4fb2 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.hxx @@ -33,8 +33,8 @@ Standard_EXPORT virtual void Load(const TCollection_AsciiString& theValue) { (th Standard_EXPORT static const Standard_GUID& GetID() ; Standard_EXPORT static Handle_SALOMEDSImpl_AttributeSelectable Set(const TDF_Label& label,const Standard_Integer value) ; Standard_EXPORT SALOMEDSImpl_AttributeSelectable(); -Standard_EXPORT void Set(const Standard_Integer value); -Standard_EXPORT Standard_Integer Get() const { return myValue; } +Standard_EXPORT void SetSelectable(const Standard_Integer value); +Standard_EXPORT Standard_Integer IsSelectable() const { return myValue; } Standard_EXPORT const Standard_GUID& ID() const; Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) ; Standard_EXPORT Handle_TDF_Attribute NewEmpty() const; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx index 284e91e5f..6723c2100 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx @@ -13,6 +13,26 @@ using namespace std; IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeTableOfInteger, SALOMEDSImpl_GenericAttribute ) IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeTableOfInteger, SALOMEDSImpl_GenericAttribute ) +#define SEPARATOR '\1' + +static TCollection_ExtendedString getUnit(TCollection_ExtendedString theString) +{ + TCollection_ExtendedString aString(theString); + int aPos = aString.Search(SEPARATOR); + if(aPos <= 0 || aPos == aString.Length() ) return TCollection_ExtendedString(); + return aString.Split(aPos); +} + +static TCollection_ExtendedString getTitle(TCollection_ExtendedString theString) +{ + TCollection_ExtendedString aString(theString); + int aPos = aString.Search(SEPARATOR); + if(aPos < 1) return aString; + if(aPos == 1) return TCollection_ExtendedString(); + aString.Split(aPos-1); + return aString; +} + const Standard_GUID& SALOMEDSImpl_AttributeTableOfInteger::GetID() { static Standard_GUID SALOMEDSImpl_AttributeTableOfIntegerID ("128371A0-8F52-11d6-A8A3-0001021E8C7F"); @@ -111,15 +131,70 @@ Handle(TColStd_HSequenceOfInteger) SALOMEDSImpl_AttributeTableOfInteger::GetRowD } void SALOMEDSImpl_AttributeTableOfInteger::SetRowTitle(const Standard_Integer theRow, - const TCollection_ExtendedString& theTitle) + const TCollection_ExtendedString& theTitle) { CheckLocked(); Backup(); - myRows->SetValue(theRow,theTitle); + TCollection_ExtendedString aTitle(theTitle), aUnit = GetRowUnit(theRow); + if(aUnit.Length()>0) { + aTitle += SEPARATOR; + aTitle += aUnit; + } + myRows->SetValue(theRow, aTitle); +} + +void SALOMEDSImpl_AttributeTableOfInteger::SetRowUnit(const Standard_Integer theRow, + const TCollection_ExtendedString& theUnit) +{ + CheckLocked(); + Backup(); + TCollection_ExtendedString aTitle = GetRowTitle(theRow); + aTitle += SEPARATOR; + aTitle += theUnit; + + myRows->SetValue(theRow, aTitle); +} + +void SALOMEDSImpl_AttributeTableOfInteger::SetRowUnits(const Handle(TColStd_HSequenceOfExtendedString)& theUnits) +{ + if (theUnits->Length() != GetNbRows()) Standard_Failure::Raise("Invalid number of rows"); + int aLength = theUnits->Length(), i; + for(i = 1; i <= aLength; i++) SetRowUnit(i, theUnits->Value(i)); +} + +Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfInteger::GetRowUnits() +{ + Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString; + int aLength = myRows->Length(), i; + for(i=1; i<=aLength; i++) aSeq->Append(getUnit(myRows->Value(i))); + return aSeq; +} + +void SALOMEDSImpl_AttributeTableOfInteger::SetRowTitles(const Handle(TColStd_HSequenceOfExtendedString)& theTitles) +{ + if (theTitles->Length() != GetNbRows()) Standard_Failure::Raise("Invalid number of rows"); + int aLength = theTitles->Length(), i; + for(i = 1; i <= aLength; i++) SetRowTitle(i, theTitles->Value(i)); } -TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfInteger::GetRowTitle(const Standard_Integer theRow) const { - return myRows->Value(theRow); +Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfInteger::GetRowTitles() +{ + Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString; + int aLength = myRows->Length(), i; + for(i=1; i<=aLength; i++) aSeq->Append(getTitle(myRows->Value(i))); + return aSeq; +} + + +TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfInteger::GetRowTitle(const Standard_Integer theRow) const +{ + return getTitle(myRows->Value(theRow)); +} + + +TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfInteger::GetRowUnit(const Standard_Integer theRow) const +{ + return getUnit(myRows->Value(theRow)); } @@ -177,6 +252,20 @@ TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfInteger::GetColumnTitle( return myCols->Value(theColumn); } +void SALOMEDSImpl_AttributeTableOfInteger::SetColumnTitles(const Handle(TColStd_HSequenceOfExtendedString)& theTitles) +{ + if (theTitles->Length() != myNbColumns) Standard_Failure::Raise("Invalid number of columns"); + int aLength = theTitles->Length(), i; + for(i = 1; i <= aLength; i++) myCols->SetValue(i, theTitles->Value(i)); +} + +Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfInteger::GetColumnTitles() +{ + Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString; + int aLength = myCols->Length(), i; + for(i=1; i<=aLength; i++) aSeq->Append(myCols->Value(i)); + return aSeq; +} Standard_Integer SALOMEDSImpl_AttributeTableOfInteger::GetNbRows() const { @@ -209,6 +298,8 @@ void SALOMEDSImpl_AttributeTableOfInteger::PutValue(const Standard_Integer theVa Standard_Boolean SALOMEDSImpl_AttributeTableOfInteger::HasValue(const Standard_Integer theRow, const Standard_Integer theColumn) { + if(theRow > myNbRows || theRow < 1) return Standard_False; + if(theColumn > myNbColumns || theColumn < 1) return Standard_False; Standard_Integer anIndex = (theRow-1)*myNbColumns + theColumn; return myTable.IsBound(anIndex); } @@ -216,6 +307,9 @@ Standard_Boolean SALOMEDSImpl_AttributeTableOfInteger::HasValue(const Standard_I Standard_Integer SALOMEDSImpl_AttributeTableOfInteger::GetValue(const Standard_Integer theRow, const Standard_Integer theColumn) { + if(theRow > myNbRows || theRow < 1) Standard_Failure::Raise("Invalid cell index"); + if(theColumn > myNbColumns || theColumn < 1) Standard_Failure::Raise("Invalid cell index"); + Standard_Integer anIndex = (theRow-1)*myNbColumns + theColumn; if(myTable.IsBound(anIndex)) return myTable.Find(anIndex); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.hxx index c2957af96..d1c1d402f 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.hxx @@ -46,11 +46,19 @@ Standard_EXPORT TCollection_ExtendedString GetTitle() const; Standard_EXPORT void SetRowData(const Standard_Integer theRow,const Handle(TColStd_HSequenceOfInteger)& theData) ; Standard_EXPORT Handle_TColStd_HSequenceOfInteger GetRowData(const Standard_Integer theRow) ; Standard_EXPORT void SetRowTitle(const Standard_Integer theRow,const TCollection_ExtendedString& theTitle) ; +Standard_EXPORT void SetRowUnit(const Standard_Integer theRow,const TCollection_ExtendedString& theUnit) ; +Standard_EXPORT TCollection_ExtendedString GetRowUnit(const Standard_Integer theRow) const; +Standard_EXPORT void SetRowUnits(const Handle(TColStd_HSequenceOfExtendedString)& theUnits) ; +Standard_EXPORT Handle(TColStd_HSequenceOfExtendedString) GetRowUnits(); +Standard_EXPORT void SetRowTitles(const Handle(TColStd_HSequenceOfExtendedString)& theTitles) ; +Standard_EXPORT Handle(TColStd_HSequenceOfExtendedString) GetRowTitles(); Standard_EXPORT TCollection_ExtendedString GetRowTitle(const Standard_Integer theRow) const; Standard_EXPORT void SetColumnData(const Standard_Integer theColumn,const Handle(TColStd_HSequenceOfInteger)& theData) ; Standard_EXPORT Handle_TColStd_HSequenceOfInteger GetColumnData(const Standard_Integer theColumn) ; Standard_EXPORT void SetColumnTitle(const Standard_Integer theColumn,const TCollection_ExtendedString& theTitle) ; Standard_EXPORT TCollection_ExtendedString GetColumnTitle(const Standard_Integer theColumn) const; +Standard_EXPORT void SetColumnTitles(const Handle(TColStd_HSequenceOfExtendedString)& theTitles); +Standard_EXPORT Handle(TColStd_HSequenceOfExtendedString) GetColumnTitles(); Standard_EXPORT Standard_Integer GetNbRows() const; Standard_EXPORT Standard_Integer GetNbColumns() const; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx index 9898d8fac..eb35801ec 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx @@ -13,6 +13,26 @@ using namespace std; IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeTableOfReal, SALOMEDSImpl_GenericAttribute ) IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeTableOfReal, SALOMEDSImpl_GenericAttribute ) +#define SEPARATOR '\1' + +static TCollection_ExtendedString getUnit(TCollection_ExtendedString theString) +{ + TCollection_ExtendedString aString(theString); + int aPos = aString.Search(SEPARATOR); + if(aPos <= 0 || aPos == aString.Length() ) return TCollection_ExtendedString(); + return aString.Split(aPos); +} + +static TCollection_ExtendedString getTitle(TCollection_ExtendedString theString) +{ + TCollection_ExtendedString aString(theString); + int aPos = aString.Search(SEPARATOR); + if(aPos < 1) return aString; + if(aPos == 1) return TCollection_ExtendedString(); + aString.Split(aPos-1); + return aString; +} + const Standard_GUID& SALOMEDSImpl_AttributeTableOfReal::GetID() { static Standard_GUID SALOMEDSImpl_AttributeTableOfRealID ("128371A1-8F52-11d6-A8A3-0001021E8C7F"); @@ -110,20 +130,74 @@ Handle(TColStd_HSequenceOfReal) SALOMEDSImpl_AttributeTableOfReal::GetRowData(co return aSeq; } + void SALOMEDSImpl_AttributeTableOfReal::SetRowTitle(const Standard_Integer theRow, - const TCollection_ExtendedString& theTitle) + const TCollection_ExtendedString& theTitle) { CheckLocked(); Backup(); - myRows->SetValue(theRow,theTitle); + TCollection_ExtendedString aTitle(theTitle), aUnit = GetRowUnit(theRow); + if(aUnit.Length()>0) { + aTitle += SEPARATOR; + aTitle += aUnit; + } + myRows->SetValue(theRow, aTitle); +} + +void SALOMEDSImpl_AttributeTableOfReal::SetRowUnit(const Standard_Integer theRow, + const TCollection_ExtendedString& theUnit) +{ + CheckLocked(); + Backup(); + TCollection_ExtendedString aTitle = GetRowTitle(theRow); + aTitle += SEPARATOR; + aTitle += theUnit; + + myRows->SetValue(theRow, aTitle); +} + +void SALOMEDSImpl_AttributeTableOfReal::SetRowUnits(const Handle(TColStd_HSequenceOfExtendedString)& theUnits) +{ + if (theUnits->Length() != GetNbRows()) Standard_Failure::Raise("Invalid number of rows"); + int aLength = theUnits->Length(), i; + for(i = 1; i <= aLength; i++) SetRowUnit(i, theUnits->Value(i)); +} + +Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfReal::GetRowUnits() +{ + Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString; + int aLength = myRows->Length(), i; + for(i=1; i<=aLength; i++) aSeq->Append(getUnit(myRows->Value(i))); + return aSeq; +} + +void SALOMEDSImpl_AttributeTableOfReal::SetRowTitles(const Handle(TColStd_HSequenceOfExtendedString)& theTitles) +{ + if (theTitles->Length() != GetNbRows()) Standard_Failure::Raise("Invalid number of rows"); + int aLength = theTitles->Length(), i; + for(i = 1; i <= aLength; i++) SetRowTitle(i, theTitles->Value(i)); } +Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfReal::GetRowTitles() +{ + Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString; + int aLength = myRows->Length(), i; + for(i=1; i<=aLength; i++) aSeq->Append(getTitle(myRows->Value(i))); + return aSeq; +} + + TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfReal::GetRowTitle(const Standard_Integer theRow) const { - return myRows->Value(theRow); + return getTitle(myRows->Value(theRow)); } +TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfReal::GetRowUnit(const Standard_Integer theRow) const +{ + return getUnit(myRows->Value(theRow)); +} + void SALOMEDSImpl_AttributeTableOfReal::SetColumnData(const Standard_Integer theColumn, const Handle(TColStd_HSequenceOfReal)& theData) { @@ -178,6 +252,20 @@ TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfReal::GetColumnTitle(con return myCols->Value(theColumn); } +void SALOMEDSImpl_AttributeTableOfReal::SetColumnTitles(const Handle(TColStd_HSequenceOfExtendedString)& theTitles) +{ + if (theTitles->Length() != myNbColumns) Standard_Failure::Raise("Invalid number of columns"); + int aLength = theTitles->Length(), i; + for(i = 1; i <= aLength; i++) myCols->SetValue(i, theTitles->Value(i)); +} + +Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfReal::GetColumnTitles() +{ + Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString; + int aLength = myCols->Length(), i; + for(i=1; i<=aLength; i++) aSeq->Append(myCols->Value(i)); + return aSeq; +} Standard_Integer SALOMEDSImpl_AttributeTableOfReal::GetNbRows() const { @@ -210,6 +298,8 @@ void SALOMEDSImpl_AttributeTableOfReal::PutValue(const Standard_Real theValue, Standard_Boolean SALOMEDSImpl_AttributeTableOfReal::HasValue(const Standard_Integer theRow, const Standard_Integer theColumn) { + if(theRow > myNbRows || theRow < 1) return Standard_False; + if(theColumn > myNbColumns || theColumn < 1) return Standard_False; Standard_Integer anIndex = (theRow-1)*myNbColumns + theColumn; return myTable.IsBound(anIndex); } @@ -217,6 +307,9 @@ Standard_Boolean SALOMEDSImpl_AttributeTableOfReal::HasValue(const Standard_Inte Standard_Real SALOMEDSImpl_AttributeTableOfReal::GetValue(const Standard_Integer theRow, const Standard_Integer theColumn) { + if(theRow > myNbRows || theRow < 1) Standard_Failure::Raise("Invalid cell index"); + if(theColumn > myNbColumns || theColumn < 1) Standard_Failure::Raise("Invalid cell index"); + Standard_Integer anIndex = (theRow-1)*myNbColumns + theColumn; if(myTable.IsBound(anIndex)) return myTable.Find(anIndex); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.hxx index a7fc4f196..221309287 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.hxx @@ -49,10 +49,18 @@ Standard_EXPORT TCollection_ExtendedString GetTitle() const; Standard_EXPORT void SetRowData(const Standard_Integer theRow,const Handle(TColStd_HSequenceOfReal)& theData) ; Standard_EXPORT Handle_TColStd_HSequenceOfReal GetRowData(const Standard_Integer theRow) ; Standard_EXPORT void SetRowTitle(const Standard_Integer theRow,const TCollection_ExtendedString& theTitle) ; +Standard_EXPORT void SetRowUnit(const Standard_Integer theRow,const TCollection_ExtendedString& theUnit) ; +Standard_EXPORT TCollection_ExtendedString GetRowUnit(const Standard_Integer theRow) const; +Standard_EXPORT void SetRowUnits(const Handle(TColStd_HSequenceOfExtendedString)& theUnits) ; +Standard_EXPORT Handle(TColStd_HSequenceOfExtendedString) GetRowUnits(); +Standard_EXPORT void SetRowTitles(const Handle(TColStd_HSequenceOfExtendedString)& theTitles) ; +Standard_EXPORT Handle(TColStd_HSequenceOfExtendedString) GetRowTitles(); Standard_EXPORT TCollection_ExtendedString GetRowTitle(const Standard_Integer theRow) const; Standard_EXPORT void SetColumnData(const Standard_Integer theColumn,const Handle(TColStd_HSequenceOfReal)& theData) ; Standard_EXPORT Handle_TColStd_HSequenceOfReal GetColumnData(const Standard_Integer theColumn) ; Standard_EXPORT void SetColumnTitle(const Standard_Integer theColumn,const TCollection_ExtendedString& theTitle) ; +Standard_EXPORT void SetColumnTitles(const Handle(TColStd_HSequenceOfExtendedString)& theTitles); +Standard_EXPORT Handle(TColStd_HSequenceOfExtendedString) GetColumnTitles(); Standard_EXPORT TCollection_ExtendedString GetColumnTitle(const Standard_Integer theColumn) const; Standard_EXPORT Standard_Integer GetNbRows() const; Standard_EXPORT Standard_Integer GetNbColumns() const; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx index 321a53e3b..64e49ce02 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx @@ -14,6 +14,26 @@ IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeTableOfString, SALOMEDSImpl_Ge typedef NCollection_DataMap::Iterator DataMapIterator; +#define SEPARATOR '\1' + +static TCollection_ExtendedString getUnit(TCollection_ExtendedString theString) +{ + TCollection_ExtendedString aString(theString); + int aPos = aString.Search(SEPARATOR); + if(aPos <= 0 || aPos == aString.Length() ) return TCollection_ExtendedString(); + return aString.Split(aPos); +} + +static TCollection_ExtendedString getTitle(TCollection_ExtendedString theString) +{ + TCollection_ExtendedString aString(theString); + int aPos = aString.Search(SEPARATOR); + if(aPos < 1) return aString; + if(aPos == 1) return TCollection_ExtendedString(); + aString.Split(aPos-1); + return aString; +} + const Standard_GUID& SALOMEDSImpl_AttributeTableOfString::GetID() { static Standard_GUID SALOMEDSImpl_AttributeTableOfStringID ("128371A4-8F52-11d6-A8A3-0001021E8C7F"); @@ -65,16 +85,71 @@ void SALOMEDSImpl_AttributeTableOfString::SetNbColumns(const Standard_Integer th } } -void SALOMEDSImpl_AttributeTableOfString::SetTitle(const TCollection_ExtendedString& theTitle) +void SALOMEDSImpl_AttributeTableOfString::SetRowTitle(const Standard_Integer theRow, + const TCollection_ExtendedString& theTitle) { CheckLocked(); Backup(); - myTitle = theTitle; + TCollection_ExtendedString aTitle(theTitle), aUnit = GetRowUnit(theRow); + if(aUnit.Length()>0) { + aTitle += SEPARATOR; + aTitle += aUnit; + } + myRows->SetValue(theRow, aTitle); } -TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfString::GetTitle() const +void SALOMEDSImpl_AttributeTableOfString::SetRowUnit(const Standard_Integer theRow, + const TCollection_ExtendedString& theUnit) { - return myTitle; + CheckLocked(); + Backup(); + TCollection_ExtendedString aTitle = GetRowTitle(theRow); + aTitle += SEPARATOR; + aTitle += theUnit; + + myRows->SetValue(theRow, aTitle); +} + +void SALOMEDSImpl_AttributeTableOfString::SetRowUnits(const Handle(TColStd_HSequenceOfExtendedString)& theUnits) +{ + if (theUnits->Length() != GetNbRows()) Standard_Failure::Raise("Invalid number of rows"); + int aLength = theUnits->Length(), i; + for(i = 1; i <= aLength; i++) SetRowUnit(i, theUnits->Value(i)); +} + +Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfString::GetRowUnits() +{ + Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString; + int aLength = myRows->Length(), i; + for(i=1; i<=aLength; i++) aSeq->Append(getUnit(myRows->Value(i))); + return aSeq; +} + +void SALOMEDSImpl_AttributeTableOfString::SetRowTitles(const Handle(TColStd_HSequenceOfExtendedString)& theTitles) +{ + if (theTitles->Length() != GetNbRows()) Standard_Failure::Raise("Invalid number of rows"); + int aLength = theTitles->Length(), i; + for(i = 1; i <= aLength; i++) SetRowTitle(i, theTitles->Value(i)); +} + +Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfString::GetRowTitles() +{ + Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString; + int aLength = myRows->Length(), i; + for(i=1; i<=aLength; i++) aSeq->Append(getTitle(myRows->Value(i))); + return aSeq; +} + + +TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfString::GetRowTitle(const Standard_Integer theRow) const +{ + return getTitle(myRows->Value(theRow)); +} + + +TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfString::GetRowUnit(const Standard_Integer theRow) const +{ + return getUnit(myRows->Value(theRow)); } void SALOMEDSImpl_AttributeTableOfString::SetRowData(const Standard_Integer theRow, @@ -97,6 +172,18 @@ void SALOMEDSImpl_AttributeTableOfString::SetRowData(const Standard_Integer theR if(theRow > myNbRows) myNbRows = theRow; } +void SALOMEDSImpl_AttributeTableOfString::SetTitle(const TCollection_ExtendedString& theTitle) +{ + CheckLocked(); + Backup(); + myTitle = theTitle; +} + +TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfString::GetTitle() const +{ + return myTitle; +} + Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfString::GetRowData(const Standard_Integer theRow) { Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString(); @@ -111,20 +198,6 @@ Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfString::G return aSeq; } -void SALOMEDSImpl_AttributeTableOfString::SetRowTitle(const Standard_Integer theRow, - const TCollection_ExtendedString& theTitle) -{ - CheckLocked(); - Backup(); - myRows->SetValue(theRow,theTitle); -} - -TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfString::GetRowTitle(const Standard_Integer theRow) const -{ - return myRows->Value(theRow); -} - - void SALOMEDSImpl_AttributeTableOfString::SetColumnData(const Standard_Integer theColumn, const Handle(TColStd_HSequenceOfExtendedString)& theData) { @@ -180,6 +253,22 @@ TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfString::GetColumnTitle(c } +void SALOMEDSImpl_AttributeTableOfString::SetColumnTitles(const Handle(TColStd_HSequenceOfExtendedString)& theTitles) +{ + if (theTitles->Length() != myNbColumns) Standard_Failure::Raise("Invalid number of columns"); + int aLength = theTitles->Length(), i; + for(i = 1; i <= aLength; i++) myCols->SetValue(i, theTitles->Value(i)); +} + +Handle(TColStd_HSequenceOfExtendedString) SALOMEDSImpl_AttributeTableOfString::GetColumnTitles() +{ + Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString; + int aLength = myCols->Length(), i; + for(i=1; i<=aLength; i++) aSeq->Append(myCols->Value(i)); + return aSeq; +} + + Standard_Integer SALOMEDSImpl_AttributeTableOfString::GetNbRows() const { return myNbRows; @@ -209,15 +298,21 @@ void SALOMEDSImpl_AttributeTableOfString::PutValue(const TCollection_ExtendedStr } Standard_Boolean SALOMEDSImpl_AttributeTableOfString::HasValue(const Standard_Integer theRow, - const Standard_Integer theColumn) + const Standard_Integer theColumn) { + if(theRow > myNbRows || theRow < 1) return Standard_False; + if(theColumn > myNbColumns || theColumn < 1) return Standard_False; + Standard_Integer anIndex = (theRow-1)*myNbColumns + theColumn; return myTable.IsBound(anIndex); } TCollection_ExtendedString SALOMEDSImpl_AttributeTableOfString::GetValue(const Standard_Integer theRow, - const Standard_Integer theColumn) + const Standard_Integer theColumn) { + if(theRow > myNbRows || theRow < 1) Standard_Failure::Raise("Invalid cell index"); + if(theColumn > myNbColumns || theColumn < 1) Standard_Failure::Raise("Invalid cell index"); + Standard_Integer anIndex = (theRow-1)*myNbColumns + theColumn; if(myTable.IsBound(anIndex)) return myTable.Find(anIndex); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.hxx index 5e1abfc33..3c73a89c0 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.hxx @@ -49,11 +49,19 @@ Standard_EXPORT TCollection_ExtendedString GetTitle() const; Standard_EXPORT void SetRowData(const Standard_Integer theRow,const Handle(TColStd_HSequenceOfExtendedString)& theData) ; Standard_EXPORT Handle_TColStd_HSequenceOfExtendedString GetRowData(const Standard_Integer theRow) ; Standard_EXPORT void SetRowTitle(const Standard_Integer theRow,const TCollection_ExtendedString& theTitle) ; +Standard_EXPORT void SetRowUnit(const Standard_Integer theRow,const TCollection_ExtendedString& theUnit) ; +Standard_EXPORT TCollection_ExtendedString GetRowUnit(const Standard_Integer theRow) const; +Standard_EXPORT void SetRowUnits(const Handle(TColStd_HSequenceOfExtendedString)& theUnits) ; +Standard_EXPORT Handle(TColStd_HSequenceOfExtendedString) GetRowUnits(); +Standard_EXPORT void SetRowTitles(const Handle(TColStd_HSequenceOfExtendedString)& theTitles) ; +Standard_EXPORT Handle(TColStd_HSequenceOfExtendedString) GetRowTitles(); Standard_EXPORT TCollection_ExtendedString GetRowTitle(const Standard_Integer theRow) const; Standard_EXPORT void SetColumnData(const Standard_Integer theColumn,const Handle(TColStd_HSequenceOfExtendedString)& theData) ; Standard_EXPORT Handle_TColStd_HSequenceOfExtendedString GetColumnData(const Standard_Integer theColumn) ; Standard_EXPORT void SetColumnTitle(const Standard_Integer theColumn,const TCollection_ExtendedString& theTitle) ; Standard_EXPORT TCollection_ExtendedString GetColumnTitle(const Standard_Integer theColumn) const; +Standard_EXPORT void SetColumnTitles(const Handle(TColStd_HSequenceOfExtendedString)& theTitles); +Standard_EXPORT Handle(TColStd_HSequenceOfExtendedString) GetColumnTitles(); Standard_EXPORT Standard_Integer GetNbRows() const; Standard_EXPORT Standard_Integer GetNbColumns() const; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx index 61447c6fb..4c341b533 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx @@ -5,6 +5,7 @@ using namespace std; #include "SALOMEDSImpl_AttributeTarget.hxx" #include "SALOMEDSImpl_AttributeReference.hxx" +#include "SALOMEDSImpl_Study.hxx" #include #include #include @@ -60,16 +61,17 @@ void SALOMEDSImpl_AttributeTarget::SetRelation(const TCollection_ExtendedString& } //======================================================================= -//function : Append +//function : Add //purpose : //======================================================================= -void SALOMEDSImpl_AttributeTarget::Append(TDF_Label& theReferencedObject) +void SALOMEDSImpl_AttributeTarget::Add(const Handle(SALOMEDSImpl_SObject)& theSO) { Backup(); + TDF_Label aRefLabel = theSO->GetLabel(); Handle(SALOMEDSImpl_AttributeReference) aReference; - if (theReferencedObject.FindAttribute(SALOMEDSImpl_AttributeReference::GetID(),aReference)) { + if (aRefLabel.FindAttribute(SALOMEDSImpl_AttributeReference::GetID(),aReference)) { TDF_ListIteratorOfAttributeList anIter(GetVariables()); - for(;anIter.More();anIter.Next()) if(anIter.Value()->Label() == theReferencedObject) return; //BugID: PAL6192 + for(;anIter.More();anIter.Next()) if(anIter.Value()->Label() == aRefLabel) return; //BugID: PAL6192 GetVariables().Append(aReference); } } @@ -78,25 +80,29 @@ void SALOMEDSImpl_AttributeTarget::Append(TDF_Label& theReferencedObject) //function : Get //purpose : //======================================================================= -void SALOMEDSImpl_AttributeTarget::Get(TDF_LabelList& theReferencedObjects) +Handle(TColStd_HSequenceOfTransient) SALOMEDSImpl_AttributeTarget::Get() { - theReferencedObjects.Clear(); + Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient; + TDF_ListIteratorOfAttributeList anIter(GetVariables()); for(;anIter.More();anIter.Next()) { - theReferencedObjects.Append(anIter.Value()->Label()); + const TDF_Label& aLabel = anIter.Value()->Label(); + aSeq->Append( SALOMEDSImpl_Study::SObject(aLabel)); } + return aSeq; } //======================================================================= //function : Remove //purpose : //======================================================================= -void SALOMEDSImpl_AttributeTarget::Remove(TDF_Label& theReferencedObject) +void SALOMEDSImpl_AttributeTarget::Remove(const Handle(SALOMEDSImpl_SObject)& theSO) { Backup(); + TDF_Label aRefLabel = theSO->GetLabel(); TDF_ListIteratorOfAttributeList anIter(GetVariables()); for(;anIter.More();anIter.Next()) { - if (anIter.Value()->Label() == theReferencedObject) { + if (anIter.Value()->Label() == aRefLabel) { GetVariables().Remove(anIter); return; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.hxx index 11b40a1be..0eb78bb0d 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.hxx @@ -11,7 +11,9 @@ #include #include #include +#include #include "SALOMEDSImpl_GenericAttribute.hxx" +#include "SALOMEDSImpl_SObject.hxx" class Standard_GUID; class Handle(TDF_Attribute); @@ -31,9 +33,9 @@ public: Standard_EXPORT static const Standard_GUID& GetID() ; Standard_EXPORT static Handle_SALOMEDSImpl_AttributeTarget Set(const TDF_Label& label) ; Standard_EXPORT SALOMEDSImpl_AttributeTarget(); -Standard_EXPORT void SALOMEDSImpl_AttributeTarget::Append(TDF_Label& theReferencedObject); -Standard_EXPORT void SALOMEDSImpl_AttributeTarget::Get(TDF_LabelList& theReferencedObjects); -Standard_EXPORT void SALOMEDSImpl_AttributeTarget::Remove(TDF_Label& theReferencedObject); +Standard_EXPORT void SALOMEDSImpl_AttributeTarget::Add(const Handle(SALOMEDSImpl_SObject)& theSO); +Standard_EXPORT Handle(TColStd_HSequenceOfTransient) SALOMEDSImpl_AttributeTarget::Get(); +Standard_EXPORT void SALOMEDSImpl_AttributeTarget::Remove(const Handle(SALOMEDSImpl_SObject)& theSO); Standard_EXPORT TCollection_ExtendedString GetRelation() { return myRelation; } Standard_EXPORT void SetRelation(const TCollection_ExtendedString& theRelation); Standard_EXPORT TDF_AttributeList& GetVariables() { return myVariables; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx index f3a3ac7fd..3ce415307 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx @@ -47,10 +47,10 @@ void SALOMEDSImpl_AttributeTextColor::SetTextColor(const Standard_Real R, const } //======================================================================= -//function : GetTextColor +//function : TextColor //purpose : //======================================================================= -Handle(TColStd_HArray1OfReal) SALOMEDSImpl_AttributeTextColor::GetTextColor() +Handle(TColStd_HArray1OfReal) SALOMEDSImpl_AttributeTextColor::TextColor() { return myValue; } @@ -92,7 +92,7 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributeTextColor::NewEmpty () const void SALOMEDSImpl_AttributeTextColor::Restore(const Handle(TDF_Attribute)& with) { - Handle(TColStd_HArray1OfReal) s = Handle(SALOMEDSImpl_AttributeTextColor)::DownCast (with)->GetTextColor (); + Handle(TColStd_HArray1OfReal) s = Handle(SALOMEDSImpl_AttributeTextColor)::DownCast (with)->TextColor (); ChangeArray(s); return; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.hxx index d4c31c53a..1601eb0a5 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.hxx @@ -31,7 +31,7 @@ Standard_EXPORT static const Standard_GUID& GetID() ; Standard_EXPORT SALOMEDSImpl_AttributeTextColor(); Standard_EXPORT const Standard_GUID& ID() const; Standard_EXPORT void SetTextColor(const Standard_Real R, const Standard_Real G, const Standard_Real B); -Standard_EXPORT Handle(TColStd_HArray1OfReal) GetTextColor(); +Standard_EXPORT Handle(TColStd_HArray1OfReal) TextColor(); Standard_EXPORT void ChangeArray(const Handle(TColStd_HArray1OfReal)& newArray); Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) ; Standard_EXPORT Handle_TDF_Attribute NewEmpty() const; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx index 93600e88f..96fdefb62 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx @@ -41,12 +41,12 @@ const Standard_GUID& SALOMEDSImpl_AttributeTextHighlightColor::ID () const { ret //======================================================================= -//function : SetTextColor +//function : SetTextHighlightColor //purpose : //======================================================================= -void SALOMEDSImpl_AttributeTextHighlightColor::SetTextColor(const Standard_Real R, - const Standard_Real G, - const Standard_Real B) +void SALOMEDSImpl_AttributeTextHighlightColor::SetTextHighlightColor(const Standard_Real R, + const Standard_Real G, + const Standard_Real B) { CheckLocked(); if(myValue.IsNull()) return; @@ -58,10 +58,10 @@ void SALOMEDSImpl_AttributeTextHighlightColor::SetTextColor(const Standard_Real } //======================================================================= -//function : GetTextColor +//function : TextHighlightColor //purpose : //======================================================================= -Handle(TColStd_HArray1OfReal) SALOMEDSImpl_AttributeTextHighlightColor::GetTextColor() +Handle(TColStd_HArray1OfReal) SALOMEDSImpl_AttributeTextHighlightColor::TextHighlightColor() { return myValue; } @@ -95,7 +95,7 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributeTextHighlightColor::NewEmpty () cons void SALOMEDSImpl_AttributeTextHighlightColor::Restore(const Handle(TDF_Attribute)& with) { - Handle(TColStd_HArray1OfReal) s = Handle(SALOMEDSImpl_AttributeTextHighlightColor)::DownCast (with)->GetTextColor (); + Handle(TColStd_HArray1OfReal) s = Handle(SALOMEDSImpl_AttributeTextHighlightColor)::DownCast (with)->TextHighlightColor (); ChangeArray(s); return; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.hxx index b622fb3c3..4322c19f7 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.hxx @@ -29,8 +29,8 @@ Standard_EXPORT virtual TCollection_AsciiString Save(); Standard_EXPORT virtual void Load(const TCollection_AsciiString&); Standard_EXPORT static const Standard_GUID& GetID() ; Standard_EXPORT SALOMEDSImpl_AttributeTextHighlightColor(); -Standard_EXPORT void SetTextColor(const Standard_Real R, const Standard_Real G, const Standard_Real B); -Standard_EXPORT Handle(TColStd_HArray1OfReal) GetTextColor(); +Standard_EXPORT void SetTextHighlightColor(const Standard_Real R, const Standard_Real G, const Standard_Real B); +Standard_EXPORT Handle(TColStd_HArray1OfReal) TextHighlightColor(); Standard_EXPORT void ChangeArray(const Handle(TColStd_HArray1OfReal)& newArray); Standard_EXPORT const Standard_GUID& ID() const; Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) ; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.cxx index 91b76f4b7..053346ccd 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.cxx @@ -17,7 +17,7 @@ SALOMEDSImpl_ChildIterator::SALOMEDSImpl_ChildIterator(const Handle(SALOMEDSImpl SALOMEDSImpl_ChildIterator::SALOMEDSImpl_ChildIterator(const TDF_Label& theLabel) { - _so = SALOMEDSImpl_Study::GetStudy(theLabel)->GetSObject(theLabel); + _so = SALOMEDSImpl_Study::SObject(theLabel); _it = TDF_ChildIterator(theLabel); } @@ -53,7 +53,7 @@ void SALOMEDSImpl_ChildIterator::Next() Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_ChildIterator::Value() { - return SALOMEDSImpl_Study::GetStudy(_it.Value())->GetSObject(_it.Value()); + return SALOMEDSImpl_Study::SObject(_it.Value()); } TDF_Label SALOMEDSImpl_ChildIterator::Label() diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx index 89df8e7a2..5d8648e91 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx @@ -17,6 +17,12 @@ char* SALOMEDSImpl_GenericAttribute::Impl_GetType(const Handle(TDF_Attribute)& t return ga->Type().ToCString(); } +char* SALOMEDSImpl_GenericAttribute::Impl_GetClassType(const Handle(TDF_Attribute)& theAttr) +{ + Handle(SALOMEDSImpl_GenericAttribute) ga = Handle(SALOMEDSImpl_GenericAttribute)::DownCast(theAttr); + return ga->GetClassType().ToCString(); +} + void SALOMEDSImpl_GenericAttribute::Impl_CheckLocked(const Handle(TDF_Attribute)& theAttr) { Handle(SALOMEDSImpl_GenericAttribute) ga = Handle(SALOMEDSImpl_GenericAttribute)::DownCast(theAttr); @@ -46,5 +52,5 @@ Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_GenericAttribute::GetSObject() { TDF_Label aLabel = Label(); if(aLabel.IsNull()) return NULL; - return SALOMEDSImpl_Study::GetStudy(aLabel)->GetSObject(aLabel); + return SALOMEDSImpl_Study::SObject(aLabel); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx index 31e710f7d..9ed1f341f 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx @@ -39,6 +39,7 @@ Standard_EXPORT TCollection_AsciiString GetClassType() { return _type; } Standard_EXPORT Handle(SALOMEDSImpl_SObject) GetSObject(); Standard_EXPORT static char* Impl_GetType(const Handle(TDF_Attribute)& theAttr); +Standard_EXPORT static char* Impl_GetClassType(const Handle(TDF_Attribute)& theAttr); Standard_EXPORT static void Impl_CheckLocked(const Handle(TDF_Attribute)& theAttr); public: diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.cxx index 96eb8f14c..4e542e1de 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.cxx @@ -39,7 +39,7 @@ TCollection_AsciiString SALOMEDSImpl_SComponent::ComponentDataType() TCollection_AsciiString res = ""; Handle(SALOMEDSImpl_AttributeComment) type; if ( _lab.FindAttribute(SALOMEDSImpl_AttributeComment::GetID(),type) ) { - res = type->Get(); + res = type->Value(); } return res; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.cxx index 2040a0bd3..ff3eaec0d 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.cxx @@ -61,6 +61,6 @@ void SALOMEDSImpl_SComponentIterator::Next() //============================================================================ Handle(SALOMEDSImpl_SComponent) SALOMEDSImpl_SComponentIterator::Value() { - return SALOMEDSImpl_Study::GetStudy(_it.Value())->GetSComponent (_it.Value()); + return SALOMEDSImpl_Study::SComponent(_it.Value()); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx index e3594207e..b60fce5a0 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx @@ -165,7 +165,7 @@ TCollection_AsciiString SALOMEDSImpl_SObject::GetName() TCollection_AsciiString aStr = ""; Handle(SALOMEDSImpl_AttributeName) aName; if (_lab.FindAttribute(SALOMEDSImpl_AttributeName::GetID(), aName)) { - aStr = aName->Get(); + aStr = aName->Value(); } return aStr; } @@ -180,7 +180,7 @@ TCollection_AsciiString SALOMEDSImpl_SObject::GetComment() TCollection_AsciiString aStr = ""; Handle(SALOMEDSImpl_AttributeComment) aComment; if (_lab.FindAttribute(SALOMEDSImpl_AttributeComment::GetID(), aComment)) { - aStr = aComment->Get(); + aStr = aComment->Value(); } return aStr; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index de61aa8de..cf5702b59 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -402,7 +402,7 @@ Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_Study::FindObjectByPath(const TCollect for ( ; anIterator.More(); anIterator.Next() ) { aLabel = anIterator.Value(); if(aLabel.FindAttribute(SALOMEDSImpl_AttributeName::GetID(), anAttr)) { - if(anAttr->Get() == aToken) { + if(anAttr->Value() == aToken) { aToken = aPath.Token("/", i+1); //Check if it was the last part of the path if(aToken.Length() == 0) { //The searched label is found (no part of the path is left) return GetSObject(aLabel); @@ -568,7 +568,7 @@ Handle(TColStd_HSequenceOfAsciiString) SALOMEDSImpl_Study::GetObjectNames(const for(; anIter.More(); anIter.Next()) { TDF_Label aLabel = anIter.Value(); Handle(SALOMEDSImpl_AttributeName) aName; - if (aLabel.FindAttribute(SALOMEDSImpl_AttributeName::GetID(), aName)) aResultSeq->Append(aName->Get()); + if (aLabel.FindAttribute(SALOMEDSImpl_AttributeName::GetID(), aName)) aResultSeq->Append(aName->Value()); } return aResultSeq; @@ -605,7 +605,7 @@ Handle(TColStd_HSequenceOfAsciiString) SALOMEDSImpl_Study::GetDirectoryNames(con if (anID->Value() == DIRECTORYID) { Handle(SALOMEDSImpl_AttributeName) aName; if (aLabel.FindAttribute(SALOMEDSImpl_AttributeName::GetID(), aName)) { - aResultSeq->Append(aName->Get()); + aResultSeq->Append(aName->Value()); } } } @@ -645,7 +645,7 @@ Handle(TColStd_HSequenceOfAsciiString) SALOMEDSImpl_Study::GetFileNames(const TC if (anID->Value() == FILELOCALID) { Handle(SALOMEDSImpl_AttributePersistentRef) aName; if(aLabel.FindAttribute(SALOMEDSImpl_AttributePersistentRef::GetID(), aName)) { - TCollection_ExtendedString aFileName = aName->Get(); + TCollection_ExtendedString aFileName = aName->Value(); if(aFileName.Length() > 0) aResultSeq->Append(aFileName.Split(strlen(FILEID))); } @@ -670,7 +670,7 @@ Handle(TColStd_HSequenceOfAsciiString) SALOMEDSImpl_Study::GetComponentNames(con for(; anIter.More(); anIter.Next()) { TDF_Label aLabel = anIter.Value(); Handle(SALOMEDSImpl_AttributeName) aName; - if (aLabel.FindAttribute(SALOMEDSImpl_AttributeName::GetID(), aName)) aResultSeq->Append(aName->Get()); + if (aLabel.FindAttribute(SALOMEDSImpl_AttributeName::GetID(), aName)) aResultSeq->Append(aName->Value()); } return aResultSeq; @@ -833,7 +833,7 @@ Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_Study::_FindObject(const Handle(SALOME { if (it.Value().FindAttribute(SALOMEDSImpl_AttributeName::GetID(), anAttr)) { - TCollection_AsciiString Val(anAttr->Get()); + TCollection_AsciiString Val(anAttr->Value()); if (Val == theObjectName) { RefSO = GetSObject(it.Value()); @@ -921,6 +921,17 @@ Handle(SALOMEDSImpl_Study) SALOMEDSImpl_Study::GetStudy(const TDF_Label& theLabe return NULL; } +Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_Study::SObject(const TDF_Label& theLabel) +{ + return GetStudy(theLabel)->GetSObject(theLabel); +} + +Handle(SALOMEDSImpl_SComponent) SALOMEDSImpl_Study::SComponent(const TDF_Label& theLabel) +{ + return GetStudy(theLabel)->GetSComponent(theLabel); +} + + void SALOMEDSImpl_Study::IORUpdated(const Handle(SALOMEDSImpl_AttributeIOR)& theAttribute) { TCollection_AsciiString aString; @@ -931,17 +942,11 @@ void SALOMEDSImpl_Study::IORUpdated(const Handle(SALOMEDSImpl_AttributeIOR)& the Handle(TColStd_HSequenceOfTransient) SALOMEDSImpl_Study::FindDependances(const Handle(SALOMEDSImpl_SObject)& anObject) { _errorCode = ""; - Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient; + Handle(TColStd_HSequenceOfTransient) aSeq; Handle(SALOMEDSImpl_AttributeTarget) aTarget; if (anObject->GetLabel().FindAttribute(SALOMEDSImpl_AttributeTarget::GetID(), aTarget)) { - TDF_LabelList aLabelList; - aTarget->Get(aLabelList); - TDF_ListIteratorOfLabelList anIter(aLabelList); - for(; anIter.More();anIter.Next()) { - aSeq->Append(GetSObject(anIter.Value())); - } - return aSeq; + return aTarget->Get(); } return aSeq; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx index 5b67bdf54..32bbe1bcb 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx @@ -79,6 +79,8 @@ private: public: static Handle(SALOMEDSImpl_Study) GetStudy(const TDF_Label& theLabel); + static Handle(SALOMEDSImpl_SObject) SObject(const TDF_Label& theLabel); + static Handle(SALOMEDSImpl_SComponent) SComponent(const TDF_Label& theLabel); static void IORUpdated(const Handle(SALOMEDSImpl_AttributeIOR)& theAttribute); //! standard constructor diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx index f6b64b656..72334106b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx @@ -185,7 +185,7 @@ bool SALOMEDSImpl_StudyBuilder::RemoveObject(const Handle(SALOMEDSImpl_SObject)& if (Lab.FindAttribute(SALOMEDSImpl_AttributeReference::GetID(), aReference)) { Handle(SALOMEDSImpl_AttributeTarget) aTarget; if (aReference->Get().FindAttribute(SALOMEDSImpl_AttributeTarget::GetID(),aTarget)) - aTarget->Remove(Lab); + aTarget->Remove(SALOMEDSImpl_Study::SObject(Lab)); } Handle(SALOMEDSImpl_AttributeIOR) anAttr; // postponed removing of CORBA objects @@ -218,7 +218,7 @@ bool SALOMEDSImpl_StudyBuilder::RemoveObjectWithChildren(const Handle(SALOMEDSIm if (Lab.FindAttribute(SALOMEDSImpl_AttributeReference::GetID(), aReference)) { Handle(SALOMEDSImpl_AttributeTarget) aTarget; if (aReference->Get().FindAttribute(SALOMEDSImpl_AttributeTarget::GetID(),aTarget)) - aTarget->Remove(Lab); + aTarget->Remove(SALOMEDSImpl_Study::SObject(Lab)); } Handle(SALOMEDSImpl_AttributeIOR) anAttr; // postponed removing of CORBA objects if (Lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID(), anAttr)) @@ -230,7 +230,7 @@ bool SALOMEDSImpl_StudyBuilder::RemoveObjectWithChildren(const Handle(SALOMEDSIm if (aLabel.FindAttribute(SALOMEDSImpl_AttributeReference::GetID(), aReference)) { Handle(SALOMEDSImpl_AttributeTarget) aTarget; if (aReference->Get().FindAttribute(SALOMEDSImpl_AttributeTarget::GetID(),aTarget)) - aTarget->Remove(aLabel); + aTarget->Remove(SALOMEDSImpl_Study::SObject(aLabel)); } Handle(SALOMEDSImpl_AttributeIOR) anAttr; // postponed removing of CORBA objects if (aLabel.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID(), anAttr)) @@ -258,12 +258,12 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const Handle(SALOMEDSImpl_SComponent)& int aLocked = anSCO->GetStudy()->GetProperties()->IsLocked(); if (aLocked) anSCO->GetStudy()->GetProperties()->SetLocked(false); - TCollection_ExtendedString Res(Att->Get()); + TCollection_ExtendedString Res(Att->Value()); Handle(SALOMEDSImpl_AttributeComment) type; TCollection_ExtendedString DataType; if (Lab.FindAttribute(SALOMEDSImpl_AttributeComment::GetID(),type)) - DataType = type->Get(); + DataType = type->Value(); // associate the driver to the SComponent if(aDriver == NULL) { @@ -540,7 +540,7 @@ bool SALOMEDSImpl_StudyBuilder::Addreference(const Handle(SALOMEDSImpl_SObject)& TDF_Label RefLab = theReferencedObject->GetLabel(); SALOMEDSImpl_AttributeReference::Set(Lab,RefLab); - SALOMEDSImpl_AttributeTarget::Set(RefLab)->Append(Lab); + SALOMEDSImpl_AttributeTarget::Set(RefLab)->Add(SALOMEDSImpl_Study::SObject(Lab)); if(!_callbackOnRemove.IsNull() && Lab.IsDescendant(_doc->Main())) _callbackOnRemove->OnRemoveSObject(me); return true; @@ -567,7 +567,8 @@ bool SALOMEDSImpl_StudyBuilder::RemoveReference(const Handle(SALOMEDSImpl_SObjec TDF_Label RefLab = theReferencedObject->GetLabel(); Handle(SALOMEDSImpl_AttributeTarget) aTarget; - if(RefLab.FindAttribute(SALOMEDSImpl_AttributeTarget::GetID(), aTarget)) aTarget->Remove(Lab); + if(RefLab.FindAttribute(SALOMEDSImpl_AttributeTarget::GetID(), aTarget)) + aTarget->Remove(SALOMEDSImpl_Study::SObject(Lab)); return true; } @@ -966,8 +967,8 @@ static void Translate_persistentID_to_IOR(TDF_Label& Lab, SALOMEDSImpl_Driver* d if (current.FindAttribute(SALOMEDSImpl_AttributeLocalID::GetID(), anID)) if (anID->Value() == FILELOCALID) continue; //SRN: This attribute store a file name, skip it - TCollection_AsciiString persist_ref(Att->Get()); - Handle(SALOMEDSImpl_SObject) so = SALOMEDSImpl_Study::GetStudy(current)->GetSObject(current); + TCollection_AsciiString persist_ref(Att->Value()); + Handle(SALOMEDSImpl_SObject) so = SALOMEDSImpl_Study::SObject(current); TCollection_AsciiString ior_string = driver->LocalPersistentIDToIOR(so, persist_ref, isMultiFile, diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx index 7ad9cc4c5..d0ab0302c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx @@ -553,8 +553,8 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const TCollection_AsciiString& aUrl, if(!aCompSpecificSO.IsNull()) { Handle(SALOMEDSImpl_AttributeInteger) anInteger; if(aCompSpecificSO->GetLabel().FindAttribute(SALOMEDSImpl_AttributeInteger::GetID(), anInteger)) { - anInteger->Set(-1); - while(anInteger->Get() < 0) { sleep(2); if(++aTimeOut > AUTO_SAVE_TIME_OUT_IN_SECONDS) break; } + anInteger->SetValue(-1); + while(anInteger->Value() < 0) { sleep(2); if(++aTimeOut > AUTO_SAVE_TIME_OUT_IN_SECONDS) break; } } // if(aCompSpecificSO->FindAttribute(anInteger, "AttributeInteger")) } // if(!CORBA::is_nil(aCompSpecificSO)) } // if (strcmp(aRow[0], componentDataType) == 0) @@ -740,7 +740,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveObject(const Handle(SALOMEDSImpl_SObjec if (anEmpty) continue; } - Handle(SALOMEDSImpl_SObject) SO = SALOMEDSImpl_Study::GetStudy(itchild.Value())->GetSObject(itchild.Value()); + Handle(SALOMEDSImpl_SObject) SO = SALOMEDSImpl_Study::SObject(itchild.Value()); char* scoid = (char*) SO->GetID().ToCString(); hdf_group_sobject = new HDFgroup(scoid, hdf_group_datatype); @@ -837,7 +837,7 @@ bool SALOMEDSImpl_StudyManager::CopyLabel(const Handle(SALOMEDSImpl_Study)& theS Handle(SALOMEDSImpl_AttributeName) aNameAttribute; if (aReferenced.FindAttribute(SALOMEDSImpl_AttributeName::GetID(), aNameAttribute)) { anEntry += " "; - anEntry += aNameAttribute->Get(); + anEntry += aNameAttribute->Value(); } SALOMEDSImpl_AttributeComment::Set(aAuxTargetLabel, TCollection_ExtendedString(anEntry)); continue; @@ -952,7 +952,7 @@ bool SALOMEDSImpl_StudyManager::CanPaste(const Handle(SALOMEDSImpl_SObject)& the _errorCode = "component has no IOR"; return false; } - return theEngine->CanPaste(aCompName->Get(), anObjID->Get()); + return theEngine->CanPaste(aCompName->Value(), anObjID->Value()); } //============================================================================ @@ -991,10 +991,10 @@ TDF_Label SALOMEDSImpl_StudyManager::PasteLabel(const Handle(SALOMEDSImpl_Study) aAuxSourceLabel.FindAttribute(SALOMEDSImpl_AttributeInteger::GetID(), anObjID); Handle(SALOMEDSImpl_AttributeComment) aComponentName; theSource.Root().FindAttribute(SALOMEDSImpl_AttributeComment::GetID(), aComponentName); - TCollection_AsciiString aCompName = aComponentName->Get(); + TCollection_AsciiString aCompName = aComponentName->Value(); - if (theEngine->CanPaste(aCompName, anObjID->Get())) { - TCollection_ExtendedString aTMPStr = aNameAttribute->Get(); + if (theEngine->CanPaste(aCompName, anObjID->Value())) { + TCollection_ExtendedString aTMPStr = aNameAttribute->Value(); int aLen = aTMPStr.Length(); unsigned char* aStream = NULL; if(aLen > 0) { @@ -1011,11 +1011,11 @@ TDF_Label SALOMEDSImpl_StudyManager::PasteLabel(const Handle(SALOMEDSImpl_Study) if (isFirstElement) { TCollection_AsciiString aDestEntry = theEngine->PasteInto(aStream, aLen, - anObjID->Get(), + anObjID->Value(), aPastedSO->GetFatherComponent()); TDF_Tool::Label(theDestinationStart.Data(), aDestEntry, aTargetLabel); } else - theEngine->PasteInto(aStream, aLen, anObjID->Get(), aPastedSO); + theEngine->PasteInto(aStream, aLen, anObjID->Value(), aPastedSO); if(aStream != NULL) delete []aStream; } @@ -1038,8 +1038,8 @@ TDF_Label SALOMEDSImpl_StudyManager::PasteLabel(const Handle(SALOMEDSImpl_Study) // check auxiliary label for Comment => reference or name attribute of the referenced object Handle(SALOMEDSImpl_AttributeComment) aCommentAttribute; if (aAuxSourceLabel.FindAttribute(SALOMEDSImpl_AttributeComment::GetID(), aCommentAttribute)) { - char * anEntry = new char[aCommentAttribute->Get().Length() + 1]; - strcpy(anEntry, TCollection_AsciiString(aCommentAttribute->Get()).ToCString()); + char * anEntry = new char[aCommentAttribute->Value().Length() + 1]; + strcpy(anEntry, TCollection_AsciiString(aCommentAttribute->Value()).ToCString()); char* aNameStart = strchr(anEntry, ' '); if (aNameStart) { *aNameStart = '\0'; @@ -1049,7 +1049,8 @@ TDF_Label SALOMEDSImpl_StudyManager::PasteLabel(const Handle(SALOMEDSImpl_Study) TDF_Label aRefLabel; TDF_Tool::Label(aTargetLabel.Data(), anEntry, aRefLabel); SALOMEDSImpl_AttributeReference::Set(aTargetLabel, aRefLabel); - SALOMEDSImpl_AttributeTarget::Set(aRefLabel)->Append(aTargetLabel); // target attributes structure support + // target attributes structure support + SALOMEDSImpl_AttributeTarget::Set(aRefLabel)->Add(SALOMEDSImpl_Study::SObject(aTargetLabel)); } else { if (aNameStart) SALOMEDSImpl_AttributeName::Set(aTargetLabel, aNameStart); else SALOMEDSImpl_AttributeName::Set(aTargetLabel, TCollection_ExtendedString("Reference to:")+anEntry); @@ -1088,7 +1089,7 @@ Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_StudyManager::Paste(const Handle(SALOM _errorCode = "No study ID was found"; return NULL; } - int aCStudyID = aStudyIDAttribute->Get(); + int aCStudyID = aStudyIDAttribute->Value(); // CAF document of current study usage Handle(TDocStd_Document) aDocument = GetDocumentOfStudy(aStudy); @@ -1117,7 +1118,7 @@ Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_StudyManager::Paste(const Handle(SALOM PasteLabel(aStudy, theEngine, anIterator.Value(), aStartLabel, aCStudyID, false); } - return SALOMEDSImpl_Study::GetStudy(aStartLabel)->GetSObject(aStartLabel); + return SALOMEDSImpl_Study::SObject(aStartLabel); } //####################################################################################################### @@ -1238,7 +1239,7 @@ static void Translate_IOR_to_persistentID (const Handle(SALOMEDSImpl_SObject)& s TCollection_AsciiString ior_string, persistent_string, curid; for (; itchild.More(); itchild.Next()) { - Handle(SALOMEDSImpl_SObject) current = SALOMEDSImpl_Study::GetStudy(itchild.Value())->GetSObject(itchild.Value()); + Handle(SALOMEDSImpl_SObject) current = SALOMEDSImpl_Study::SObject(itchild.Value()); Handle(SALOMEDSImpl_AttributeIOR) IOR; if (current->GetLabel().FindAttribute(SALOMEDSImpl_AttributeIOR::GetID(), IOR)) { ior_string = IOR->Value(); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx index 0dffb75c5..db1b9bcd1 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx @@ -265,7 +265,7 @@ bool SALOMEDSImpl_UseCaseBuilder::SetName(const TCollection_AsciiString& theName if (!_root->FindAttribute(SALOMEDSImpl_AttributeName::GetID(), aNameAttrib)) aNameAttrib = SALOMEDSImpl_AttributeName::Set(_root->Label(), theName); else - aNameAttrib->Set(theName); + aNameAttrib->SetValue(theName); return true; } @@ -287,7 +287,7 @@ Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_UseCaseBuilder::GetCurrentObject() TDF_Label aCurrent = aRef->Get(); if(aCurrent.IsNull()) return NULL; - return SALOMEDSImpl_Study::GetStudy(aCurrent)->GetSObject(aCurrent); + return SALOMEDSImpl_Study::SObject(aCurrent); } //============================================================================ @@ -302,7 +302,7 @@ TCollection_AsciiString SALOMEDSImpl_UseCaseBuilder::GetName() Handle(SALOMEDSImpl_AttributeName) aName; if (!_root->FindAttribute(SALOMEDSImpl_AttributeName::GetID(), aName)) return aString; - aString = TCollection_AsciiString(aName->Get()); + aString = TCollection_AsciiString(aName->Value()); return aString; } @@ -350,14 +350,14 @@ Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_UseCaseBuilder::AddUseCase(const TColl } //Create a new use case - anInteger->Set(anInteger->Get()+1); - TDF_Label aChild = aLabel.FindChild(anInteger->Get()); + anInteger->SetValue(anInteger->Value()+1); + TDF_Label aChild = aLabel.FindChild(anInteger->Value()); aNode = SALOMEDSImpl_AttributeTreeNode::Set(aChild, aBasicGUID); aNode->Remove(); aFatherNode->Append(aNode); SALOMEDSImpl_AttributeName::Set(aChild, theName); - return SALOMEDSImpl_Study::GetStudy(aChild)->GetSObject(aChild); + return SALOMEDSImpl_Study::SObject(aChild); } //============================================================================ @@ -385,5 +385,5 @@ Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_UseCaseBuilder::GetSObject(const TColl { TDF_Label aLabel; TDF_Tool::Label(_doc->GetData(), theEntry, aLabel); - return SALOMEDSImpl_Study::GetStudy(aLabel)->GetSObject(aLabel); + return SALOMEDSImpl_Study::SObject(aLabel); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.cxx index a6a4a2288..7021609c0 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.cxx @@ -74,6 +74,6 @@ void SALOMEDSImpl_UseCaseIterator::Next() Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_UseCaseIterator::Value() { TDF_Label L = _it.Value()->Label(); - return SALOMEDSImpl_Study::GetStudy(L)->GetSObject(L); + return SALOMEDSImpl_Study::SObject(L); } diff --git a/src/SALOMEDSImpl/testDS.cxx b/src/SALOMEDSImpl/testDS.cxx index 55cdbd1b2..eaf801d98 100644 --- a/src/SALOMEDSImpl/testDS.cxx +++ b/src/SALOMEDSImpl/testDS.cxx @@ -44,7 +44,7 @@ int main (int argc, char * argv[]) cout << "Just another way to create an attribute: official one :) " << endl; Handle(TDF_Attribute) aTDFAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeName"); Handle(SALOMEDSImpl_AttributeName) aRN = Handle(SALOMEDSImpl_AttributeName)::DownCast(aTDFAttr); - aRN->Set("name_attribute"); + aRN->SetValue("name_attribute"); cout << " The type = " << aRN->Type() << endl; ga = Handle(SALOMEDSImpl_GenericAttribute)::DownCast(aRN); cout << "Attribute has type: " << ga->Type() << " and value: " << ga->Save() << endl;