#include <HYDROData_Document.h>
#include <HYDROData_Image.h>
#include <HYDROData_Iterator.h>
+#include <HYDROData_Polyline.h>
+#include <HYDROData_VisualState.h>
+#include <HYDROData_Bathymetry.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
createObject( anImageRootObj, anImageObj );
}
+ LightApp_DataObject* aBathymetryRootObj = createObject( aRootObj, "BATHYMETRIES" );
+
+ anIterator = HYDROData_Iterator( aDocument, KIND_BATHYMETRY );
+ for( ; anIterator.More(); anIterator.Next() )
+ {
+ Handle(HYDROData_Bathymetry) aBathymetryObj =
+ Handle(HYDROData_Bathymetry)::DownCast( anIterator.Current() );
+ if( !aBathymetryObj.IsNull() )
+ createObject( aBathymetryRootObj, aBathymetryObj );
+ }
+
LightApp_DataObject* aPolylineRootObj = createObject( aRootObj, "POLYLINES" );
- HYDROData_Iterator aPolyIterator( aDocument, KIND_IMAGE );
- for( ; aPolyIterator.More(); aPolyIterator.Next() )
+ anIterator = HYDROData_Iterator( aDocument, KIND_POLYLINE );
+ for( ; anIterator.More(); anIterator.Next() )
{
- Handle(HYDROData_Image) aPolylineObj =
- Handle(HYDROData_Image)::DownCast( anIterator.Current() );
+ Handle(HYDROData_Polyline) aPolylineObj =
+ Handle(HYDROData_Polyline)::DownCast( anIterator.Current() );
if( !aPolylineObj.IsNull() )
createObject( aPolylineRootObj, aPolylineObj );
}
+ LightApp_DataObject* aVisualStateRootObj = createObject( aRootObj, "VISUAL_STATES" );
+
+ anIterator = HYDROData_Iterator( aDocument, KIND_VISUAL_STATE );
+ for( ; anIterator.More(); anIterator.Next() )
+ {
+ Handle(HYDROData_VisualState) aVisualStateObj =
+ Handle(HYDROData_VisualState)::DownCast( anIterator.Current() );
+ if( !aVisualStateObj.IsNull() )
+ createObject( aVisualStateRootObj, aVisualStateObj );
+ }
+
if( SUIT_DataBrowser* anObjectBrowser = anApp->objectBrowser() )
{
anObjectBrowser->setAutoOpenLevel( 3 );
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 );