#include <SALOMEDSClient.hxx>
+#include <SVTK_ViewModel.h>
+
#include <QDir>
#include <QFileInfo>
#include <QDockWidget>
aWorkstack->setActiveWindow( aViewWindow );
}
+bool HYDROGUI_Tool::IsObjectHasPresentation( const Handle(HYDROData_Entity)& theObject,
+ const QString& theViewerType )
+{
+
+ if ( theObject.IsNull() )
+ return false;
+
+ ObjectKind anObjectKind = theObject->GetKind();
+ if ( theViewerType.isEmpty() || theViewerType == OCCViewer_Viewer::Type() )
+ {
+ if ( anObjectKind == KIND_IMAGE ||
+ anObjectKind == KIND_POLYLINEXY ||
+ anObjectKind == KIND_POLYLINE ||
+ anObjectKind == KIND_IMMERSIBLE_ZONE ||
+ anObjectKind == KIND_REGION ||
+ anObjectKind == KIND_ZONE ||
+ anObjectKind == KIND_OBSTACLE ||
+ anObjectKind == KIND_PROFILE ||
+ anObjectKind == KIND_STREAM ||
+ anObjectKind == KIND_CHANNEL ||
+ anObjectKind == KIND_DIGUE ||
+ anObjectKind == KIND_DUMMY_3D )
+ {
+ return true;
+ }
+ }
+
+ if ( theViewerType.isEmpty() || theViewerType == SVTK_Viewer::Type() )
+ {
+ if ( anObjectKind == KIND_BATHYMETRY )
+ return true;
+ }
+
+ if ( theViewerType.isEmpty() || theViewerType == GraphicsView_Viewer::Type() )
+ {
+ if ( anObjectKind == KIND_IMAGE ||
+ anObjectKind == KIND_POLYLINEXY )
+ return true;
+ }
+
+ return false;
+}
+
void HYDROGUI_Tool::GetPrsSubObjects( HYDROGUI_Module* theModule,
HYDROData_SequenceOfObjects& theSeq )
{
for( ; anIterator.More(); anIterator.Next() )
{
Handle(HYDROData_Entity) anObject = anIterator.Current();
- if( !anObject.IsNull() && (
- ( anObject->GetKind() == KIND_IMAGE ) ||
- ( anObject->GetKind() == KIND_POLYLINEXY ) ||
- ( anObject->GetKind() == KIND_POLYLINE ) ||
- ( anObject->GetKind() == KIND_IMMERSIBLE_ZONE ) ||
- ( anObject->GetKind() == KIND_REGION ) ||
- ( anObject->GetKind() == KIND_BATHYMETRY ) ||
- ( anObject->GetKind() == KIND_ZONE ) ||
- ( anObject->GetKind() == KIND_OBSTACLE ) ||
- ( anObject->GetKind() == KIND_PROFILE ) ||
- ( anObject->GetKind() == KIND_STREAM ) ||
- ( anObject->GetKind() == KIND_CHANNEL ) ) )
- {
- theSeq.Append( anObject );
- }
+ if ( !IsObjectHasPresentation( anObject ) )
+ continue;
+
+ theSeq.Append( anObject );
}
}
}
return KIND_UNKNOWN;
}
-QStringList HYDROGUI_Tool::GetSelectedGeomObjects( HYDROGUI_Module* theModule )
+QStringList HYDROGUI_Tool::GetSelectedGeomObjects( HYDROGUI_Module* theModule,
+ QList<GEOM::shape_type> theTypes )
{
QStringList anEntryList;
GEOM::GEOM_Object_var aGeomObj =
GEOMBase::GetObjectFromIOR( aSObject->GetIOR().c_str() );
- if ( !aGeomObj->_is_nil() && aGeomObj->IsShape() ) {
+ if ( !aGeomObj->_is_nil() && aGeomObj->IsShape() &&
+ theTypes.contains( aGeomObj->GetShapeType() ) ) {
anEntryList << anEntry;
}
}