From a0d0ce7684547786681c55e3eb231238d2e87efe Mon Sep 17 00:00:00 2001 From: isn Date: Thu, 7 Dec 2017 16:00:31 +0300 Subject: [PATCH] debug (setID(); GetID()) --- src/HYDROData/HYDROData_Document.cxx | 18 +++++++++++++++--- src/HYDROData/HYDROData_Iterator.cxx | 2 +- src/HYDROData/HYDROData_PriorityQueue.cxx | 11 ++++++++--- src/HYDROData/HYDROData_Profile.cxx | 9 ++++++++- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/HYDROData/HYDROData_Document.cxx b/src/HYDROData/HYDROData_Document.cxx index d8abe576..c1c6e9e6 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 ); } } 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_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 -- 2.39.2