X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Entity.cxx;h=62a7095e0f181f97a07fb36c24cf8628555d0ea5;hb=fce3f1240b6161d7cb837344078e5943b90eca65;hp=e5baa747adbcae0b0b23c6200e7f8644d4bb6c39;hpb=58bb6b7459bebeeb089c9ed486c4683a8bae7288;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Entity.cxx b/src/HYDROData/HYDROData_Entity.cxx index e5baa747..62a7095e 100644 --- a/src/HYDROData/HYDROData_Entity.cxx +++ b/src/HYDROData/HYDROData_Entity.cxx @@ -334,7 +334,7 @@ void HYDROData_Entity::RemoveZLevel() void HYDROData_Entity::SetLabel( const TDF_Label& theLabel ) { - myLab = theLabel; + myLab = theLabel; } void HYDROData_Entity::SaveByteArray( const int theTag, @@ -352,15 +352,19 @@ void HYDROData_Entity::SaveByteArray( const int theTag, if (!aLab.FindAttribute(TDataStd_ByteArray::GetID(), aData)) { aData = TDataStd_ByteArray::Set(aLab, 1, theLen); } + Standard_Byte* Byte0 = &(aData->InternalArray()->ChangeArray1().ChangeFirst()); + memcpy(Byte0, theData, theLen * sizeof (char)); // copy bytes one by one if (aData->Length() != theLen) { Handle(TColStd_HArray1OfByte) aNewData = new TColStd_HArray1OfByte(1, theLen); for(int a = 0; a < theLen; a++) aNewData->SetValue(a + 1, theData[a]); aData->ChangeArray(aNewData); - } else { - for(int a = 0; a < theLen; a++) - aData->SetValue(a + 1, theData[a]); + } + else + { + // for(int a = 0; a < theLen; a++) + // aData->SetValue(a + 1, theData[a]); } } @@ -489,6 +493,7 @@ void HYDROData_Entity::SetReferenceObjects( const HYDROData_SequenceOfObjects& t Handle(HYDROData_Entity) HYDROData_Entity::GetReferenceObject( const int theTag, const int theIndex ) const { + //DEBTRACE("GetReferenceObject " << theTag << " " << theIndex); Handle(HYDROData_Entity) aRes; Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, false ); @@ -578,12 +583,12 @@ void HYDROData_Entity::ClearReferenceObjects( const int theTag ) Handle(TDataStd_ReferenceList) HYDROData_Entity::getReferenceList( const int theTag, const bool theIsCreate ) const { + //DEBTRACE("getReferenceList " << theTag << " " << theIsCreate); TDF_Label aLabel = theTag == 0 ? myLab : myLab.FindChild( theTag ); Handle(TDataStd_ReferenceList) aRefs; if ( !aLabel.FindAttribute( TDataStd_ReferenceList::GetID(), aRefs ) && theIsCreate ) aRefs = TDataStd_ReferenceList::Set( aLabel ); - return aRefs; } @@ -840,3 +845,11 @@ int HYDROData_Entity::GetInteger( int theTag, int theDefValue ) const return anAttr->Get(); } + +bool HYDROData_Entity::CompareLabels(const Handle(HYDROData_Entity)& theOtherObj) +{ + if ( !theOtherObj.IsNull() ) + return this->Label() == theOtherObj->Label(); + return false; +} +