From: srn Date: Thu, 17 Mar 2005 08:19:33 +0000 (+0000) Subject: Local Study X-Git-Tag: T_22_03_05~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4d1bf06212a1b431860bde83e5ac97ec180331e4;p=modules%2Fkernel.git Local Study --- diff --git a/src/SALOMEDS/SALOMEDS_TableOfIntegerAttribute.cxx b/src/SALOMEDS/SALOMEDS_TableOfIntegerAttribute.cxx deleted file mode 100644 index abe7171f8..000000000 --- a/src/SALOMEDS/SALOMEDS_TableOfIntegerAttribute.cxx +++ /dev/null @@ -1,399 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : SALOMEDS_TableOfIntegerAttribute.cxx -// Author : Michael Ponikarov -// Module : SALOME -// $Header$ - -#include -#include -#include - -#include -using namespace std; - -const Standard_GUID& SALOMEDS_TableOfIntegerAttribute::GetID() -{ - static Standard_GUID SALOMEDS_TableOfIntegerAttributeID ("128371A0-8F52-11d6-A8A3-0001021E8C7F"); - return SALOMEDS_TableOfIntegerAttributeID; -} - -Handle(SALOMEDS_TableOfIntegerAttribute) SALOMEDS_TableOfIntegerAttribute::Set(const TDF_Label& label) -{ - Handle(SALOMEDS_TableOfIntegerAttribute) anAttr; - if (!label.FindAttribute(SALOMEDS_TableOfIntegerAttribute::GetID(),anAttr)) { - anAttr = new SALOMEDS_TableOfIntegerAttribute(); - label.AddAttribute(anAttr); - } - return anAttr; -} - -SALOMEDS_TableOfIntegerAttribute::SALOMEDS_TableOfIntegerAttribute() { - myRows = new TColStd_HSequenceOfExtendedString(); - myCols = new TColStd_HSequenceOfExtendedString(); - myNbRows = 0; - myNbColumns = 0; -} - -void SALOMEDS_TableOfIntegerAttribute::SetNbColumns(const Standard_Integer theNbColumns) -{ - Backup(); - - TColStd_DataMapOfIntegerInteger aMap; - aMap = myTable; - myTable.Clear(); - - TColStd_DataMapIteratorOfDataMapOfIntegerInteger anIterator(aMap); - for(; anIterator.More(); anIterator.Next()) { - int aRow = (int)(anIterator.Key()/myNbColumns) + 1; - int aCol = (int)(anIterator.Key() - myNbColumns*(aRow-1)); - if(aCol == 0) { aCol = myNbColumns; aRow--; } - if(aCol > theNbColumns) continue; - int aKey = (aRow-1)*theNbColumns+aCol; - myTable.Bind(aKey, anIterator.Value()); - } - - myNbColumns = theNbColumns; - - while (myCols->Length() < myNbColumns) { // append empty columns titles - myCols->Append(TCollection_ExtendedString("")); - } -} - -void SALOMEDS_TableOfIntegerAttribute::SetTitle(const TCollection_ExtendedString& theTitle) { - Backup(); - myTitle = theTitle; -} - -TCollection_ExtendedString SALOMEDS_TableOfIntegerAttribute::GetTitle() const { - return myTitle; -} - -void SALOMEDS_TableOfIntegerAttribute::SetRowData(const Standard_Integer theRow, - const Handle(TColStd_HSequenceOfInteger)& theData) -{ - if(theData->Length() > myNbColumns) SetNbColumns(theData->Length()); - - Backup(); - - while (myRows->Length() < theRow) { // append new row titles - myRows->Append(TCollection_ExtendedString("")); - } - - Standard_Integer i, aShift = (theRow-1)*myNbColumns, aLength = theData->Length(); - for(i = 1; i <= aLength; i++) { - myTable.Bind(aShift + i, theData->Value(i)); - } - - if(theRow > myNbRows) myNbRows = theRow; -} - -Handle(TColStd_HSequenceOfInteger) SALOMEDS_TableOfIntegerAttribute::GetRowData(const Standard_Integer theRow) -{ - Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger(); - Standard_Integer i, aShift = (theRow-1)*myNbColumns; - for(i = 1; i <= myNbColumns; i++) { - if(myTable.IsBound(aShift+i)) - aSeq->Append(myTable.Find(aShift+i)); - else - aSeq->Append(0); - } - - return aSeq; -} - -void SALOMEDS_TableOfIntegerAttribute::SetRowTitle(const Standard_Integer theRow, - const TCollection_ExtendedString& theTitle) { - Backup(); - myRows->SetValue(theRow,theTitle); -} - -TCollection_ExtendedString SALOMEDS_TableOfIntegerAttribute::GetRowTitle(const Standard_Integer theRow) const { - return myRows->Value(theRow); -} - - -void SALOMEDS_TableOfIntegerAttribute::SetColumnData(const Standard_Integer theColumn, - const Handle(TColStd_HSequenceOfInteger)& theData) -{ - if(theColumn > myNbColumns) SetNbColumns(theColumn); - - Backup(); - - Standard_Integer i, aLength = theData->Length(); - for(i = 1; i <= aLength; i++) { - myTable.Bind(myNbColumns*(i-1)+theColumn, theData->Value(i)); - } - - if(aLength > myNbRows) { - myNbRows = aLength; - while (myRows->Length() < myNbRows) { // append empty row titles - myRows->Append(TCollection_ExtendedString("")); - } - } -} - - -Handle(TColStd_HSequenceOfInteger) SALOMEDS_TableOfIntegerAttribute::GetColumnData(const Standard_Integer theColumn) -{ - Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger; - - Standard_Integer i, anIndex; - for(i = 1; i <= myNbRows; i++) { - anIndex = myNbColumns*(i-1) + theColumn; - if(myTable.IsBound(anIndex)) - aSeq->Append(myTable.Find(anIndex)); - else - aSeq->Append(0); - } - - return aSeq; -} - -void SALOMEDS_TableOfIntegerAttribute::SetColumnTitle(const Standard_Integer theColumn, - const TCollection_ExtendedString& theTitle) { - Backup(); - while(myCols->Length() < theColumn) myCols->Append(TCollection_ExtendedString("")); - myCols->SetValue(theColumn,theTitle); -} - -TCollection_ExtendedString SALOMEDS_TableOfIntegerAttribute::GetColumnTitle(const Standard_Integer theColumn) const { - if(myCols.IsNull()) return ""; - if(myCols->Length() < theColumn) return ""; - return myCols->Value(theColumn); -} - - -Standard_Integer SALOMEDS_TableOfIntegerAttribute::GetNbRows() const -{ - return myNbRows; -} - -Standard_Integer SALOMEDS_TableOfIntegerAttribute::GetNbColumns() const -{ - return myNbColumns; -} - -void SALOMEDS_TableOfIntegerAttribute::PutValue(const Standard_Integer theValue, - const Standard_Integer theRow, - const Standard_Integer theColumn) -{ - if(theColumn > myNbColumns) SetNbColumns(theColumn); - - Standard_Integer anIndex = (theRow-1)*myNbColumns + theColumn; - myTable.Bind(anIndex, theValue); - - if(theRow > myNbRows) { - while (myRows->Length() < theRow) { // append empty row titles - myRows->Append(TCollection_ExtendedString("")); - } - myNbRows = theRow; - } -} - -Standard_Boolean SALOMEDS_TableOfIntegerAttribute::HasValue(const Standard_Integer theRow, - const Standard_Integer theColumn) -{ - Standard_Integer anIndex = (theRow-1)*myNbColumns + theColumn; - return myTable.IsBound(anIndex); -} - -Standard_Integer SALOMEDS_TableOfIntegerAttribute::GetValue(const Standard_Integer theRow, - const Standard_Integer theColumn) -{ - Standard_Integer anIndex = (theRow-1)*myNbColumns + theColumn; - if(myTable.IsBound(anIndex)) return myTable.Find(anIndex); - - Standard_Failure::Raise("Invalid cell index"); - return 0; -} - -const Standard_GUID& SALOMEDS_TableOfIntegerAttribute::ID() const -{ - return GetID(); -} - -void SALOMEDS_TableOfIntegerAttribute::Restore(const Handle(TDF_Attribute)& with) -{ - Standard_Integer anIndex; - Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(with); - - myTable.Clear(); - myCols->Clear(); - myRows->Clear(); - - myTable = aTable->myTable; - myNbRows = aTable->myNbRows; - myNbColumns = aTable->myNbColumns; - myTitle = aTable->myTitle; - - for(anIndex = 1; anIndex <= aTable->GetNbRows();anIndex++) - myRows->Append(aTable->GetRowTitle(anIndex)); - - for(anIndex = 1; anIndex <= aTable->GetNbColumns(); anIndex++) - myCols->Append(aTable->GetColumnTitle(anIndex)); -} - -Handle(TDF_Attribute) SALOMEDS_TableOfIntegerAttribute::NewEmpty() const -{ - return new SALOMEDS_TableOfIntegerAttribute(); -} - -void SALOMEDS_TableOfIntegerAttribute::Paste(const Handle(TDF_Attribute)& into, - const Handle(TDF_RelocationTable)&) const -{ - Standard_Integer anIndex; - Handle(SALOMEDS_TableOfIntegerAttribute) aTable = Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(into); - - aTable->myTable.Clear(); - aTable->myCols->Clear(); - aTable->myRows->Clear(); - - aTable->myTable = myTable; - aTable->myTitle = myTitle; - aTable->myNbRows = myNbRows; - aTable->myNbColumns = myNbColumns; - - for(anIndex = 1; anIndex <= GetNbRows();anIndex++) - aTable->myRows->Append(GetRowTitle(anIndex)); - for(anIndex = 1; anIndex <= GetNbColumns(); anIndex++) - aTable->myCols->Append(GetColumnTitle(anIndex)); -} - - -Handle_TColStd_HSequenceOfInteger SALOMEDS_TableOfIntegerAttribute::GetSetRowIndices(const Standard_Integer theRow) -{ - Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger; - - Standard_Integer i, aShift = myNbColumns*(theRow-1); - for(i = 1; i <= myNbColumns; i++) { - if(myTable.IsBound(aShift + i)) aSeq->Append(i); - } - - return aSeq; -} - -Handle_TColStd_HSequenceOfInteger SALOMEDS_TableOfIntegerAttribute::GetSetColumnIndices(const Standard_Integer theColumn) -{ - Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger; - - Standard_Integer i, anIndex; - for(i = 1; i <= myNbRows; i++) { - anIndex = myNbColumns*(i-1)+theColumn; - if(myTable.IsBound(anIndex)) aSeq->Append(i); - } - - return aSeq; -} - - -void SALOMEDS_TableOfIntegerAttribute::ConvertToString(ostrstream& theStream) -{ - int i, j, l; - - theStream.precision(64); - - //Title - l = myTitle.Length(); - theStream << l << "\n"; - for(i=1; i<=l; i++) - theStream << myTitle.Value(i) << "\n"; - - //Nb rows - theStream << myNbRows << "\n"; - - //Rows titles - for(i=1; i<=myNbRows; i++) { - l = myRows->Value(i).Length(); - theStream << l << "\n"; - for(j=1; j<=l; j++) - theStream << myRows->Value(i).Value(j) << "\n"; - } - - //Nb columns - theStream << myNbColumns << "\n"; - - //Columns titles - for(i=1; i<=myNbColumns; i++) { - l = myCols->Value(i).Length(); - theStream << l << "\n"; - for(j=1; j<=l; j++) - theStream << myCols->Value(i).Value(j) << "\n"; - } - - //Store the table values - l = myTable.Extent(); - theStream << l << "\n"; - TColStd_DataMapIteratorOfDataMapOfIntegerInteger anIterator(myTable); - for(; anIterator.More(); anIterator.Next()) { - theStream << anIterator.Key() << "\n"; - theStream << anIterator.Value() << "\n"; - } - - return; -} - -bool SALOMEDS_TableOfIntegerAttribute::RestoreFromString(istrstream& theStream) -{ - Backup(); - - int i, j, l; - - Standard_ExtCharacter anExtChar; - TCollection_ExtendedString aStr; - - //Title - theStream >> l; - - myTitle = TCollection_ExtendedString(l, 0); - for(i=1; i<=l; i++) { - theStream >> anExtChar; - myTitle.SetValue(i, anExtChar); - } - - //Nb rows - theStream >> myNbRows; - - //Rows titles - myRows->Clear(); - for(i=1; i<=myNbRows; i++) { - theStream >> l; - aStr = TCollection_ExtendedString(l,0); - for(j=1; j<=l; j++) { - theStream >> anExtChar; - aStr.SetValue(j, anExtChar); - } - myRows->Append(aStr); - } - - //Nb columns - theStream >> myNbColumns; - - //Columns titles - myCols->Clear(); - for(i=1; i<=myNbColumns; i++) { - theStream >> l; - aStr = TCollection_ExtendedString(l,0); - for(j=1; j<=l; j++) { - theStream >> anExtChar; - aStr.SetValue(j, anExtChar); - } - myCols->Append(aStr); - } - - //Restore the table values - theStream >> l; - myTable.Clear(); - for(i=1; i<=l; i++) { - int aKey, aValue; - theStream >> aKey; - theStream >> aValue; - myTable.Bind(aKey, aValue); - } - - return true; -} diff --git a/src/SALOMEDS/SALOMEDS_TableOfIntegerAttribute.hxx b/src/SALOMEDS/SALOMEDS_TableOfIntegerAttribute.hxx deleted file mode 100644 index f524bad98..000000000 --- a/src/SALOMEDS/SALOMEDS_TableOfIntegerAttribute.hxx +++ /dev/null @@ -1,163 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : SALOMEDS_TableOfIntegerAttribute.hxx -// Author : Michael Ponikarov -// Module : SALOME -// $Header$ - -#ifndef _SALOMEDS_TableOfIntegerAttribute_HeaderFile -#define _SALOMEDS_TableOfIntegerAttribute_HeaderFile - -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Handle_SALOMEDS_TableOfIntegerAttribute_HeaderFile -#include -#endif - -#ifndef _TColStd_SequenceOfTransient_HeaderFile -#include -#endif -#ifndef _TCollection_ExtendedString_HeaderFile -#include -#endif -#ifndef _Handle_TColStd_HSequenceOfExtendedString_HeaderFile -#include -#endif - -#ifndef _TColStd_DataMapOfIntegerInteger_HeaderFile -#include -#endif - -#ifndef _TDF_Attribute_HeaderFile -#include -#endif -#ifndef _Standard_Integer_HeaderFile -#include -#endif -#ifndef _Handle_TColStd_HSequenceOfInteger_HeaderFile -#include -#endif -#ifndef _Standard_Boolean_HeaderFile -#include -#endif -#ifndef _Handle_TDF_Attribute_HeaderFile -#include -#endif -#ifndef _Handle_TDF_RelocationTable_HeaderFile -#include -#endif -class TColStd_HSequenceOfExtendedString; -class Standard_GUID; -class TDF_Label; -class TCollection_ExtendedString; -class TColStd_HSequenceOfInteger; -class TDF_Attribute; -class TDF_RelocationTable; - -#include - -class SALOMEDS_TableOfIntegerAttribute : public TDF_Attribute { - -public: - - inline void* operator new(size_t,void* anAddress) - { - return anAddress; - } - inline void* operator new(size_t size) - { - return Standard::Allocate(size); - } - inline void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } -// inline void operator delete(void *anAddress, size_t size) -// { -// if (anAddress) Standard::Free((Standard_Address&)anAddress,size); -// } - // Methods PUBLIC - // -Standard_EXPORT static const Standard_GUID& GetID() ; -Standard_EXPORT static Handle_SALOMEDS_TableOfIntegerAttribute Set(const TDF_Label& label) ; -Standard_EXPORT SALOMEDS_TableOfIntegerAttribute(); -Standard_EXPORT void SetNbColumns(const Standard_Integer theNbColumns); -Standard_EXPORT void SetTitle(const TCollection_ExtendedString& theTitle) ; -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 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 Standard_Integer GetNbRows() const; -Standard_EXPORT Standard_Integer GetNbColumns() const; - -Standard_EXPORT void PutValue(const Standard_Integer theValue,const Standard_Integer theRow,const Standard_Integer theColumn) ; -Standard_EXPORT Standard_Boolean HasValue(const Standard_Integer theRow,const Standard_Integer theColumn) ; -Standard_EXPORT Standard_Integer GetValue(const Standard_Integer theRow,const Standard_Integer theColumn) ; -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 Handle_TColStd_HSequenceOfInteger GetSetRowIndices(const Standard_Integer theRow); -Standard_EXPORT Handle_TColStd_HSequenceOfInteger GetSetColumnIndices(const Standard_Integer theColumn); - -Standard_EXPORT void ConvertToString(ostrstream& theStream); -Standard_EXPORT bool RestoreFromString(istrstream& theStream); - -Standard_EXPORT ~SALOMEDS_TableOfIntegerAttribute(); - - - - - // Type management - // - Standard_EXPORT friend Handle_Standard_Type& SALOMEDS_TableOfIntegerAttribute_Type_(); - Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // -TColStd_DataMapOfIntegerInteger myTable; -TCollection_ExtendedString myTitle; -Handle_TColStd_HSequenceOfExtendedString myRows; -Handle_TColStd_HSequenceOfExtendedString myCols; -Standard_Integer myNbRows; -Standard_Integer myNbColumns; - -}; - - - - - -// other inline functions and methods (like "C++: function call" methods) -// - - -#endif diff --git a/src/SALOMEDS/SALOMEDS_TableOfIntegerAttribute.ixx b/src/SALOMEDS/SALOMEDS_TableOfIntegerAttribute.ixx deleted file mode 100644 index 493f12028..000000000 --- a/src/SALOMEDS/SALOMEDS_TableOfIntegerAttribute.ixx +++ /dev/null @@ -1,68 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : SALOMEDS_TableOfIntegerAttribute.ixx -// Author : Michael Ponikarov -// Module : SALOME -// $Header$ - -#include - -#ifndef _Standard_TypeMismatch_HeaderFile -#include -#endif - -SALOMEDS_TableOfIntegerAttribute::~SALOMEDS_TableOfIntegerAttribute() {} - - - -Standard_EXPORT Handle_Standard_Type& SALOMEDS_TableOfIntegerAttribute_Type_() -{ - - static Handle_Standard_Type aType1 = STANDARD_TYPE(TDF_Attribute); - if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TDF_Attribute); - static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); - if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared); - static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); - if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient); - - - static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; - static Handle_Standard_Type _aType = new Standard_Type("SALOMEDS_TableOfIntegerAttribute", - sizeof(SALOMEDS_TableOfIntegerAttribute), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); - - return _aType; -} - - -// DownCast method -// allow safe downcasting -// -const Handle(SALOMEDS_TableOfIntegerAttribute) Handle(SALOMEDS_TableOfIntegerAttribute)::DownCast(const Handle(Standard_Transient)& AnObject) -{ - Handle(SALOMEDS_TableOfIntegerAttribute) _anOtherObject; - - if (!AnObject.IsNull()) { - if (AnObject->IsKind(STANDARD_TYPE(SALOMEDS_TableOfIntegerAttribute))) { - _anOtherObject = Handle(SALOMEDS_TableOfIntegerAttribute)((Handle(SALOMEDS_TableOfIntegerAttribute)&)AnObject); - } - } - - return _anOtherObject ; -} -const Handle(Standard_Type)& SALOMEDS_TableOfIntegerAttribute::DynamicType() const -{ - return STANDARD_TYPE(SALOMEDS_TableOfIntegerAttribute) ; -} -Standard_Boolean SALOMEDS_TableOfIntegerAttribute::IsKind(const Handle(Standard_Type)& AType) const -{ - return (STANDARD_TYPE(SALOMEDS_TableOfIntegerAttribute) == AType || TDF_Attribute::IsKind(AType)); -} -Handle_SALOMEDS_TableOfIntegerAttribute::~Handle_SALOMEDS_TableOfIntegerAttribute() {} - diff --git a/src/SALOMEDS/SALOMEDS_TableOfIntegerAttribute.jxx b/src/SALOMEDS/SALOMEDS_TableOfIntegerAttribute.jxx deleted file mode 100644 index ac68dcd1a..000000000 --- a/src/SALOMEDS/SALOMEDS_TableOfIntegerAttribute.jxx +++ /dev/null @@ -1,35 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : SALOMEDS_TableOfIntegerAttribute.jxx -// Author : Michael Ponikarov -// Module : SALOME -// $Header$ - -#ifndef _TColStd_HSequenceOfExtendedString_HeaderFile -#include -#endif -#ifndef _Standard_GUID_HeaderFile -#include -#endif -#ifndef _TDF_Label_HeaderFile -#include -#endif -#ifndef _TCollection_ExtendedString_HeaderFile -#include -#endif -#ifndef _TColStd_HSequenceOfInteger_HeaderFile -#include -#endif -#ifndef _TDF_Attribute_HeaderFile -#include -#endif -#ifndef _TDF_RelocationTable_HeaderFile -#include -#endif -#ifndef _SALOMEDS_TableOfIntegerAttribute_HeaderFile -#include -#endif diff --git a/src/SALOMEDS/SALOMEDS_TableOfRealAttribute.cxx b/src/SALOMEDS/SALOMEDS_TableOfRealAttribute.cxx deleted file mode 100644 index f234fca97..000000000 --- a/src/SALOMEDS/SALOMEDS_TableOfRealAttribute.cxx +++ /dev/null @@ -1,405 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : SALOMEDS_TableOfRealAttribute.cxx -// Author : Michael Ponikarov -// Module : SALOME -// $Header$ - -#include -#include -#include - -#include -#include -using namespace std; - -const Standard_GUID& SALOMEDS_TableOfRealAttribute::GetID() -{ - static Standard_GUID SALOMEDS_TableOfRealAttributeID ("128371A1-8F52-11d6-A8A3-0001021E8C7F"); - return SALOMEDS_TableOfRealAttributeID; -} - -Handle(SALOMEDS_TableOfRealAttribute) SALOMEDS_TableOfRealAttribute::Set(const TDF_Label& label) -{ - Handle(SALOMEDS_TableOfRealAttribute) anAttr; - if (!label.FindAttribute(SALOMEDS_TableOfRealAttribute::GetID(),anAttr)) { - anAttr = new SALOMEDS_TableOfRealAttribute(); - label.AddAttribute(anAttr); - } - return anAttr; -} - -SALOMEDS_TableOfRealAttribute::SALOMEDS_TableOfRealAttribute() { - myRows = new TColStd_HSequenceOfExtendedString(); - myCols = new TColStd_HSequenceOfExtendedString(); - myNbRows = 0; - myNbColumns = 0; -} - -void SALOMEDS_TableOfRealAttribute::SetNbColumns(const Standard_Integer theNbColumns) -{ - Backup(); - - TColStd_DataMapOfIntegerReal aMap; - aMap = myTable; - myTable.Clear(); - - TColStd_DataMapIteratorOfDataMapOfIntegerReal anIterator(aMap); - for(; anIterator.More(); anIterator.Next()) { - int aRow = (int)(anIterator.Key()/myNbColumns) + 1; - int aCol = (int)(anIterator.Key() - myNbColumns*(aRow-1)); - if(aCol == 0) { aCol = myNbColumns; aRow--; } - if(aCol > theNbColumns) continue; - int aKey = (aRow-1)*theNbColumns+aCol; - myTable.Bind(aKey, anIterator.Value()); - } - - myNbColumns = theNbColumns; - - while (myCols->Length() < myNbColumns) { // append empty columns titles - myCols->Append(TCollection_ExtendedString("")); - } -} - -void SALOMEDS_TableOfRealAttribute::SetTitle(const TCollection_ExtendedString& theTitle) { - Backup(); - myTitle = theTitle; -} - -TCollection_ExtendedString SALOMEDS_TableOfRealAttribute::GetTitle() const { - return myTitle; -} - -void SALOMEDS_TableOfRealAttribute::SetRowData(const Standard_Integer theRow, - const Handle(TColStd_HSequenceOfReal)& theData) -{ - if(theData->Length() > myNbColumns) SetNbColumns(theData->Length()); - - Backup(); - - while (myRows->Length() < theRow) { // append new row titles - myRows->Append(TCollection_ExtendedString("")); - } - - Standard_Integer i, aShift = (theRow-1)*myNbColumns, aLength = theData->Length(); - for(i = 1; i <= aLength; i++) { - myTable.Bind(aShift + i, theData->Value(i)); - } - - if(theRow > myNbRows) myNbRows = theRow; -} - -Handle(TColStd_HSequenceOfReal) SALOMEDS_TableOfRealAttribute::GetRowData(const Standard_Integer theRow) -{ - Handle(TColStd_HSequenceOfReal) aSeq = new TColStd_HSequenceOfReal(); - Standard_Integer i, aShift = (theRow-1)*myNbColumns; - for(i = 1; i <= myNbColumns; i++) { - if(myTable.IsBound(aShift+i)) - aSeq->Append(myTable.Find(aShift+i)); - else - aSeq->Append(0.); - } - - return aSeq; -} - -void SALOMEDS_TableOfRealAttribute::SetRowTitle(const Standard_Integer theRow, - const TCollection_ExtendedString& theTitle) { - Backup(); - myRows->SetValue(theRow,theTitle); -} - -TCollection_ExtendedString SALOMEDS_TableOfRealAttribute::GetRowTitle(const Standard_Integer theRow) const { - return myRows->Value(theRow); -} - - -void SALOMEDS_TableOfRealAttribute::SetColumnData(const Standard_Integer theColumn, - const Handle(TColStd_HSequenceOfReal)& theData) -{ - if(theColumn > myNbColumns) SetNbColumns(theColumn); - - Backup(); - - Standard_Integer i, aLength = theData->Length(); - for(i = 1; i <= aLength; i++) { - myTable.Bind(myNbColumns*(i-1)+theColumn, theData->Value(i)); - } - - if(aLength > myNbRows) { - myNbRows = aLength; - while (myRows->Length() < myNbRows) { // append empty row titles - myRows->Append(TCollection_ExtendedString("")); - } - } -} - - -Handle(TColStd_HSequenceOfReal) SALOMEDS_TableOfRealAttribute::GetColumnData(const Standard_Integer theColumn) -{ - Handle(TColStd_HSequenceOfReal) aSeq = new TColStd_HSequenceOfReal; - - Standard_Integer i, anIndex; - for(i = 1; i <= myNbRows; i++) { - anIndex = myNbColumns*(i-1) + theColumn; - if(myTable.IsBound(anIndex)) - aSeq->Append(myTable.Find(anIndex)); - else - aSeq->Append(0.); - } - - return aSeq; -} - -void SALOMEDS_TableOfRealAttribute::SetColumnTitle(const Standard_Integer theColumn, - const TCollection_ExtendedString& theTitle) { - Backup(); - while(myCols->Length() < theColumn) myCols->Append(TCollection_ExtendedString("")); - myCols->SetValue(theColumn,theTitle); -} - -TCollection_ExtendedString SALOMEDS_TableOfRealAttribute::GetColumnTitle(const Standard_Integer theColumn) const { - if(myCols.IsNull()) return ""; - if(myCols->Length() < theColumn) return ""; - return myCols->Value(theColumn); -} - - -Standard_Integer SALOMEDS_TableOfRealAttribute::GetNbRows() const -{ - return myNbRows; -} - -Standard_Integer SALOMEDS_TableOfRealAttribute::GetNbColumns() const -{ - return myNbColumns; -} - -void SALOMEDS_TableOfRealAttribute::PutValue(const Standard_Real theValue, - const Standard_Integer theRow, - const Standard_Integer theColumn) -{ - if(theColumn > myNbColumns) SetNbColumns(theColumn); - - Standard_Integer anIndex = (theRow-1)*myNbColumns + theColumn; - myTable.Bind(anIndex, theValue); - - if(theRow > myNbRows) { - while (myRows->Length() < theRow) { // append empty row titles - myRows->Append(TCollection_ExtendedString("")); - } - myNbRows = theRow; - } -} - -Standard_Boolean SALOMEDS_TableOfRealAttribute::HasValue(const Standard_Integer theRow, - const Standard_Integer theColumn) -{ - Standard_Integer anIndex = (theRow-1)*myNbColumns + theColumn; - return myTable.IsBound(anIndex); -} - -Standard_Real SALOMEDS_TableOfRealAttribute::GetValue(const Standard_Integer theRow, - const Standard_Integer theColumn) -{ - Standard_Integer anIndex = (theRow-1)*myNbColumns + theColumn; - if(myTable.IsBound(anIndex)) return myTable.Find(anIndex); - - Standard_Failure::Raise("Invalid cell index"); - return 0.; -} - -const Standard_GUID& SALOMEDS_TableOfRealAttribute::ID() const -{ - return GetID(); -} - -void SALOMEDS_TableOfRealAttribute::Restore(const Handle(TDF_Attribute)& with) -{ - Standard_Integer anIndex; - Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(with); - - myTable.Clear(); - myCols->Clear(); - myRows->Clear(); - - myTable = aTable->myTable; - myNbRows = aTable->myNbRows; - myNbColumns = aTable->myNbColumns; - myTitle = aTable->myTitle; - - for(anIndex = 1; anIndex <= aTable->GetNbRows();anIndex++) - myRows->Append(aTable->GetRowTitle(anIndex)); - - for(anIndex = 1; anIndex <= aTable->GetNbColumns(); anIndex++) - myCols->Append(aTable->GetColumnTitle(anIndex)); -} - -Handle(TDF_Attribute) SALOMEDS_TableOfRealAttribute::NewEmpty() const -{ - return new SALOMEDS_TableOfRealAttribute(); -} - -void SALOMEDS_TableOfRealAttribute::Paste(const Handle(TDF_Attribute)& into, - const Handle(TDF_RelocationTable)&) const -{ - Standard_Integer anIndex; - Handle(SALOMEDS_TableOfRealAttribute) aTable = Handle(SALOMEDS_TableOfRealAttribute)::DownCast(into); - - aTable->myTable.Clear(); - aTable->myCols->Clear(); - aTable->myRows->Clear(); - - aTable->myTable = myTable; - aTable->myTitle = myTitle; - aTable->myNbRows = myNbRows; - aTable->myNbColumns = myNbColumns; - - for(anIndex = 1; anIndex <= GetNbRows();anIndex++) - aTable->myRows->Append(GetRowTitle(anIndex)); - for(anIndex = 1; anIndex <= GetNbColumns(); anIndex++) - aTable->myCols->Append(GetColumnTitle(anIndex)); -} - - -Handle_TColStd_HSequenceOfInteger SALOMEDS_TableOfRealAttribute::GetSetRowIndices(const Standard_Integer theRow) -{ - Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger; - - Standard_Integer i, aShift = myNbColumns*(theRow-1); - for(i = 1; i <= myNbColumns; i++) { - if(myTable.IsBound(aShift + i)) aSeq->Append(i); - } - - return aSeq; -} - -Handle_TColStd_HSequenceOfInteger SALOMEDS_TableOfRealAttribute::GetSetColumnIndices(const Standard_Integer theColumn) -{ - Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger; - - Standard_Integer i, anIndex; - for(i = 1; i <= myNbRows; i++) { - anIndex = myNbColumns*(i-1)+theColumn; - if(myTable.IsBound(anIndex)) aSeq->Append(i); - } - - return aSeq; -} - - - -void SALOMEDS_TableOfRealAttribute::ConvertToString(ostrstream& theStream) -{ - int i, j, l; - - - //Title - l = myTitle.Length(); - theStream << l << "\n"; - for(i=1; i<=l; i++) - theStream << myTitle.Value(i) << "\n"; - - //Nb rows - theStream << myNbRows << "\n"; - - //Rows titles - for(i=1; i<=myNbRows; i++) { - l = myRows->Value(i).Length(); - theStream << l << "\n"; - for(j=1; j<=l; j++) - theStream << myRows->Value(i).Value(j) << "\n"; - } - - //Nb columns - theStream << myNbColumns << "\n"; - - //Columns titles - for(i=1; i<=myNbColumns; i++) { - l = myCols->Value(i).Length(); - theStream << l << "\n"; - for(j=1; j<=l; j++) - theStream << myCols->Value(i).Value(j) << "\n"; - } - - //Store the table values - l = myTable.Extent(); - theStream << l << "\n"; - char *aBuffer = new char[128]; - TColStd_DataMapIteratorOfDataMapOfIntegerReal anIterator(myTable); - for(; anIterator.More(); anIterator.Next()) { - theStream << anIterator.Key() << "\n"; - sprintf(aBuffer, "%.64e", anIterator.Value()); - theStream << aBuffer << "\n"; - } - - delete []aBuffer; - - return; -} - -bool SALOMEDS_TableOfRealAttribute::RestoreFromString(istrstream& theStream) -{ - Backup(); - - int i, j, l; - - Standard_ExtCharacter anExtChar; - TCollection_ExtendedString aStr; - - //Title - theStream >> l; - - myTitle = TCollection_ExtendedString(l, 0); - for(i=1; i<=l; i++) { - theStream >> anExtChar; - myTitle.SetValue(i, anExtChar); - } - - //Nb rows - theStream >> myNbRows; - - //Rows titles - myRows->Clear(); - for(i=1; i<=myNbRows; i++) { - theStream >> l; - aStr = TCollection_ExtendedString(l,0); - for(j=1; j<=l; j++) { - theStream >> anExtChar; - aStr.SetValue(j, anExtChar); - } - myRows->Append(aStr); - } - - //Nb columns - theStream >> myNbColumns; - - //Columns titles - myCols->Clear(); - for(i=1; i<=myNbColumns; i++) { - theStream >> l; - aStr = TCollection_ExtendedString(l,0); - for(j=1; j<=l; j++) { - theStream >> anExtChar; - aStr.SetValue(j, anExtChar); - } - myCols->Append(aStr); - } - - //Restore the table values - theStream >> l; - myTable.Clear(); - for(i=1; i<=l; i++) { - Standard_Integer aKey; - Standard_Real aValue; - theStream >> aKey; - theStream >> aValue; - myTable.Bind(aKey, aValue); - } - - return true; -} diff --git a/src/SALOMEDS/SALOMEDS_TableOfRealAttribute.hxx b/src/SALOMEDS/SALOMEDS_TableOfRealAttribute.hxx deleted file mode 100644 index a3d35069f..000000000 --- a/src/SALOMEDS/SALOMEDS_TableOfRealAttribute.hxx +++ /dev/null @@ -1,171 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : SALOMEDS_TableOfRealAttribute.hxx -// Author : Michael Ponikarov -// Module : SALOME -// $Header$ - -#ifndef _SALOMEDS_TableOfRealAttribute_HeaderFile -#define _SALOMEDS_TableOfRealAttribute_HeaderFile - -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Handle_SALOMEDS_TableOfRealAttribute_HeaderFile -#include -#endif - -#ifndef _TColStd_SequenceOfTransient_HeaderFile -#include -#endif -#ifndef _TCollection_ExtendedString_HeaderFile -#include -#endif -#ifndef _Handle_TColStd_HSequenceOfExtendedString_HeaderFile -#include -#endif - -#ifndef _TColStd_DataMapOfIntegerReal_HeaderFile -#include -#endif - -#ifndef _TDF_Attribute_HeaderFile -#include -#endif -#ifndef _Standard_Integer_HeaderFile -#include -#endif - -#ifndef _Handle_TColStd_HSequenceOfInteger_HeaderFile -#include -#endif - -#ifndef TColStd_HSequenceOfInteger_HeaderFile -#include -#endif - -#ifndef _Handle_TColStd_HSequenceOfReal_HeaderFile -#include -#endif -#ifndef _Standard_Boolean_HeaderFile -#include -#endif -#ifndef _Handle_TDF_Attribute_HeaderFile -#include -#endif -#ifndef _Handle_TDF_RelocationTable_HeaderFile -#include -#endif -class TColStd_HSequenceOfExtendedString; -class Standard_GUID; -class TDF_Label; -class TCollection_ExtendedString; -class TColStd_HSequenceOfReal; -class TDF_Attribute; -class TDF_RelocationTable; - -#include - -class SALOMEDS_TableOfRealAttribute : public TDF_Attribute { - -public: - - inline void* operator new(size_t,void* anAddress) - { - return anAddress; - } - inline void* operator new(size_t size) - { - return Standard::Allocate(size); - } - inline void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } -// inline void operator delete(void *anAddress, size_t size) -// { -// if (anAddress) Standard::Free((Standard_Address&)anAddress,size); -// } - // Methods PUBLIC - // -Standard_EXPORT static const Standard_GUID& GetID() ; -Standard_EXPORT static Handle_SALOMEDS_TableOfRealAttribute Set(const TDF_Label& label) ; -Standard_EXPORT SALOMEDS_TableOfRealAttribute(); -Standard_EXPORT void SetNbColumns(const Standard_Integer theNbColumns); -Standard_EXPORT void SetTitle(const TCollection_ExtendedString& theTitle) ; -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 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 TCollection_ExtendedString GetColumnTitle(const Standard_Integer theColumn) const; -Standard_EXPORT Standard_Integer GetNbRows() const; -Standard_EXPORT Standard_Integer GetNbColumns() const; - -Standard_EXPORT void PutValue(const Standard_Real theValue,const Standard_Integer theRow,const Standard_Integer theColumn) ; -Standard_EXPORT Standard_Boolean HasValue(const Standard_Integer theRow,const Standard_Integer theColumn) ; -Standard_EXPORT Standard_Real GetValue(const Standard_Integer theRow,const Standard_Integer theColumn) ; -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 Handle_TColStd_HSequenceOfInteger GetSetRowIndices(const Standard_Integer theRow); -Standard_EXPORT Handle_TColStd_HSequenceOfInteger GetSetColumnIndices(const Standard_Integer theColumn); - -Standard_EXPORT void ConvertToString(ostrstream& theStream); -Standard_EXPORT bool RestoreFromString(istrstream& theStream); - -Standard_EXPORT ~SALOMEDS_TableOfRealAttribute(); - - - - - // Type management - // - Standard_EXPORT friend Handle_Standard_Type& SALOMEDS_TableOfRealAttribute_Type_(); - Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // -TColStd_DataMapOfIntegerReal myTable; -TCollection_ExtendedString myTitle; -Handle_TColStd_HSequenceOfExtendedString myRows; -Handle_TColStd_HSequenceOfExtendedString myCols; -Standard_Integer myNbRows; -Standard_Integer myNbColumns; - -}; - - - - - -// other inline functions and methods (like "C++: function call" methods) -// - - -#endif diff --git a/src/SALOMEDS/SALOMEDS_TableOfRealAttribute.ixx b/src/SALOMEDS/SALOMEDS_TableOfRealAttribute.ixx deleted file mode 100644 index 3aa72a107..000000000 --- a/src/SALOMEDS/SALOMEDS_TableOfRealAttribute.ixx +++ /dev/null @@ -1,68 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : SALOMEDS_TableOfRealAttribute.ixx -// Author : Michael Ponikarov -// Module : SALOME -// $Header$ - -#include - -#ifndef _Standard_TypeMismatch_HeaderFile -#include -#endif - -SALOMEDS_TableOfRealAttribute::~SALOMEDS_TableOfRealAttribute() {} - - - -Standard_EXPORT Handle_Standard_Type& SALOMEDS_TableOfRealAttribute_Type_() -{ - - static Handle_Standard_Type aType1 = STANDARD_TYPE(TDF_Attribute); - if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TDF_Attribute); - static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); - if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared); - static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); - if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient); - - - static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; - static Handle_Standard_Type _aType = new Standard_Type("SALOMEDS_TableOfRealAttribute", - sizeof(SALOMEDS_TableOfRealAttribute), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); - - return _aType; -} - - -// DownCast method -// allow safe downcasting -// -const Handle(SALOMEDS_TableOfRealAttribute) Handle(SALOMEDS_TableOfRealAttribute)::DownCast(const Handle(Standard_Transient)& AnObject) -{ - Handle(SALOMEDS_TableOfRealAttribute) _anOtherObject; - - if (!AnObject.IsNull()) { - if (AnObject->IsKind(STANDARD_TYPE(SALOMEDS_TableOfRealAttribute))) { - _anOtherObject = Handle(SALOMEDS_TableOfRealAttribute)((Handle(SALOMEDS_TableOfRealAttribute)&)AnObject); - } - } - - return _anOtherObject ; -} -const Handle(Standard_Type)& SALOMEDS_TableOfRealAttribute::DynamicType() const -{ - return STANDARD_TYPE(SALOMEDS_TableOfRealAttribute) ; -} -Standard_Boolean SALOMEDS_TableOfRealAttribute::IsKind(const Handle(Standard_Type)& AType) const -{ - return (STANDARD_TYPE(SALOMEDS_TableOfRealAttribute) == AType || TDF_Attribute::IsKind(AType)); -} -Handle_SALOMEDS_TableOfRealAttribute::~Handle_SALOMEDS_TableOfRealAttribute() {} - diff --git a/src/SALOMEDS/SALOMEDS_TableOfRealAttribute.jxx b/src/SALOMEDS/SALOMEDS_TableOfRealAttribute.jxx deleted file mode 100644 index 3c068b7e3..000000000 --- a/src/SALOMEDS/SALOMEDS_TableOfRealAttribute.jxx +++ /dev/null @@ -1,35 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : SALOMEDS_TableOfRealAttribute.jxx -// Author : Michael Ponikarov -// Module : SALOME -// $Header$ - -#ifndef _TColStd_HSequenceOfExtendedString_HeaderFile -#include -#endif -#ifndef _Standard_GUID_HeaderFile -#include -#endif -#ifndef _TDF_Label_HeaderFile -#include -#endif -#ifndef _TCollection_ExtendedString_HeaderFile -#include -#endif -#ifndef _TColStd_HSequenceOfReal_HeaderFile -#include -#endif -#ifndef _TDF_Attribute_HeaderFile -#include -#endif -#ifndef _TDF_RelocationTable_HeaderFile -#include -#endif -#ifndef _SALOMEDS_TableOfRealAttribute_HeaderFile -#include -#endif diff --git a/src/SALOMEDS/SALOMEDS_TableOfStringAttribute.cxx b/src/SALOMEDS/SALOMEDS_TableOfStringAttribute.cxx deleted file mode 100644 index 9fe181205..000000000 --- a/src/SALOMEDS/SALOMEDS_TableOfStringAttribute.cxx +++ /dev/null @@ -1,423 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : SALOMEDS_TableOfStringAttribute.cxx -// Author : Sergey Ruin -// Module : SALOME - -#include -#include -#include - -#include -#include -using namespace std; - -const Standard_GUID& SALOMEDS_TableOfStringAttribute::GetID() -{ - static Standard_GUID SALOMEDS_TableOfStringAttributeID ("128371A4-8F52-11d6-A8A3-0001021E8C7F"); - return SALOMEDS_TableOfStringAttributeID; -} - -Handle(SALOMEDS_TableOfStringAttribute) SALOMEDS_TableOfStringAttribute::Set(const TDF_Label& label) -{ - Handle(SALOMEDS_TableOfStringAttribute) anAttr; - if (!label.FindAttribute(SALOMEDS_TableOfStringAttribute::GetID(),anAttr)) { - anAttr = new SALOMEDS_TableOfStringAttribute(); - label.AddAttribute(anAttr); - } - return anAttr; -} - -SALOMEDS_TableOfStringAttribute::SALOMEDS_TableOfStringAttribute() { - myRows = new TColStd_HSequenceOfExtendedString(); - myCols = new TColStd_HSequenceOfExtendedString(); - myNbRows = 0; - myNbColumns = 0; -} - -void SALOMEDS_TableOfStringAttribute::SetNbColumns(const Standard_Integer theNbColumns) -{ - Backup(); - - SALOMEDS_DataMapOfIntegerString aMap; - aMap = myTable; - myTable.Clear(); - - SALOMEDS_DataMapIteratorOfDataMapOfIntegerString anIterator(aMap); - for(; anIterator.More(); anIterator.Next()) { - int aRow = (int)(anIterator.Key()/myNbColumns) + 1; - int aCol = (int)(anIterator.Key() - myNbColumns*(aRow-1)); - if(aCol == 0) { aCol = myNbColumns; aRow--; } - if(aCol > theNbColumns) continue; - int aKey = (aRow-1)*theNbColumns+aCol; - myTable.Bind(aKey, anIterator.Value()); - } - - myNbColumns = theNbColumns; - - while (myCols->Length() < myNbColumns) { // append empty columns titles - myCols->Append(TCollection_ExtendedString("")); - } -} - -void SALOMEDS_TableOfStringAttribute::SetTitle(const TCollection_ExtendedString& theTitle) { - Backup(); - myTitle = theTitle; -} - -TCollection_ExtendedString SALOMEDS_TableOfStringAttribute::GetTitle() const { - return myTitle; -} - -void SALOMEDS_TableOfStringAttribute::SetRowData(const Standard_Integer theRow, - const Handle(TColStd_HSequenceOfExtendedString)& theData) -{ - if(theData->Length() > myNbColumns) SetNbColumns(theData->Length()); - - Backup(); - - while (myRows->Length() < theRow) { // append new row titles - myRows->Append(TCollection_ExtendedString("")); - } - - Standard_Integer i, aShift = (theRow-1)*myNbColumns, aLength = theData->Length(); - for(i = 1; i <= aLength; i++) { - myTable.Bind(aShift + i, theData->Value(i)); - } - - if(theRow > myNbRows) myNbRows = theRow; -} - -Handle(TColStd_HSequenceOfExtendedString) SALOMEDS_TableOfStringAttribute::GetRowData(const Standard_Integer theRow) -{ - Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString(); - Standard_Integer i, aShift = (theRow-1)*myNbColumns; - for(i = 1; i <= myNbColumns; i++) { - if(myTable.IsBound(aShift+i)) - aSeq->Append(myTable.Find(aShift+i)); - else - aSeq->Append(0.); - } - - return aSeq; -} - -void SALOMEDS_TableOfStringAttribute::SetRowTitle(const Standard_Integer theRow, - const TCollection_ExtendedString& theTitle) { - Backup(); - myRows->SetValue(theRow,theTitle); -} - -TCollection_ExtendedString SALOMEDS_TableOfStringAttribute::GetRowTitle(const Standard_Integer theRow) const { - return myRows->Value(theRow); -} - - -void SALOMEDS_TableOfStringAttribute::SetColumnData(const Standard_Integer theColumn, - const Handle(TColStd_HSequenceOfExtendedString)& theData) -{ - if(theColumn > myNbColumns) SetNbColumns(theColumn); - - Backup(); - - Standard_Integer i, aLength = theData->Length(); - for(i = 1; i <= aLength; i++) { - myTable.Bind(myNbColumns*(i-1)+theColumn, theData->Value(i)); - } - - if(aLength > myNbRows) { - myNbRows = aLength; - while (myRows->Length() < myNbRows) { // append empty row titles - myRows->Append(TCollection_ExtendedString("")); - } - } -} - - -Handle(TColStd_HSequenceOfExtendedString) SALOMEDS_TableOfStringAttribute::GetColumnData(const Standard_Integer theColumn) -{ - Handle(TColStd_HSequenceOfExtendedString) aSeq = new TColStd_HSequenceOfExtendedString; - - Standard_Integer i, anIndex; - for(i = 1; i <= myNbRows; i++) { - anIndex = myNbColumns*(i-1) + theColumn; - if(myTable.IsBound(anIndex)) - aSeq->Append(myTable.Find(anIndex)); - else - aSeq->Append(0.); - } - - return aSeq; -} - -void SALOMEDS_TableOfStringAttribute::SetColumnTitle(const Standard_Integer theColumn, - const TCollection_ExtendedString& theTitle) { - Backup(); - while(myCols->Length() < theColumn) myCols->Append(TCollection_ExtendedString("")); - myCols->SetValue(theColumn,theTitle); -} - -TCollection_ExtendedString SALOMEDS_TableOfStringAttribute::GetColumnTitle(const Standard_Integer theColumn) const { - if(myCols.IsNull()) return ""; - if(myCols->Length() < theColumn) return ""; - return myCols->Value(theColumn); -} - - -Standard_Integer SALOMEDS_TableOfStringAttribute::GetNbRows() const -{ - return myNbRows; -} - -Standard_Integer SALOMEDS_TableOfStringAttribute::GetNbColumns() const -{ - return myNbColumns; -} - -void SALOMEDS_TableOfStringAttribute::PutValue(const TCollection_ExtendedString& theValue, - const Standard_Integer theRow, - const Standard_Integer theColumn) -{ - if(theColumn > myNbColumns) SetNbColumns(theColumn); - - Standard_Integer anIndex = (theRow-1)*myNbColumns + theColumn; - myTable.Bind(anIndex, theValue); - - if(theRow > myNbRows) { - while (myRows->Length() < theRow) { // append empty row titles - myRows->Append(TCollection_ExtendedString("")); - } - myNbRows = theRow; - } -} - -Standard_Boolean SALOMEDS_TableOfStringAttribute::HasValue(const Standard_Integer theRow, - const Standard_Integer theColumn) -{ - Standard_Integer anIndex = (theRow-1)*myNbColumns + theColumn; - return myTable.IsBound(anIndex); -} - -TCollection_ExtendedString SALOMEDS_TableOfStringAttribute::GetValue(const Standard_Integer theRow, - const Standard_Integer theColumn) -{ - Standard_Integer anIndex = (theRow-1)*myNbColumns + theColumn; - if(myTable.IsBound(anIndex)) return myTable.Find(anIndex); - - Standard_Failure::Raise("Invalid cell index"); - return 0.; -} - -const Standard_GUID& SALOMEDS_TableOfStringAttribute::ID() const -{ - return GetID(); -} - -void SALOMEDS_TableOfStringAttribute::Restore(const Handle(TDF_Attribute)& with) -{ - Standard_Integer anIndex; - Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(with); - - myTable.Clear(); - myCols->Clear(); - myRows->Clear(); - - myTable = aTable->myTable; - myNbRows = aTable->myNbRows; - myNbColumns = aTable->myNbColumns; - myTitle = aTable->myTitle; - - for(anIndex = 1; anIndex <= aTable->GetNbRows();anIndex++) - myRows->Append(aTable->GetRowTitle(anIndex)); - - for(anIndex = 1; anIndex <= aTable->GetNbColumns(); anIndex++) - myCols->Append(aTable->GetColumnTitle(anIndex)); -} - -Handle(TDF_Attribute) SALOMEDS_TableOfStringAttribute::NewEmpty() const -{ - return new SALOMEDS_TableOfStringAttribute(); -} - -void SALOMEDS_TableOfStringAttribute::Paste(const Handle(TDF_Attribute)& into, - const Handle(TDF_RelocationTable)&) const -{ - Standard_Integer anIndex; - Handle(SALOMEDS_TableOfStringAttribute) aTable = Handle(SALOMEDS_TableOfStringAttribute)::DownCast(into); - - aTable->myTable.Clear(); - aTable->myCols->Clear(); - aTable->myRows->Clear(); - - aTable->myTable = myTable; - aTable->myTitle = myTitle; - aTable->myNbRows = myNbRows; - aTable->myNbColumns = myNbColumns; - - for(anIndex = 1; anIndex <= GetNbRows();anIndex++) - aTable->myRows->Append(GetRowTitle(anIndex)); - for(anIndex = 1; anIndex <= GetNbColumns(); anIndex++) - aTable->myCols->Append(GetColumnTitle(anIndex)); -} - - -Handle_TColStd_HSequenceOfInteger SALOMEDS_TableOfStringAttribute::GetSetRowIndices(const Standard_Integer theRow) -{ - Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger; - - Standard_Integer i, aShift = myNbColumns*(theRow-1); - for(i = 1; i <= myNbColumns; i++) { - if(myTable.IsBound(aShift + i)) aSeq->Append(i); - } - - return aSeq; -} - -Handle_TColStd_HSequenceOfInteger SALOMEDS_TableOfStringAttribute::GetSetColumnIndices(const Standard_Integer theColumn) -{ - Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger; - - Standard_Integer i, anIndex; - for(i = 1; i <= myNbRows; i++) { - anIndex = myNbColumns*(i-1)+theColumn; - if(myTable.IsBound(anIndex)) aSeq->Append(i); - } - - return aSeq; -} - - - -void SALOMEDS_TableOfStringAttribute::ConvertToString(ostrstream& theStream) -{ - int i, j, l; - - //Title - l = myTitle.Length(); - theStream << l << "\n"; - for(i=1; i<=l; i++) - theStream << myTitle.Value(i) << "\n"; - - //Nb rows - theStream << myNbRows << "\n"; - - //Rows titles - for(i=1; i<=myNbRows; i++) { - l = myRows->Value(i).Length(); - theStream << l << "\n"; - for(j=1; j<=l; j++) - theStream << myRows->Value(i).Value(j) << "\n"; - } - - //Nb columns - theStream << myNbColumns << "\n"; - - //Columns titles - for(i=1; i<=myNbColumns; i++) { - l = myCols->Value(i).Length(); - theStream << l << "\n"; - for(j=1; j<=l; j++) - theStream << myCols->Value(i).Value(j) << "\n"; - } - - //Store the table values - l = myTable.Extent(); - theStream << l << "\n"; - SALOMEDS_DataMapIteratorOfDataMapOfIntegerString anIterator(myTable); - for(; anIterator.More(); anIterator.Next()) { - if (anIterator.Value().Length()) { // check empty string in the value table - theStream << anIterator.Key() << "\n"; - unsigned long aValueSize = anIterator.Value().Length(); - theStream<> l; - - myTitle = TCollection_ExtendedString(l, 0); - for(i=1; i<=l; i++) { - theStream >> anExtChar; - myTitle.SetValue(i, anExtChar); - } - - //Nb rows - theStream >> myNbRows; - - //Rows titles - myRows->Clear(); - for(i=1; i<=myNbRows; i++) { - theStream >> l; - aStr = TCollection_ExtendedString(l,0); - for(j=1; j<=l; j++) { - theStream >> anExtChar; - aStr.SetValue(j, anExtChar); - } - myRows->Append(aStr); - } - - //Nb columns - theStream >> myNbColumns; - - //Columns titles - myCols->Clear(); - for(i=1; i<=myNbColumns; i++) { - theStream >> l; - aStr = TCollection_ExtendedString(l,0); - for(j=1; j<=l; j++) { - theStream >> anExtChar; - aStr.SetValue(j, anExtChar); - } - myCols->Append(aStr); - } - - //Restore the table values - TCollection_AsciiString aValue; - theStream >> l; - myTable.Clear(); - theStream.getline(aValueString,aSize,'\n'); - for(i=1; i<=l; i++) { - Standard_Integer aKey; - - theStream.getline(aValueString,aSize,'\n'); - aValue = aValueString; - aKey = aValue.IntegerValue(); - if (aValue.Value(1) == '0') - aValue = ""; - else { - unsigned long aValueSize; - theStream >> aValueSize; - theStream.read(aValueString, 1); // an '\n' omitting - theStream.read(aValueString, aValueSize); - theStream.read(aValueString, 1); // an '\n' omitting - aValue = aValueString; - } - myTable.Bind(aKey, aValue); - } - delete(aValueString); - return true; -} diff --git a/src/SALOMEDS/SALOMEDS_TableOfStringAttribute.hxx b/src/SALOMEDS/SALOMEDS_TableOfStringAttribute.hxx deleted file mode 100644 index ce835f6bd..000000000 --- a/src/SALOMEDS/SALOMEDS_TableOfStringAttribute.hxx +++ /dev/null @@ -1,170 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : SALOMEDS_TableOfStringAttribute.hxx -// Author : Sergey Ruin -// Module : SALOME - -#ifndef _SALOMEDS_TableOfStringAttribute_HeaderFile -#define _SALOMEDS_TableOfStringAttribute_HeaderFile - -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Handle_SALOMEDS_TableOfStringAttribute_HeaderFile -#include -#endif - -#ifndef _TColStd_SequenceOfTransient_HeaderFile -#include -#endif -#ifndef _TCollection_ExtendedString_HeaderFile -#include -#endif -#ifndef _Handle_TColStd_HSequenceOfExtendedString_HeaderFile -#include -#endif - -#ifndef _SALOMEDS_DataMapOfIntegerString_HeaderFile -#include -#endif - -#ifndef _TDF_Attribute_HeaderFile -#include -#endif -#ifndef _Standard_Integer_HeaderFile -#include -#endif - -#ifndef _Handle_TColStd_HSequenceOfInteger_HeaderFile -#include -#endif - -#ifndef TColStd_HSequenceOfInteger_HeaderFile -#include -#endif - -#ifndef _Handle_TColStd_HSequenceOfExtendedString_HeaderFile -#include -#endif -#ifndef _Standard_Boolean_HeaderFile -#include -#endif -#ifndef _Handle_TDF_Attribute_HeaderFile -#include -#endif -#ifndef _Handle_TDF_RelocationTable_HeaderFile -#include -#endif -class TColStd_HSequenceOfExtendedString; -class Standard_GUID; -class TDF_Label; -class TCollection_ExtendedString; -class TColStd_HSequenceOfExtendedString; -class TDF_Attribute; -class TDF_RelocationTable; - -#include - -class SALOMEDS_TableOfStringAttribute : public TDF_Attribute { - -public: - - inline void* operator new(size_t,void* anAddress) - { - return anAddress; - } - inline void* operator new(size_t size) - { - return Standard::Allocate(size); - } - inline void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } -// inline void operator delete(void *anAddress, size_t size) -// { -// if (anAddress) Standard::Free((Standard_Address&)anAddress,size); -// } - // Methods PUBLIC - // -Standard_EXPORT static const Standard_GUID& GetID() ; -Standard_EXPORT static Handle_SALOMEDS_TableOfStringAttribute Set(const TDF_Label& label) ; -Standard_EXPORT SALOMEDS_TableOfStringAttribute(); -Standard_EXPORT void SetNbColumns(const Standard_Integer theNbColumns); -Standard_EXPORT void SetTitle(const TCollection_ExtendedString& theTitle) ; -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 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 Standard_Integer GetNbRows() const; -Standard_EXPORT Standard_Integer GetNbColumns() const; - -Standard_EXPORT void PutValue(const TCollection_ExtendedString& theValue,const Standard_Integer theRow,const Standard_Integer theColumn) ; -Standard_EXPORT Standard_Boolean HasValue(const Standard_Integer theRow,const Standard_Integer theColumn) ; -Standard_EXPORT TCollection_ExtendedString GetValue(const Standard_Integer theRow,const Standard_Integer theColumn) ; -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 Handle_TColStd_HSequenceOfInteger GetSetRowIndices(const Standard_Integer theRow); -Standard_EXPORT Handle_TColStd_HSequenceOfInteger GetSetColumnIndices(const Standard_Integer theColumn); - -Standard_EXPORT void ConvertToString(ostrstream& theStream); -Standard_EXPORT bool RestoreFromString(istrstream& theStream); - -Standard_EXPORT ~SALOMEDS_TableOfStringAttribute(); - - - - - // Type management - // - Standard_EXPORT friend Handle_Standard_Type& SALOMEDS_TableOfStringAttribute_Type_(); - Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // -SALOMEDS_DataMapOfIntegerString myTable; -TCollection_ExtendedString myTitle; -Handle_TColStd_HSequenceOfExtendedString myRows; -Handle_TColStd_HSequenceOfExtendedString myCols; -Standard_Integer myNbRows; -Standard_Integer myNbColumns; - -}; - - - - - -// other inline functions and methods (like "C++: function call" methods) -// - - -#endif diff --git a/src/SALOMEDS/SALOMEDS_TableOfStringAttribute.ixx b/src/SALOMEDS/SALOMEDS_TableOfStringAttribute.ixx deleted file mode 100644 index 487845fb3..000000000 --- a/src/SALOMEDS/SALOMEDS_TableOfStringAttribute.ixx +++ /dev/null @@ -1,67 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : SALOMEDS_TableOfStringAttribute.ixx -// Author : Sergey Ruin -// Module : SALOME - -#include - -#ifndef _Standard_TypeMismatch_HeaderFile -#include -#endif - -SALOMEDS_TableOfStringAttribute::~SALOMEDS_TableOfStringAttribute() {} - - - -Standard_EXPORT Handle_Standard_Type& SALOMEDS_TableOfStringAttribute_Type_() -{ - - static Handle_Standard_Type aType1 = STANDARD_TYPE(TDF_Attribute); - if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TDF_Attribute); - static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); - if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared); - static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); - if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient); - - - static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; - static Handle_Standard_Type _aType = new Standard_Type("SALOMEDS_TableOfStringAttribute", - sizeof(SALOMEDS_TableOfStringAttribute), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); - - return _aType; -} - - -// DownCast method -// allow safe downcasting -// -const Handle(SALOMEDS_TableOfStringAttribute) Handle(SALOMEDS_TableOfStringAttribute)::DownCast(const Handle(Standard_Transient)& AnObject) -{ - Handle(SALOMEDS_TableOfStringAttribute) _anOtherObject; - - if (!AnObject.IsNull()) { - if (AnObject->IsKind(STANDARD_TYPE(SALOMEDS_TableOfStringAttribute))) { - _anOtherObject = Handle(SALOMEDS_TableOfStringAttribute)((Handle(SALOMEDS_TableOfStringAttribute)&)AnObject); - } - } - - return _anOtherObject ; -} -const Handle(Standard_Type)& SALOMEDS_TableOfStringAttribute::DynamicType() const -{ - return STANDARD_TYPE(SALOMEDS_TableOfStringAttribute) ; -} -Standard_Boolean SALOMEDS_TableOfStringAttribute::IsKind(const Handle(Standard_Type)& AType) const -{ - return (STANDARD_TYPE(SALOMEDS_TableOfStringAttribute) == AType || TDF_Attribute::IsKind(AType)); -} -Handle_SALOMEDS_TableOfStringAttribute::~Handle_SALOMEDS_TableOfStringAttribute() {} - diff --git a/src/SALOMEDS/SALOMEDS_TableOfStringAttribute.jxx b/src/SALOMEDS/SALOMEDS_TableOfStringAttribute.jxx deleted file mode 100644 index dfee582c3..000000000 --- a/src/SALOMEDS/SALOMEDS_TableOfStringAttribute.jxx +++ /dev/null @@ -1,34 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : SALOMEDS_TableOfStringAttribute.jxx -// Author : Sergey Ruin -// Module : SALOME - -#ifndef _TColStd_HSequenceOfExtendedString_HeaderFile -#include -#endif -#ifndef _Standard_GUID_HeaderFile -#include -#endif -#ifndef _TDF_Label_HeaderFile -#include -#endif -#ifndef _TCollection_ExtendedString_HeaderFile -#include -#endif -#ifndef _TColStd_HSequenceOfExtendedString_HeaderFile -#include -#endif -#ifndef _TDF_Attribute_HeaderFile -#include -#endif -#ifndef _TDF_RelocationTable_HeaderFile -#include -#endif -#ifndef _SALOMEDS_TableOfStringAttribute_HeaderFile -#include -#endif diff --git a/src/SALOMEDS/SALOMEDS_TargetAttribute.cdl b/src/SALOMEDS/SALOMEDS_TargetAttribute.cdl deleted file mode 100644 index 85191eed6..000000000 --- a/src/SALOMEDS/SALOMEDS_TargetAttribute.cdl +++ /dev/null @@ -1,74 +0,0 @@ --- SALOME SALOMEDS : data structure of SALOME and sources of Salome data server --- --- Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, --- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS --- --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Lesser General Public --- License as published by the Free Software Foundation; either --- version 2.1 of the License. --- --- This library is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- Lesser General Public License for more details. --- --- You should have received a copy of the GNU Lesser General Public --- License along with this library; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --- --- See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org --- --- --- --- File : SALOMEDS_TargetAttribute.cdl --- Author : Yves FRICAUD --- Module : SALOME - -class TargetAttribute from SALOMEDS inherits Relation from TDataStd - - ---Purpose: - - -uses Attribute from TDF, - Label from TDF, - GUID from Standard, - RelocationTable from TDF, - LabelList from TDF - -is - - - ---Purpose: class methods - -- ============= - - GetID (myclass) - ---C++: return const & - returns GUID from Standard; - - Set (myclass; label : Label from TDF) - returns TargetAttribute from SALOMEDS; - - ---Purpose: Comment methods - -- ============ - - Create - returns mutable TargetAttribute from SALOMEDS; - - Append(me: mutable; theReferencedObject : mutable Label form TDF); - Get(me; theReferencedObjects : mutable : LabelList from TDF); - Remove(me: mutable; theReferencedObject : mutable Label form TDF); - - ID (me) - ---C++: return const & - returns GUID from Standard; - - Restore (me: mutable; with : Attribute from TDF); - - NewEmpty (me) - returns mutable Attribute from TDF; - - Paste (me; into : mutable Attribute from TDF; - RT : mutable RelocationTable from TDF); - -end TargetAttribute; diff --git a/src/SALOMEDS/SALOMEDS_TargetAttribute.cxx b/src/SALOMEDS/SALOMEDS_TargetAttribute.cxx deleted file mode 100644 index a57efc214..000000000 --- a/src/SALOMEDS/SALOMEDS_TargetAttribute.cxx +++ /dev/null @@ -1,122 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SALOMEDS_TargetAttribute.cxx -// Author : Yves FRICAUD -// Module : SALOME -// $Header$ - -#include "SALOMEDS_TargetAttribute.ixx" -#include -#include -#include "utilities.h" -using namespace std; - -//======================================================================= -//function : GetID -//purpose : -//======================================================================= - -const Standard_GUID& SALOMEDS_TargetAttribute::GetID () -{ - static Standard_GUID SALOMEDS_TargetAttributeID ("12837197-8F52-11d6-A8A3-0001021E8C7F"); - return SALOMEDS_TargetAttributeID; -} - - - -//======================================================================= -//function : Set -//purpose : -//======================================================================= - -Handle(SALOMEDS_TargetAttribute) SALOMEDS_TargetAttribute::Set (const TDF_Label& L) -{ - Handle(SALOMEDS_TargetAttribute) A; - if (!L.FindAttribute(SALOMEDS_TargetAttribute::GetID(),A)) { - A = new SALOMEDS_TargetAttribute(); - L.AddAttribute(A); - } - return A; -} - - -//======================================================================= -//function : constructor -//purpose : -//======================================================================= -SALOMEDS_TargetAttribute::SALOMEDS_TargetAttribute() -{} - -//======================================================================= -//function : Append -//purpose : -//======================================================================= - -void SALOMEDS_TargetAttribute::Append(TDF_Label& theReferencedObject) { - Backup(); - Handle(TDF_Reference) aReference; - if (theReferencedObject.FindAttribute(TDF_Reference::GetID(),aReference)) { - TDF_ListIteratorOfAttributeList anIter(GetVariables()); - for(;anIter.More();anIter.Next()) if(anIter.Value()->Label() == theReferencedObject) return; //BugID: PAL6192 - GetVariables().Append(aReference); - } else { - MESSAGE("SALOMEDS_TargetAttribute::Append: can't append referenced object"); - } -} - -//======================================================================= -//function : Get -//purpose : -//======================================================================= -void SALOMEDS_TargetAttribute::Get(TDF_LabelList& theReferencedObjects) { - theReferencedObjects.Clear(); - TDF_ListIteratorOfAttributeList anIter(GetVariables()); - for(;anIter.More();anIter.Next()) { - theReferencedObjects.Append(anIter.Value()->Label()); - } -} - -//======================================================================= -//function : Remove -//purpose : -//======================================================================= -void SALOMEDS_TargetAttribute::Remove(TDF_Label& theReferencedObject) { - Backup(); - TDF_ListIteratorOfAttributeList anIter(GetVariables()); - for(;anIter.More();anIter.Next()) { - if (anIter.Value()->Label() == theReferencedObject) { - GetVariables().Remove(anIter); - return; - } - } - MESSAGE("SALOMEDS_TargetAttribute::Remove: nothing to remove"); -} - -//======================================================================= -//function : ID -//purpose : -//======================================================================= - -const Standard_GUID& SALOMEDS_TargetAttribute::ID () const { return GetID(); } - diff --git a/src/SALOMEDS/SALOMEDS_TargetAttribute.hxx b/src/SALOMEDS/SALOMEDS_TargetAttribute.hxx deleted file mode 100644 index 8b63cb886..000000000 --- a/src/SALOMEDS/SALOMEDS_TargetAttribute.hxx +++ /dev/null @@ -1,133 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SALOMEDS_TargetAttribute.hxx -// Author : Yves FRICAUD -// Module : SALOME -// $Header$ - -#ifndef _SALOMEDS_TargetAttribute_HeaderFile -#define _SALOMEDS_TargetAttribute_HeaderFile - -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Handle_SALOMEDS_TargetAttribute_HeaderFile -#include -#endif - -#include -#ifndef _Handle_TDF_Attribute_HeaderFile -#include -#endif -#ifndef _Handle_TDF_RelocationTable_HeaderFile -#include -#endif -#ifndef _TDF_LabelList_HeaderFile -#include -#endif -#ifndef _Handle_TDF_Reference_HeaderFile -#include -#endif -class Standard_GUID; -class TDF_Label; -class TDF_Attribute; -class TDF_RelocationTable; - - -class SALOMEDS_TargetAttribute : public TDataStd_Relation { - -public: - - inline void* operator new(size_t,void* anAddress) - { - return anAddress; - } - inline void* operator new(size_t size) - { - return Standard::Allocate(size); - } - inline void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } -// inline void operator delete(void *anAddress, size_t size) -// { -// if (anAddress) Standard::Free((Standard_Address&)anAddress,size); -// } - // Methods PUBLIC - // -Standard_EXPORT static const Standard_GUID& GetID() ; -Standard_EXPORT static Handle_SALOMEDS_TargetAttribute Set(const TDF_Label& label) ; -Standard_EXPORT SALOMEDS_TargetAttribute(); -Standard_EXPORT void SALOMEDS_TargetAttribute::Append(TDF_Label& theReferencedObject); -Standard_EXPORT void SALOMEDS_TargetAttribute::Get(TDF_LabelList& theReferencedObjects); -Standard_EXPORT void SALOMEDS_TargetAttribute::Remove(TDF_Label& theReferencedObject); -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 ~SALOMEDS_TargetAttribute(); - - - - - // Type management - // - Standard_EXPORT friend Handle_Standard_Type& SALOMEDS_TargetAttribute_Type_(); - Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - - -}; - - - - - -// other inline functions and methods (like "C++: function call" methods) -// - - -#endif diff --git a/src/SALOMEDS/SALOMEDS_TargetAttribute.ixx b/src/SALOMEDS/SALOMEDS_TargetAttribute.ixx deleted file mode 100644 index 7fac6a9e1..000000000 --- a/src/SALOMEDS/SALOMEDS_TargetAttribute.ixx +++ /dev/null @@ -1,87 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SALOMEDS_TargetAttribute.ixx -// Author : Yves FRICAUD -// Module : SALOME -// $Header$ - -#include "SALOMEDS_TargetAttribute.jxx" - -#ifndef _Standard_TypeMismatch_HeaderFile -#include -#endif - -SALOMEDS_TargetAttribute::~SALOMEDS_TargetAttribute() {} - - - -Standard_EXPORT Handle_Standard_Type& SALOMEDS_TargetAttribute_Type_() -{ - - static Handle_Standard_Type aType1 = STANDARD_TYPE(TDataStd_Relation); - if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TDataStd_Relation); - static Handle_Standard_Type aType2 = STANDARD_TYPE(TDF_Attribute); - if ( aType2.IsNull()) aType2 = STANDARD_TYPE(TDF_Attribute); - static Handle_Standard_Type aType3 = STANDARD_TYPE(MMgt_TShared); - if ( aType3.IsNull()) aType3 = STANDARD_TYPE(MMgt_TShared); - static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient); - if ( aType4.IsNull()) aType4 = STANDARD_TYPE(Standard_Transient); - - - static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL}; - static Handle_Standard_Type _aType = new Standard_Type("SALOMEDS_TargetAttribute", - sizeof(SALOMEDS_TargetAttribute), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); - - return _aType; -} - - -// DownCast method -// allow safe downcasting -// -const Handle(SALOMEDS_TargetAttribute) Handle(SALOMEDS_TargetAttribute)::DownCast(const Handle(Standard_Transient)& AnObject) -{ - Handle(SALOMEDS_TargetAttribute) _anOtherObject; - - if (!AnObject.IsNull()) { - if (AnObject->IsKind(STANDARD_TYPE(SALOMEDS_TargetAttribute))) { - _anOtherObject = Handle(SALOMEDS_TargetAttribute)((Handle(SALOMEDS_TargetAttribute)&)AnObject); - } - } - - return _anOtherObject ; -} -const Handle(Standard_Type)& SALOMEDS_TargetAttribute::DynamicType() const -{ - return STANDARD_TYPE(SALOMEDS_TargetAttribute) ; -} -Standard_Boolean SALOMEDS_TargetAttribute::IsKind(const Handle(Standard_Type)& AType) const -{ - return (STANDARD_TYPE(SALOMEDS_TargetAttribute) == AType || TDataStd_Relation::IsKind(AType)); -} -Handle_SALOMEDS_TargetAttribute::~Handle_SALOMEDS_TargetAttribute() {} - diff --git a/src/SALOMEDS/SALOMEDS_TargetAttribute.jxx b/src/SALOMEDS/SALOMEDS_TargetAttribute.jxx deleted file mode 100644 index eff35ad6a..000000000 --- a/src/SALOMEDS/SALOMEDS_TargetAttribute.jxx +++ /dev/null @@ -1,43 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SALOMEDS_TargetAttribute.jxx -// Author : Yves FRICAUD -// Module : SALOME -// $Header$ - -#ifndef _Standard_GUID_HeaderFile -#include -#endif -#ifndef _TDF_Label_HeaderFile -#include -#endif -#ifndef _TDF_Attribute_HeaderFile -#include -#endif -#ifndef _TDF_RelocationTable_HeaderFile -#include -#endif -#ifndef _SALOMEDS_TargetAttribute_HeaderFile -#include "SALOMEDS_TargetAttribute.hxx" -#endif diff --git a/src/SALOMEDS/SALOMEDS_TextColorAttribute.cdl b/src/SALOMEDS/SALOMEDS_TextColorAttribute.cdl deleted file mode 100644 index aa8059d03..000000000 --- a/src/SALOMEDS/SALOMEDS_TextColorAttribute.cdl +++ /dev/null @@ -1,72 +0,0 @@ --- SALOME SALOMEDS : data structure of SALOME and sources of Salome data server --- --- Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, --- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS --- --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Lesser General Public --- License as published by the Free Software Foundation; either --- version 2.1 of the License. --- --- This library is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- Lesser General Public License for more details. --- --- You should have received a copy of the GNU Lesser General Public --- License along with this library; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --- --- See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org --- --- --- --- File : SALOMEDS_TextColorAttribute.cdl --- Author : Yves FRICAUD --- Module : SALOME - -class TextColorAttribute from SALOMEDS inherits RealArray from TDataStd - - ---Purpose: - - -uses Attribute from TDF, - Label from TDF, - GUID from Standard, - ExtendedString from TCollection, - DataSet from TDF, - RelocationTable from TDF, - AttributeSequence from TDF, - Data from TDF, - Comment from TDataStd - - -is - - - ---Purpose: class methods - -- ============= - - GetID (myclass) - ---C++: return const & - returns GUID from Standard; - - ---Purpose: Comment methods - -- ============ - - Create - returns mutable TextColorAttribute from SALOMEDS; - - ID (me) - ---C++: return const & - returns GUID from Standard; - - Restore (me: mutable; with : Attribute from TDF); - - NewEmpty (me) - returns mutable Attribute from TDF; - - Paste (me; into : mutable Attribute from TDF; - RT : mutable RelocationTable from TDF); - -end TextColorAttribute; diff --git a/src/SALOMEDS/SALOMEDS_TextColorAttribute.cxx b/src/SALOMEDS/SALOMEDS_TextColorAttribute.cxx deleted file mode 100644 index 33f137c20..000000000 --- a/src/SALOMEDS/SALOMEDS_TextColorAttribute.cxx +++ /dev/null @@ -1,93 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SALOMEDS_TextColorAttribute.cxx -// Author : Yves FRICAUD -// Module : SALOME -// $Header$ - -#include "SALOMEDS_TextColorAttribute.ixx" -using namespace std; - -//======================================================================= -//function : GetID -//purpose : -//======================================================================= - -const Standard_GUID& SALOMEDS_TextColorAttribute::GetID () -{ - static Standard_GUID SALOMEDS_TextColorAttributeID ("12837189-8F52-11d6-A8A3-0001021E8C7F"); - return SALOMEDS_TextColorAttributeID; -} - - - - -//======================================================================= -//function : constructor -//purpose : -//======================================================================= -SALOMEDS_TextColorAttribute::SALOMEDS_TextColorAttribute() -{Init(1,3);} - -//======================================================================= -//function : ID -//purpose : -//======================================================================= - -const Standard_GUID& SALOMEDS_TextColorAttribute::ID () const { return GetID(); } - - -//======================================================================= -//function : NewEmpty -//purpose : -//======================================================================= - -Handle(TDF_Attribute) SALOMEDS_TextColorAttribute::NewEmpty () const -{ - return new SALOMEDS_TextColorAttribute(); -} - -//======================================================================= -//function : Restore -//purpose : -//======================================================================= - -void SALOMEDS_TextColorAttribute::Restore(const Handle(TDF_Attribute)& with) -{ - Handle(TColStd_HArray1OfReal) s = Handle(TDataStd_RealArray)::DownCast (with)->Array (); - TDataStd_RealArray::ChangeArray(s); - return; -} - -//======================================================================= -//function : Paste -//purpose : -//======================================================================= - -void SALOMEDS_TextColorAttribute::Paste (const Handle(TDF_Attribute)& into, - const Handle(TDF_RelocationTable)& RT) const -{ - Handle(TDataStd_RealArray)::DownCast (into)->ChangeArray (Array()); -} - diff --git a/src/SALOMEDS/SALOMEDS_TextColorAttribute.hxx b/src/SALOMEDS/SALOMEDS_TextColorAttribute.hxx deleted file mode 100644 index 9478017d9..000000000 --- a/src/SALOMEDS/SALOMEDS_TextColorAttribute.hxx +++ /dev/null @@ -1,122 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SALOMEDS_TextColorAttribute.hxx -// Author : Yves FRICAUD -// Module : SALOME -// $Header$ - -#ifndef _SALOMEDS_TextColorAttribute_HeaderFile -#define _SALOMEDS_TextColorAttribute_HeaderFile - -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Handle_SALOMEDS_TextColorAttribute_HeaderFile -#include -#endif - -#ifndef _TDataStd_RealArray_HeaderFile -#include -#endif -#ifndef _Handle_TDF_Attribute_HeaderFile -#include -#endif -#ifndef _Handle_TDF_RelocationTable_HeaderFile -#include -#endif -class Standard_GUID; -class TDF_Attribute; -class TDF_RelocationTable; - - -class SALOMEDS_TextColorAttribute : public TDataStd_RealArray { - -public: - - inline void* operator new(size_t,void* anAddress) - { - return anAddress; - } - inline void* operator new(size_t size) - { - return Standard::Allocate(size); - } - inline void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } -// inline void operator delete(void *anAddress, size_t size) -// { -// if (anAddress) Standard::Free((Standard_Address&)anAddress,size); -// } - // Methods PUBLIC - // -Standard_EXPORT static const Standard_GUID& GetID() ; -Standard_EXPORT SALOMEDS_TextColorAttribute(); -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 ~SALOMEDS_TextColorAttribute(); - - - - - // Type management - // - Standard_EXPORT friend Handle_Standard_Type& SALOMEDS_TextColorAttribute_Type_(); - Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - - -}; - - - - - -// other inline functions and methods (like "C++: function call" methods) -// - - -#endif diff --git a/src/SALOMEDS/SALOMEDS_TextColorAttribute.ixx b/src/SALOMEDS/SALOMEDS_TextColorAttribute.ixx deleted file mode 100644 index 850605f71..000000000 --- a/src/SALOMEDS/SALOMEDS_TextColorAttribute.ixx +++ /dev/null @@ -1,87 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SALOMEDS_TextColorAttribute.ixx -// Author : Yves FRICAUD -// Module : SALOME -// $Header$ - -#include "SALOMEDS_TextColorAttribute.jxx" - -#ifndef _Standard_TypeMismatch_HeaderFile -#include -#endif - -SALOMEDS_TextColorAttribute::~SALOMEDS_TextColorAttribute() {} - - - -Standard_EXPORT Handle_Standard_Type& SALOMEDS_TextColorAttribute_Type_() -{ - - static Handle_Standard_Type aType1 = STANDARD_TYPE(TDataStd_RealArray); - if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TDataStd_RealArray); - static Handle_Standard_Type aType2 = STANDARD_TYPE(TDF_Attribute); - if ( aType2.IsNull()) aType2 = STANDARD_TYPE(TDF_Attribute); - static Handle_Standard_Type aType3 = STANDARD_TYPE(MMgt_TShared); - if ( aType3.IsNull()) aType3 = STANDARD_TYPE(MMgt_TShared); - static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient); - if ( aType4.IsNull()) aType4 = STANDARD_TYPE(Standard_Transient); - - - static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL}; - static Handle_Standard_Type _aType = new Standard_Type("SALOMEDS_TextColorAttribute", - sizeof(SALOMEDS_TextColorAttribute), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); - - return _aType; -} - - -// DownCast method -// allow safe downcasting -// -const Handle(SALOMEDS_TextColorAttribute) Handle(SALOMEDS_TextColorAttribute)::DownCast(const Handle(Standard_Transient)& AnObject) -{ - Handle(SALOMEDS_TextColorAttribute) _anOtherObject; - - if (!AnObject.IsNull()) { - if (AnObject->IsKind(STANDARD_TYPE(SALOMEDS_TextColorAttribute))) { - _anOtherObject = Handle(SALOMEDS_TextColorAttribute)((Handle(SALOMEDS_TextColorAttribute)&)AnObject); - } - } - - return _anOtherObject ; -} -const Handle(Standard_Type)& SALOMEDS_TextColorAttribute::DynamicType() const -{ - return STANDARD_TYPE(SALOMEDS_TextColorAttribute) ; -} -Standard_Boolean SALOMEDS_TextColorAttribute::IsKind(const Handle(Standard_Type)& AType) const -{ - return (STANDARD_TYPE(SALOMEDS_TextColorAttribute) == AType || TDataStd_RealArray::IsKind(AType)); -} -Handle_SALOMEDS_TextColorAttribute::~Handle_SALOMEDS_TextColorAttribute() {} - diff --git a/src/SALOMEDS/SALOMEDS_TextColorAttribute.jxx b/src/SALOMEDS/SALOMEDS_TextColorAttribute.jxx deleted file mode 100644 index 8155e8883..000000000 --- a/src/SALOMEDS/SALOMEDS_TextColorAttribute.jxx +++ /dev/null @@ -1,40 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SALOMEDS_TextColorAttribute.jxx -// Author : Yves FRICAUD -// Module : SALOME -// $Header$ - -#ifndef _Standard_GUID_HeaderFile -#include -#endif -#ifndef _TDF_Attribute_HeaderFile -#include -#endif -#ifndef _TDF_RelocationTable_HeaderFile -#include -#endif -#ifndef _SALOMEDS_TextColorAttribute_HeaderFile -#include "SALOMEDS_TextColorAttribute.hxx" -#endif diff --git a/src/SALOMEDS/SALOMEDS_TextHighlightColorAttribute.cdl b/src/SALOMEDS/SALOMEDS_TextHighlightColorAttribute.cdl deleted file mode 100644 index 278c820a3..000000000 --- a/src/SALOMEDS/SALOMEDS_TextHighlightColorAttribute.cdl +++ /dev/null @@ -1,72 +0,0 @@ --- SALOME SALOMEDS : data structure of SALOME and sources of Salome data server --- --- Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, --- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS --- --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Lesser General Public --- License as published by the Free Software Foundation; either --- version 2.1 of the License. --- --- This library is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- Lesser General Public License for more details. --- --- You should have received a copy of the GNU Lesser General Public --- License along with this library; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --- --- See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org --- --- --- --- File : SALOMEDS_TextHighlightColorAttribute.cdl --- Author : Yves FRICAUD --- Module : SALOME - -class TextHighlightColorAttribute from SALOMEDS inherits RealArray from TDataStd - - ---Purpose: - - -uses Attribute from TDF, - Label from TDF, - GUID from Standard, - ExtendedString from TCollection, - DataSet from TDF, - RelocationTable from TDF, - AttributeSequence from TDF, - Data from TDF, - Comment from TDataStd - - -is - - - ---Purpose: class methods - -- ============= - - GetID (myclass) - ---C++: return const & - returns GUID from Standard; - - ---Purpose: Comment methods - -- ============ - - Create - returns mutable TextHighlightColorAttribute from SALOMEDS; - - ID (me) - ---C++: return const & - returns GUID from Standard; - - Restore (me: mutable; with : Attribute from TDF); - - NewEmpty (me) - returns mutable Attribute from TDF; - - Paste (me; into : mutable Attribute from TDF; - RT : mutable RelocationTable from TDF); - -end TextHighlightColorAttribute; diff --git a/src/SALOMEDS/SALOMEDS_TextHighlightColorAttribute.cxx b/src/SALOMEDS/SALOMEDS_TextHighlightColorAttribute.cxx deleted file mode 100644 index c27270f4a..000000000 --- a/src/SALOMEDS/SALOMEDS_TextHighlightColorAttribute.cxx +++ /dev/null @@ -1,92 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SALOMEDS_TextHighlightColorAttribute.cxx -// Author : Yves FRICAUD -// Module : SALOME -// $Header$ - -#include "SALOMEDS_TextHighlightColorAttribute.ixx" -using namespace std; - -//======================================================================= -//function : GetID -//purpose : -//======================================================================= - -const Standard_GUID& SALOMEDS_TextHighlightColorAttribute::GetID () -{ - static Standard_GUID SALOMEDS_TextHighlightColorAttributeID ("12837190-8F52-11d6-A8A3-0001021E8C7F"); - return SALOMEDS_TextHighlightColorAttributeID; -} - - - -//======================================================================= -//function : constructor -//purpose : -//======================================================================= -SALOMEDS_TextHighlightColorAttribute::SALOMEDS_TextHighlightColorAttribute() -{Init(1,3);} - -//======================================================================= -//function : ID -//purpose : -//======================================================================= - -const Standard_GUID& SALOMEDS_TextHighlightColorAttribute::ID () const { return GetID(); } - - -//======================================================================= -//function : NewEmpty -//purpose : -//======================================================================= - -Handle(TDF_Attribute) SALOMEDS_TextHighlightColorAttribute::NewEmpty () const -{ - return new SALOMEDS_TextHighlightColorAttribute(); -} - -//======================================================================= -//function : Restore -//purpose : -//======================================================================= - -void SALOMEDS_TextHighlightColorAttribute::Restore(const Handle(TDF_Attribute)& with) -{ - Handle(TColStd_HArray1OfReal) s = Handle(TDataStd_RealArray)::DownCast (with)->Array (); - TDataStd_RealArray::ChangeArray(s); - return; -} - -//======================================================================= -//function : Paste -//purpose : -//======================================================================= - -void SALOMEDS_TextHighlightColorAttribute::Paste (const Handle(TDF_Attribute)& into, - const Handle(TDF_RelocationTable)& ) const -{ - Handle(TDataStd_RealArray)::DownCast (into)->ChangeArray (Array()); -} - diff --git a/src/SALOMEDS/SALOMEDS_TextHighlightColorAttribute.hxx b/src/SALOMEDS/SALOMEDS_TextHighlightColorAttribute.hxx deleted file mode 100644 index 54790e15d..000000000 --- a/src/SALOMEDS/SALOMEDS_TextHighlightColorAttribute.hxx +++ /dev/null @@ -1,122 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SALOMEDS_TextHighlightColorAttribute.hxx -// Author : Yves FRICAUD -// Module : SALOME -// $Header$ - -#ifndef _SALOMEDS_TextHighlightColorAttribute_HeaderFile -#define _SALOMEDS_TextHighlightColorAttribute_HeaderFile - -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Handle_SALOMEDS_TextHighlightColorAttribute_HeaderFile -#include -#endif - -#ifndef _TDataStd_RealArray_HeaderFile -#include -#endif -#ifndef _Handle_TDF_Attribute_HeaderFile -#include -#endif -#ifndef _Handle_TDF_RelocationTable_HeaderFile -#include -#endif -class Standard_GUID; -class TDF_Attribute; -class TDF_RelocationTable; - - -class SALOMEDS_TextHighlightColorAttribute : public TDataStd_RealArray { - -public: - - inline void* operator new(size_t,void* anAddress) - { - return anAddress; - } - inline void* operator new(size_t size) - { - return Standard::Allocate(size); - } - inline void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } -// inline void operator delete(void *anAddress, size_t size) -// { -// if (anAddress) Standard::Free((Standard_Address&)anAddress,size); -// } - // Methods PUBLIC - // -Standard_EXPORT static const Standard_GUID& GetID() ; -Standard_EXPORT SALOMEDS_TextHighlightColorAttribute(); -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 ~SALOMEDS_TextHighlightColorAttribute(); - - - - - // Type management - // - Standard_EXPORT friend Handle_Standard_Type& SALOMEDS_TextHighlightColorAttribute_Type_(); - Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - - -}; - - - - - -// other inline functions and methods (like "C++: function call" methods) -// - - -#endif diff --git a/src/SALOMEDS/SALOMEDS_TextHighlightColorAttribute.ixx b/src/SALOMEDS/SALOMEDS_TextHighlightColorAttribute.ixx deleted file mode 100644 index 2132a29b9..000000000 --- a/src/SALOMEDS/SALOMEDS_TextHighlightColorAttribute.ixx +++ /dev/null @@ -1,87 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SALOMEDS_TextHighlightColorAttribute.ixx -// Author : Yves FRICAUD -// Module : SALOME -// $Header$ - -#include "SALOMEDS_TextHighlightColorAttribute.jxx" - -#ifndef _Standard_TypeMismatch_HeaderFile -#include -#endif - -SALOMEDS_TextHighlightColorAttribute::~SALOMEDS_TextHighlightColorAttribute() {} - - - -Standard_EXPORT Handle_Standard_Type& SALOMEDS_TextHighlightColorAttribute_Type_() -{ - - static Handle_Standard_Type aType1 = STANDARD_TYPE(TDataStd_RealArray); - if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TDataStd_RealArray); - static Handle_Standard_Type aType2 = STANDARD_TYPE(TDF_Attribute); - if ( aType2.IsNull()) aType2 = STANDARD_TYPE(TDF_Attribute); - static Handle_Standard_Type aType3 = STANDARD_TYPE(MMgt_TShared); - if ( aType3.IsNull()) aType3 = STANDARD_TYPE(MMgt_TShared); - static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient); - if ( aType4.IsNull()) aType4 = STANDARD_TYPE(Standard_Transient); - - - static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL}; - static Handle_Standard_Type _aType = new Standard_Type("SALOMEDS_TextHighlightColorAttribute", - sizeof(SALOMEDS_TextHighlightColorAttribute), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); - - return _aType; -} - - -// DownCast method -// allow safe downcasting -// -const Handle(SALOMEDS_TextHighlightColorAttribute) Handle(SALOMEDS_TextHighlightColorAttribute)::DownCast(const Handle(Standard_Transient)& AnObject) -{ - Handle(SALOMEDS_TextHighlightColorAttribute) _anOtherObject; - - if (!AnObject.IsNull()) { - if (AnObject->IsKind(STANDARD_TYPE(SALOMEDS_TextHighlightColorAttribute))) { - _anOtherObject = Handle(SALOMEDS_TextHighlightColorAttribute)((Handle(SALOMEDS_TextHighlightColorAttribute)&)AnObject); - } - } - - return _anOtherObject ; -} -const Handle(Standard_Type)& SALOMEDS_TextHighlightColorAttribute::DynamicType() const -{ - return STANDARD_TYPE(SALOMEDS_TextHighlightColorAttribute) ; -} -Standard_Boolean SALOMEDS_TextHighlightColorAttribute::IsKind(const Handle(Standard_Type)& AType) const -{ - return (STANDARD_TYPE(SALOMEDS_TextHighlightColorAttribute) == AType || TDataStd_RealArray::IsKind(AType)); -} -Handle_SALOMEDS_TextHighlightColorAttribute::~Handle_SALOMEDS_TextHighlightColorAttribute() {} - diff --git a/src/SALOMEDS/SALOMEDS_TextHighlightColorAttribute.jxx b/src/SALOMEDS/SALOMEDS_TextHighlightColorAttribute.jxx deleted file mode 100644 index 676a2b8b9..000000000 --- a/src/SALOMEDS/SALOMEDS_TextHighlightColorAttribute.jxx +++ /dev/null @@ -1,40 +0,0 @@ -// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SALOMEDS_TextHighlightColorAttribute.jxx -// Author : Yves FRICAUD -// Module : SALOME -// $Header$ - -#ifndef _Standard_GUID_HeaderFile -#include -#endif -#ifndef _TDF_Attribute_HeaderFile -#include -#endif -#ifndef _TDF_RelocationTable_HeaderFile -#include -#endif -#ifndef _SALOMEDS_TextHighlightColorAttribute_HeaderFile -#include "SALOMEDS_TextHighlightColorAttribute.hxx" -#endif