#include <HYDROData_Document.h>
#include <HYDROData_Image.h>
#include <HYDROData_Iterator.h>
+#include <HYDROData_Polyline.h>
#include <CAM_Application.h>
#include <CAM_DataObject.h>
bool HYDROGUI_DataModel::isModified() const
{
- int aStudyId = module()->application()->activeStudy()->id();
- return HYDROData_Document::Document( aStudyId )->IsModified();
+ return getDocument()->IsModified();
}
bool HYDROGUI_DataModel::isSaved() const
if( !aStudyRoot )
return;
- if( SUIT_DataBrowser* anObjectBrowser = anApp->objectBrowser() )
- anObjectBrowser->setAutoOpenLevel( 3 );
-
// create root object if not exist
CAM_DataObject* aRootObj = root();
if( !aRootObj )
if( !anImageObj.IsNull() )
createObject( anImageRootObj, anImageObj );
}
+
+ LightApp_DataObject* aPolylineRootObj = createObject( aRootObj, "POLYLINES" );
+
+ HYDROData_Iterator aPolyIterator( aDocument, KIND_POLYLINE );
+ for( ; aPolyIterator.More(); aPolyIterator.Next() )
+ {
+ Handle(HYDROData_Polyline) aPolylineObj =
+ Handle(HYDROData_Polyline)::DownCast( aPolyIterator.Current() );
+ if( !aPolylineObj.IsNull() )
+ createObject( aPolylineRootObj, aPolylineObj );
+ }
+
+ if( SUIT_DataBrowser* anObjectBrowser = anApp->objectBrowser() )
+ {
+ anObjectBrowser->setAutoOpenLevel( 3 );
+ anObjectBrowser->openLevels();
+ }
}
HYDROGUI_DataObject* HYDROGUI_DataModel::getDataObject( const Handle(HYDROData_Object)& theModelObject )
Handle(HYDROData_Object) HYDROGUI_DataModel::objectByEntry( const QString& theEntry,
const ObjectKind theObjectKind )
{
- const int aStudyId = module()->application()->activeStudy()->id();
- Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( aStudyId );
+ Handle(HYDROData_Document) aDocument = getDocument();
if( !aDocument.IsNull() )
{
HYDROData_Iterator anIterator( aDocument, theObjectKind );