From 4252610b08b5456922e49574b0cb05f937a53d84 Mon Sep 17 00:00:00 2001 From: isn Date: Thu, 7 Dec 2017 16:00:31 +0300 Subject: [PATCH] debug#2 (setID(); GetID()) --- src/HYDROData/HYDROData_Bathymetry.cxx | 15 ++++++--- src/HYDROData/HYDROData_CalculationCase.cxx | 4 +-- src/HYDROData/HYDROData_Document.cxx | 22 +++++++++++-- src/HYDROData/HYDROData_Entity.cxx | 36 +++++++++++++-------- src/HYDROData/HYDROData_IPolyline.cxx | 15 +++++++++ src/HYDROData/HYDROData_Image.cxx | 18 ++++++++--- src/HYDROData/HYDROData_Iterator.cxx | 2 +- src/HYDROData/HYDROData_LandCover.cxx | 4 ++- src/HYDROData/HYDROData_LandCoverMap.cxx | 1 + src/HYDROData/HYDROData_Object.cxx | 3 +- src/HYDROData/HYDROData_Obstacle.cxx | 7 ++-- src/HYDROData/HYDROData_PolylineXY.cxx | 3 +- src/HYDROData/HYDROData_PriorityQueue.cxx | 11 +++++-- src/HYDROData/HYDROData_Profile.cxx | 9 +++++- src/HYDROData/HYDROData_Stream.cxx | 1 + src/HYDROData/HYDROData_StricklerTable.cxx | 3 +- src/HYDROData/HYDROData_VisualState.cxx | 3 ++ src/HYDROData/HYDROData_Zone.cxx | 3 +- 18 files changed, 120 insertions(+), 40 deletions(-) diff --git a/src/HYDROData/HYDROData_Bathymetry.cxx b/src/HYDROData/HYDROData_Bathymetry.cxx index 5fa2c82e..64b0907a 100644 --- a/src/HYDROData/HYDROData_Bathymetry.cxx +++ b/src/HYDROData/HYDROData_Bathymetry.cxx @@ -128,6 +128,7 @@ void HYDROData_Bathymetry::SetAltitudePoints( const HYDROData_Bathymetry::Altitu // Save coordinates Handle(TDataStd_RealArray) aCoordsArray = TDataStd_RealArray::Set( myLab.FindChild( DataTag_AltitudePoints ), 0, thePoints.size() * 3 - 1 ); + aCoordsArray->SetID(TDataStd_RealArray::GetID()); HYDROData_Bathymetry::AltitudePoints::const_iterator anIter = thePoints.begin(), aLast = thePoints.end(); for ( int i = 0 ; anIter!=aLast; ++i, ++anIter ) @@ -228,7 +229,8 @@ HYDROData_QuadtreeNode* HYDROData_Bathymetry::ComputeQuadtreeNodes( int key) con if (!aLabel.FindAttribute(TDataStd_RealArray::GetID(), aCoordsArray)) return 0; - TDataStd_Integer::Set( myLab.FindChild( DataTag_Quadtree ), key ); + Handle(TDataStd_Integer) anAttr = TDataStd_Integer::Set( myLab.FindChild( DataTag_Quadtree ), key ); + anAttr->SetID(TDataStd_Integer::GetID()); DEBTRACE("GetQuadtreeNodes init " << this << " " << key); HYDROData_QuadtreeNode* aQuadtree = new HYDROData_QuadtreeNode(0, 30, 5, 0.); myQuadtrees[key] = aQuadtree; @@ -307,7 +309,8 @@ vtkPolyData* HYDROData_Bathymetry::ComputeVtkDelaunay2D(int key) const if (!aLabel.FindAttribute(TDataStd_RealArray::GetID(), aCoordsArray)) return 0; - TDataStd_Integer::Set( myLab.FindChild( DataTag_Delaunay ), key ); + Handle(TDataStd_Integer) anAttr = TDataStd_Integer::Set( myLab.FindChild( DataTag_Delaunay ), key ); + anAttr->SetID(TDataStd_Integer::GetID()); DEBTRACE("GetVtkDelaunay2D init " << this << " " << key); vtkPoints *points = vtkPoints::New(); points->Allocate(aCoordsArray->Upper() +1); @@ -523,13 +526,15 @@ double HYDROData_Bathymetry::GetAltitudeForPoint(const gp_XY& thePoint, int theM void HYDROData_Bathymetry::SetFilePath( const TCollection_AsciiString& theFilePath ) { - TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), theFilePath ); + Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), theFilePath ); + anAttr->SetID(TDataStd_AsciiString::GetID()); } void HYDROData_Bathymetry::SetFilePaths( const QStringList& theFilePaths ) { int i = 1; Handle_TDataStd_ExtStringArray TExtStrArr = TDataStd_ExtStringArray::Set( myLab.FindChild( DataTag_FilePaths ), 1, theFilePaths.size() ); + TExtStrArr->SetID(TDataStd_ExtStringArray::GetID()); foreach (QString filepath, theFilePaths) { std::string sstr = filepath.toStdString(); @@ -603,8 +608,8 @@ void HYDROData_Bathymetry::SetAltitudesInverted( const bool theIsInverted, if ( anIsAltitudesInverted == theIsInverted ) return; - TDataStd_Integer::Set( myLab.FindChild( DataTag_AltitudesInverted ), (Standard_Integer)theIsInverted ); - + Handle(TDataStd_Integer) anAttr = TDataStd_Integer::Set( myLab.FindChild( DataTag_AltitudesInverted ), (Standard_Integer)theIsInverted ); + anAttr->SetID(TDataStd_Integer::GetID()); Changed( Geom_Z ); if ( !theIsUpdate ) diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index ff5dd298..aac4b9ba 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -1352,8 +1352,8 @@ QString HYDROData_CalculationCase::DumpRules() const void HYDROData_CalculationCase::SetAssignmentMode( AssignmentMode theMode ) { TDF_Label aModeLab = myLab.FindChild( DataTag_AssignmentMode ); - TDataStd_Integer::Set( aModeLab, ( int ) theMode ); - + Handle(TDataStd_Integer) anAttr = TDataStd_Integer::Set( aModeLab, ( int ) theMode ); + anAttr->SetID(TDataStd_Integer::GetID()); // Indicate model of the need to update splitting Changed( Geom_2d ); } diff --git a/src/HYDROData/HYDROData_Document.cxx b/src/HYDROData/HYDROData_Document.cxx index d8abe576..34fb5356 100644 --- a/src/HYDROData/HYDROData_Document.cxx +++ b/src/HYDROData/HYDROData_Document.cxx @@ -228,7 +228,11 @@ void HYDROData_Document::SetDefaultStricklerCoefficient( double theCoeff ) const { Handle(TDataStd_Real) anAttr; if ( !aLabel.FindAttribute( TDataStd_Real::GetID(), anAttr ) ) - aLabel.AddAttribute( anAttr = new TDataStd_Real() ); + { + anAttr = new TDataStd_Real(); + aLabel.AddAttribute(anAttr); + anAttr->SetID(TDataStd_Real::GetID()); + } anAttr->Set( theCoeff ); } } @@ -253,7 +257,11 @@ void HYDROData_Document::SetCountQuadtree( int nbQuad) const { Handle(TDataStd_Integer) anAttr; if ( !aLabel.FindAttribute( TDataStd_Integer::GetID(), anAttr ) ) - aLabel.AddAttribute( anAttr = new TDataStd_Integer() ); + { + anAttr = new TDataStd_Integer(); + aLabel.AddAttribute(anAttr); + anAttr->SetID(TDataStd_Integer::GetID()); + } anAttr->Set( nbQuad ); } } @@ -278,7 +286,11 @@ void HYDROData_Document::SetCountDelaunay( int nbDelaunay) const { Handle(TDataStd_Integer) anAttr; if ( !aLabel.FindAttribute( TDataStd_Integer::GetID(), anAttr ) ) - aLabel.AddAttribute( anAttr = new TDataStd_Integer() ); + { + anAttr = new TDataStd_Integer(); + aLabel.AddAttribute(anAttr); + anAttr->SetID(TDataStd_Integer::GetID()); + } anAttr->Set( nbDelaunay ); } } @@ -790,6 +802,7 @@ int HYDROData_Document::NewID() Handle(TDataStd_Integer) anInt; if (!anIDLab.FindAttribute(TDataStd_Integer::GetID(), anInt)) { anInt = TDataStd_Integer::Set(anIDLab, 0); + anInt->SetID(TDataStd_Integer::GetID()); } // just increment value and return anInt->Set(anInt->Get() + 1); @@ -832,7 +845,10 @@ void HYDROData_Document::SetLocalCS( double theLX, double theLY ) TDF_Label aLocalCSLab = LabelOfLocalCS(); Handle( TDataXtd_Position ) aLocalCS; if( !aLocalCSLab.FindAttribute( TDataXtd_Position::GetID(), aLocalCS ) ) + { aLocalCS = TDataXtd_Position::Set( aLocalCSLab ); + aLocalCS->SetID(TDataXtd_Position::GetID()); + } gp_Pnt aLocalCS3d( theLX, theLY, 0 ); aLocalCS->SetPosition( aLocalCS3d ); diff --git a/src/HYDROData/HYDROData_Entity.cxx b/src/HYDROData/HYDROData_Entity.cxx index 92833456..84a1ac7b 100644 --- a/src/HYDROData/HYDROData_Entity.cxx +++ b/src/HYDROData/HYDROData_Entity.cxx @@ -105,21 +105,22 @@ QString HYDROData_Entity::GetDefaultName() const void HYDROData_Entity::SetName(const QString& theName, bool isDefault) { - TDataStd_Name::Set(myLab, TCollection_ExtendedString(theName.toLatin1().constData())); + Handle(TDataStd_Name) A = TDataStd_Name::Set(myLab, TCollection_ExtendedString(theName.toLatin1().constData())); + A->SetID(TDataStd_Name::GetID()); if (isDefault) + { + TDF_Label aDefaultNameLabel = myLab.FindChild( DataTag_DefaultName, true ); + if ( aDefaultNameLabel.IsNull() ) + return; + Handle(TDataStd_AsciiString) theDefaultName; + + if ( !aDefaultNameLabel.FindAttribute( TDataStd_AsciiString::GetID(), theDefaultName )) { - TDF_Label aDefaultNameLabel = myLab.FindChild( DataTag_DefaultName, true ); - if ( aDefaultNameLabel.IsNull() ) - return; - Handle(TDataStd_AsciiString) theDefaultName; - - if ( !aDefaultNameLabel.FindAttribute( TDataStd_AsciiString::GetID(), theDefaultName )) - { - TCollection_AsciiString aName = theName.toStdString().c_str(); - theDefaultName = TDataStd_AsciiString::Set(myLab.FindChild( DataTag_DefaultName), aName ); - theDefaultName->SetID( TDataStd_AsciiString::GetID() ); - } + TCollection_AsciiString aName = theName.toStdString().c_str(); + theDefaultName = TDataStd_AsciiString::Set(myLab.FindChild( DataTag_DefaultName), aName ); + theDefaultName->SetID( TDataStd_AsciiString::GetID() ); } + } } QStringList HYDROData_Entity::DumpToPython( const QString& thePyScriptPath, @@ -163,7 +164,8 @@ QVariant HYDROData_Entity::GetDataVariant() void HYDROData_Entity::ClearChanged() { - TDataStd_Integer::Set( myLab.FindChild( DataTag_GeomChange ), 0 ); + Handle(TDataStd_Integer) A = TDataStd_Integer::Set( myLab.FindChild( DataTag_GeomChange ), 0 ); + A->SetID(TDataStd_Integer::GetID()); } int HYDROData_Entity::GetGeomChangeFlag() const @@ -324,7 +326,8 @@ bool HYDROData_Entity::GetZLevel( Standard_Integer& theLevel ) const void HYDROData_Entity::SetZLevel( const Standard_Integer& theLevel ) { - TDataStd_Integer::Set( myLab.FindChild( DataTag_ZLevel ), theLevel ); + Handle(TDataStd_Integer) A = TDataStd_Integer::Set( myLab.FindChild( DataTag_ZLevel ), theLevel ); + A->SetID(TDataStd_Integer::GetID()); } void HYDROData_Entity::RemoveZLevel() @@ -418,6 +421,7 @@ void HYDROData_Entity::AddReferenceObject( const Handle(HYDROData_Entity)& theOb Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, true ); aRefs->Append( theObj->Label() ); + aRefs->SetID(TDataStd_ReferenceList::GetID()); } void HYDROData_Entity::SetReferenceObject( const Handle(HYDROData_Entity)& theObj, @@ -605,7 +609,10 @@ void HYDROData_Entity::SetColor( const QColor& theColor, Handle(TDataStd_IntegerArray) aColorArray; if ( !aLabel.FindAttribute( TDataStd_IntegerArray::GetID(), aColorArray ) ) + { aColorArray = TDataStd_IntegerArray::Set( aLabel, 1, 4 ); + aColorArray->SetID(TDataStd_IntegerArray::GetID()); + } aColorArray->SetValue( 1, theColor.red() ); aColorArray->SetValue( 2, theColor.green() ); @@ -800,6 +807,7 @@ void HYDROData_Entity::SetShape( int theTag, const TopoDS_Shape& theShape ) { TNaming_Builder aBuilder( myLab.FindChild( theTag ) ); aBuilder.Generated( theShape ); + aBuilder.NamedShape()->SetID(TNaming_NamedShape::GetID()); } TopoDS_Shape HYDROData_Entity::GetShape( int theTag ) const diff --git a/src/HYDROData/HYDROData_IPolyline.cxx b/src/HYDROData/HYDROData_IPolyline.cxx index 42d68480..a0a2fe30 100644 --- a/src/HYDROData/HYDROData_IPolyline.cxx +++ b/src/HYDROData/HYDROData_IPolyline.cxx @@ -87,13 +87,22 @@ void HYDROData_IPolyline::getSectionsLists( Handle(TDataStd_ExtStringList)& theN return; if ( !aSectLabel.FindAttribute( TDataStd_ExtStringList::GetID(), theNamesList ) && theIsCreate ) + { theNamesList = TDataStd_ExtStringList::Set( aSectLabel ); + theNamesList->SetID(TDataStd_ExtStringList::GetID()); + } if ( !aSectLabel.FindAttribute( TDataStd_IntegerList::GetID(), theTypesList ) && theIsCreate ) + { theTypesList = TDataStd_IntegerList::Set( aSectLabel ); + theTypesList->SetID(TDataStd_IntegerList::GetID()); + } if ( !aSectLabel.FindAttribute( TDataStd_BooleanList::GetID(), theClosuresList ) && theIsCreate ) + { theClosuresList = TDataStd_BooleanList::Set( aSectLabel ); + theClosuresList->SetID(TDataStd_BooleanList::GetID()); + } } void HYDROData_IPolyline::removeSectionsLists() @@ -123,14 +132,20 @@ void HYDROData_IPolyline::getPointsLists( const int theSectionI if ( !aLabelX.IsNull() ) { if ( !aLabelX.FindAttribute( TDataStd_RealList::GetID(), theListX ) && theIsCreate ) + { theListX = TDataStd_RealList::Set( aLabelX ); + theListX->SetID(TDataStd_RealList::GetID()); + } } TDF_Label aLabelY = aSectLabel.FindChild( 1, theIsCreate ); if ( !aLabelY.IsNull() ) { if ( !aLabelY.FindAttribute( TDataStd_RealList::GetID(), theListY ) && theIsCreate ) + { theListY = TDataStd_RealList::Set( aLabelY ); + theListY->SetID(TDataStd_RealList::GetID()); + } } } diff --git a/src/HYDROData/HYDROData_Image.cxx b/src/HYDROData/HYDROData_Image.cxx index a957d7f9..2020af6e 100644 --- a/src/HYDROData/HYDROData_Image.cxx +++ b/src/HYDROData/HYDROData_Image.cxx @@ -296,6 +296,7 @@ void HYDROData_Image::SetImage(const QImage& theImage) Handle(TDataStd_IntegerArray) aParams; if (!myLab.FindAttribute(TDataStd_IntegerArray::GetID(), aParams)) { aParams = TDataStd_IntegerArray::Set(myLab, 1, 4); + aParams->SetID(TDataStd_IntegerArray::GetID()); } aParams->SetValue(1, anImage.width()); aParams->SetValue(2, anImage.height()); @@ -438,8 +439,8 @@ QImage HYDROData_Image::Image() void HYDROData_Image::SetFilePath( const QString& theFilePath ) { TCollection_AsciiString anAsciiStr( theFilePath.toStdString().c_str() ); - TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), anAsciiStr ); - + Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), anAsciiStr ); + anAttr->SetID(TDataStd_AsciiString::GetID()); Changed( Geom_2d ); } @@ -465,6 +466,7 @@ void HYDROData_Image::SetTrsf(const QTransform& theTrsf) if (!myLab.FindAttribute(TDataStd_RealArray::GetID(), anArray)) { if (theTrsf.isIdentity()) return; // no need to store identity transformation anArray = TDataStd_RealArray::Set(myLab, 1, 9); + anArray->SetID(TDataStd_RealArray::GetID()); } anArray->SetValue(1, theTrsf.m11()); anArray->SetValue(2, theTrsf.m12()); @@ -652,7 +654,10 @@ void HYDROData_Image::SetLocalPoints( const QPoint& thePointA, { Handle(TDataStd_RealArray) anArray; if ( !myLab.FindChild( DataTag_TrsfPoints ).FindAttribute( TDataStd_RealArray::GetID(), anArray ) ) + { anArray = TDataStd_RealArray::Set( myLab.FindChild( DataTag_TrsfPoints ), 1, 12 ); + anArray->SetID(TDataStd_RealArray::GetID()); + } anArray->SetValue( 1, thePointA.x() ); anArray->SetValue( 2, thePointA.y() ); @@ -705,7 +710,10 @@ void HYDROData_Image::SetGlobalPoints( const TransformationMode& theMode, { Handle(TDataStd_RealArray) anArray; if ( !myLab.FindChild( DataTag_TrsfPoints ).FindAttribute( TDataStd_RealArray::GetID(), anArray ) ) + { anArray = TDataStd_RealArray::Set( myLab.FindChild( DataTag_TrsfPoints ), 1, 12 ); + anArray->SetID(TDataStd_RealArray::GetID()); + } anArray->SetValue( 7, thePointA.x() ); anArray->SetValue( 8, thePointA.y() ); @@ -872,7 +880,8 @@ bool HYDROData_Image::HasReferencePoints() const void HYDROData_Image::SetTrsfMode( const TransformationMode& theMode ) { - TDataStd_Integer::Set( myLab.FindChild( DataTag_TrsfMode ), (int)theMode ); + Handle(TDataStd_Integer) anAttr = TDataStd_Integer::Set( myLab.FindChild( DataTag_TrsfMode ), (int)theMode ); + anAttr->SetID(TDataStd_Integer::GetID()); Changed( Geom_2d ); } @@ -946,7 +955,8 @@ void HYDROData_Image::ClearReferences() void HYDROData_Image::SetOperatorName( const QString theOpName ) { TCollection_AsciiString anAsciiStr( theOpName.toStdString().c_str() ); - TDataStd_AsciiString::Set( myLab.FindChild( DataTag_Operator ), anAsciiStr ); + Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_Operator ), anAsciiStr ); + anAttr->SetID(TDataStd_AsciiString::GetID()); Changed( Geom_2d ); } diff --git a/src/HYDROData/HYDROData_Iterator.cxx b/src/HYDROData/HYDROData_Iterator.cxx index 8382162a..3277b3f5 100644 --- a/src/HYDROData/HYDROData_Iterator.cxx +++ b/src/HYDROData/HYDROData_Iterator.cxx @@ -106,7 +106,7 @@ Handle(HYDROData_Entity) HYDROData_Iterator::CreateObject( TDF_Label& the Handle(TDataStd_NamedData) aNamedData; theNewLabel.FindAttribute( TDataStd_NamedData::GetID(), aNamedData ); - aNamedData->SetInteger( "ObjectKind", theObjectKind ); + aNamedData->SetInteger( "ObjectKind", theObjectKind ); //??CAF return Object( theNewLabel ); } diff --git a/src/HYDROData/HYDROData_LandCover.cxx b/src/HYDROData/HYDROData_LandCover.cxx index c9199eb3..221cc2f1 100644 --- a/src/HYDROData/HYDROData_LandCover.cxx +++ b/src/HYDROData/HYDROData_LandCover.cxx @@ -100,7 +100,9 @@ bool HYDROData_LandCover::IsHas2dPrs() const void HYDROData_LandCover::SetStricklerType( const QString& theType ) { TCollection_AsciiString anAsciiStr( theType.toStdString().c_str() ); - TDataStd_AsciiString::Set( myLab.FindChild( DataTag_StricklerType ), anAsciiStr ); + Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_StricklerType ), anAsciiStr ); + anAttr->SetID(TDataStd_AsciiString::GetID()); + } QString HYDROData_LandCover::GetStricklerType() const diff --git a/src/HYDROData/HYDROData_LandCoverMap.cxx b/src/HYDROData/HYDROData_LandCoverMap.cxx index 03b49e81..873ba058 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.cxx +++ b/src/HYDROData/HYDROData_LandCoverMap.cxx @@ -1039,6 +1039,7 @@ void HYDROData_LandCoverMap::StoreLandCovers( const HYDROData_MapOfFaceToStrickl } Handle( TDataStd_ExtStringArray ) aTypes = TDataStd_ExtStringArray::Set( myLab.FindChild( DataTag_Types ), 0, aSTypes.size() - 1, Standard_True ); + aTypes->SetID(TDataStd_ExtStringArray::GetID()); int k = 0; foreach (QString aST, aSTypes) { diff --git a/src/HYDROData/HYDROData_Object.cxx b/src/HYDROData/HYDROData_Object.cxx index 0f677624..02578fb6 100644 --- a/src/HYDROData/HYDROData_Object.cxx +++ b/src/HYDROData/HYDROData_Object.cxx @@ -377,7 +377,8 @@ bool HYDROData_Object::IsSubmersible() const void HYDROData_Object::SetIsSubmersible( bool isSubmersible ) const { - TDataStd_Integer::Set( myLab, isSubmersible ? 1 : 0 ); + Handle(TDataStd_Integer) anAttr = TDataStd_Integer::Set( myLab, isSubmersible ? 1 : 0 ); + anAttr->SetID(TDataStd_Integer::GetID()); } void HYDROData_Object::GetBoundaries( QList& theBoundShapes, diff --git a/src/HYDROData/HYDROData_Obstacle.cxx b/src/HYDROData/HYDROData_Obstacle.cxx index 29b0a64c..c3586ef5 100644 --- a/src/HYDROData/HYDROData_Obstacle.cxx +++ b/src/HYDROData/HYDROData_Obstacle.cxx @@ -207,7 +207,8 @@ bool HYDROData_Obstacle::ImportFromFile( const QString& theFilePath ) void HYDROData_Obstacle::SetFilePath( const QString& theFilePath ) { TCollection_AsciiString anAsciiStr( theFilePath.toStdString().c_str() ); - TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), anAsciiStr ); + Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), anAsciiStr ); + anAttr->SetID(TDataStd_AsciiString::GetID()); } QString HYDROData_Obstacle::GetFilePath() const @@ -253,7 +254,8 @@ bool HYDROData_Obstacle::ImportFromGeomIOR( const TCollection_AsciiString& theIO void HYDROData_Obstacle::SetGeomObjectEntry( const TCollection_AsciiString& theEntry ) { - TDataStd_AsciiString::Set( myLab.FindChild( DataTag_GeomObjectEntry ), theEntry ); + Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_GeomObjectEntry ), theEntry ); + anAttr->SetID(TDataStd_AsciiString::GetID()); } TCollection_AsciiString HYDROData_Obstacle::GetGeomObjectEntry() const @@ -520,6 +522,7 @@ void HYDROData_Obstacle::setTranslation( const double theDx, } Handle(TDataStd_RealArray) aCoeffsArray = TDataStd_RealArray::Set( aLabel, 1, 3 ); + aCoeffsArray->SetID(TDataStd_RealArray::GetID()); aCoeffsArray->SetValue( 1, aCurDx ); aCoeffsArray->SetValue( 2, aCurDy ); aCoeffsArray->SetValue( 3, aCurDz ); diff --git a/src/HYDROData/HYDROData_PolylineXY.cxx b/src/HYDROData/HYDROData_PolylineXY.cxx index 9115b6d6..1a0d6f45 100644 --- a/src/HYDROData/HYDROData_PolylineXY.cxx +++ b/src/HYDROData/HYDROData_PolylineXY.cxx @@ -244,7 +244,8 @@ bool HYDROData_PolylineXY::ImportFromGeomIOR( const TCollection_AsciiString& the void HYDROData_PolylineXY::SetGeomObjectEntry( const TCollection_AsciiString& theEntry ) { - TDataStd_AsciiString::Set( myLab.FindChild( DataTag_GeomObjectEntry ), theEntry ); + Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_GeomObjectEntry ), theEntry ); + anAttr->SetID(TDataStd_AsciiString::GetID()); } TCollection_AsciiString HYDROData_PolylineXY::GetGeomObjectEntry() const diff --git a/src/HYDROData/HYDROData_PriorityQueue.cxx b/src/HYDROData/HYDROData_PriorityQueue.cxx index 27427dd4..29678299 100644 --- a/src/HYDROData/HYDROData_PriorityQueue.cxx +++ b/src/HYDROData/HYDROData_PriorityQueue.cxx @@ -150,20 +150,25 @@ void HYDROData_PriorityQueue::AddRule( TDF_Label& theRulesL TDF_Label anObj1Lab = aNewRuleLab.FindChild( Object1_Tag ); Handle(TDataStd_ReferenceList) aRefs = TDataStd_ReferenceList::Set( anObj1Lab ); + aRefs->SetID(TDataStd_ReferenceList::GetID()); aRefs->Append( theObject1->Label() ); TDF_Label aPriorityLab = aNewRuleLab.FindChild( Priority_Tag ); - TDataStd_Integer::Set( aPriorityLab, thePriority ); + Handle(TDataStd_Integer) anPLAttr = TDataStd_Integer::Set( aPriorityLab, thePriority ); + anPLAttr->SetID(TDataStd_Integer::GetID()); TDF_Label anObj2Lab = aNewRuleLab.FindChild( Object2_Tag ); aRefs = TDataStd_ReferenceList::Set( anObj2Lab ); + aRefs->SetID(TDataStd_ReferenceList::GetID()); aRefs->Append( theObject2->Label() ); TDF_Label aMergeLab = aNewRuleLab.FindChild( Merge_Tag ); - TDataStd_Integer::Set( aMergeLab, theMergeType ); + Handle(TDataStd_Integer) anMLAttr = TDataStd_Integer::Set( aMergeLab, theMergeType ); + anMLAttr->SetID(TDataStd_Integer::GetID()); // Increment the last rule index - TDataStd_Integer::Set( theRulesLabel, aRuleIndex + 1 ); + Handle(TDataStd_Integer) anRLAttr = TDataStd_Integer::Set( theRulesLabel, aRuleIndex + 1 ); + anRLAttr->SetID(TDataStd_Integer::GetID()); } HYDROData_ListOfRules HYDROData_PriorityQueue::GetRules( const TDF_Label& theRulesLabel ) diff --git a/src/HYDROData/HYDROData_Profile.cxx b/src/HYDROData/HYDROData_Profile.cxx index 0057722b..936e9513 100644 --- a/src/HYDROData/HYDROData_Profile.cxx +++ b/src/HYDROData/HYDROData_Profile.cxx @@ -225,7 +225,10 @@ void HYDROData_Profile::SetLeftPoint( const gp_XY& theGPoint, bool IsConvertFrom Handle(TDataStd_RealArray) anArray; if ( !aLabel.FindAttribute( TDataStd_RealArray::GetID(), anArray ) ) + { anArray = TDataStd_RealArray::Set( aLabel, 0, 1 ); + anArray->SetID(TDataStd_RealArray::GetID()); + } anArray->SetValue( 0, aLPoint.X() ); anArray->SetValue( 1, aLPoint.Y() ); @@ -277,7 +280,10 @@ void HYDROData_Profile::SetRightPoint( const gp_XY& theGPoint, bool IsConvertFro Handle(TDataStd_RealArray) anArray; if ( !aLabel.FindAttribute( TDataStd_RealArray::GetID(), anArray ) ) + { anArray = TDataStd_RealArray::Set( aLabel, 0, 1 ); + anArray->SetID(TDataStd_RealArray::GetID()); + } anArray->SetValue( 0, aLPoint.X() ); anArray->SetValue( 1, aLPoint.Y() ); @@ -463,7 +469,8 @@ HYDROData_Profile::ProfilePoints HYDROData_Profile::GetProfilePoints void HYDROData_Profile::SetFilePath( const TCollection_AsciiString& theFilePath ) { - TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), theFilePath ); + Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), theFilePath ); + anAttr->SetID(TDataStd_AsciiString::GetID()); } TCollection_AsciiString HYDROData_Profile::GetFilePath() const diff --git a/src/HYDROData/HYDROData_Stream.cxx b/src/HYDROData/HYDROData_Stream.cxx index 599f2281..4b8e639a 100644 --- a/src/HYDROData/HYDROData_Stream.cxx +++ b/src/HYDROData/HYDROData_Stream.cxx @@ -784,6 +784,7 @@ void HYDROData_Stream::setParametersArray( const QVector& theArray ) int n = theArray.size(); Handle(TDataStd_RealArray) aParamsArray = TDataStd_RealArray::Set( aLabel, 1, n ); + aParamsArray->SetID(TDataStd_RealArray::GetID()); for ( int i = 0; i < n; ++i ) { const Standard_Real& aParam = theArray[i]; diff --git a/src/HYDROData/HYDROData_StricklerTable.cxx b/src/HYDROData/HYDROData_StricklerTable.cxx index 1c51cf1e..c5e7409b 100644 --- a/src/HYDROData/HYDROData_StricklerTable.cxx +++ b/src/HYDROData/HYDROData_StricklerTable.cxx @@ -268,7 +268,8 @@ bool HYDROData_StricklerTable::SetAttrName( const QString& theAttrName ) const return false; } - TDataStd_AsciiString::Set( myLab.FindChild( DataTag_AttrName ), HYDROData_Tool::toExtString( theAttrName ) ); + Handle(TDataStd_AsciiString) anAttr = TDataStd_AsciiString::Set( myLab.FindChild( DataTag_AttrName ), HYDROData_Tool::toExtString( theAttrName ) ); + anAttr->SetID(TDataStd_AsciiString::GetID()); return true; } diff --git a/src/HYDROData/HYDROData_VisualState.cxx b/src/HYDROData/HYDROData_VisualState.cxx index 48d8ba1e..c27c8b7f 100644 --- a/src/HYDROData/HYDROData_VisualState.cxx +++ b/src/HYDROData/HYDROData_VisualState.cxx @@ -36,7 +36,10 @@ void HYDROData_VisualState::SetState( const std::string& theState ) TCollection_AsciiString aString; Handle(TDataStd_AsciiString) aState; if( !myLab.FindAttribute( TDataStd_AsciiString::GetID(), aState ) ) + { aState = TDataStd_AsciiString::Set( myLab, aString ); + aState->SetID(TDataStd_AsciiString::GetID()); + } aString.AssignCat( theState.c_str() ); aState->Set( aString ); } diff --git a/src/HYDROData/HYDROData_Zone.cxx b/src/HYDROData/HYDROData_Zone.cxx index 3e45fb89..3b296621 100644 --- a/src/HYDROData/HYDROData_Zone.cxx +++ b/src/HYDROData/HYDROData_Zone.cxx @@ -120,7 +120,8 @@ HYDROData_IInterpolator* HYDROData_Zone::GetInterpolator() const void HYDROData_Zone::SetMergeType( const MergeType& theType ) { - TDataStd_Integer::Set( myLab.FindChild( DataTag_MergeType ), (int)theType ); + Handle(TDataStd_Integer) anAttr = TDataStd_Integer::Set( myLab.FindChild( DataTag_MergeType ), (int)theType ); + anAttr->SetID(TDataStd_Integer::GetID()); } HYDROData_Zone::MergeType HYDROData_Zone::GetMergeType() const -- 2.39.2