2 #include "HYDROData_Tool.h"
4 #include "HYDROData_Image.h"
5 #include "HYDROData_Iterator.h"
11 void HYDROData_Tool::WriteStringsToFile( QFile& theFile,
12 const QStringList& theStrings,
13 const QString& theSep )
15 if ( !theFile.isOpen() || theStrings.isEmpty() )
18 QString aWriteStr = theStrings.join( theSep );
19 if ( aWriteStr.isEmpty() )
22 QTextStream anOutStream( &theFile );
23 anOutStream << aWriteStr << theSep << theSep;
26 void HYDROData_Tool::SetMustBeUpdatedImages(
27 Handle_HYDROData_Document theDoc)
31 // iterate until there is no changes because images on all level of dependency must be updated
36 HYDROData_Iterator anIter( theDoc, KIND_IMAGE );
37 for ( ; anIter.More(); anIter.Next() )
39 Handle(HYDROData_Image) anImage =
40 Handle(HYDROData_Image)::DownCast( anIter.Current() );
41 if ( anImage.IsNull() || anImage->MustBeUpdated() )
44 for ( int i = 0, aNBRefs = anImage->NbReferences(); i < aNBRefs; ++i )
46 Handle(HYDROData_Image) aRefImage =
47 Handle(HYDROData_Image)::DownCast( anImage->Reference( i ) );
48 if ( !aRefImage.IsNull() && aRefImage->MustBeUpdated() )
50 // image references to updated => also must be updated
51 anImage->MustBeUpdated(true);