HYDROGUI_ObjSelector.h
HYDROGUI_ObserveImageOp.h
HYDROGUI_OCCDisplayer.h
+ HYDROGUI_OCCSelector.h
HYDROGUI_Operation.h
HYDROGUI_Operations.h
HYDROGUI_PolylineDlg.h
HYDROGUI_ObjSelector.cxx
HYDROGUI_ObserveImageOp.cxx
HYDROGUI_OCCDisplayer.cxx
+ HYDROGUI_OCCSelector.cxx
HYDROGUI_Operation.cxx
HYDROGUI_Operations.cxx
HYDROGUI_PolylineDlg.cxx
AdditionalOptions="/MP"
Optimization="0"
AdditionalIncludeDirectories=".;../HYDROData;"$(SUITINC)";"$(GEOMINC)";"$(OCCINC)";$(QTINC)"
- PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;HYDROGUI_EXPORTS;WNT;QT_THREAD_SUPPORT;QT_NO_QT_INCLUDE_WARN;DISABLE_PYCONSOLE;DISABLE_OCCVIEWER;DISABLE_SUPERGRAPHVIEWER"
+ PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;HYDROGUI_EXPORTS;WNT;QT_THREAD_SUPPORT;QT_NO_QT_INCLUDE_WARN;DISABLE_PYCONSOLE;DISABLE_SUPERGRAPHVIEWER"
MinimalRebuild="false"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RelativePath=".\HYDROGUI_OCCDisplayer.cxx"
>
</File>
+ <File
+ RelativePath=".\HYDROGUI_OCCSelector.cxx"
+ >
+ </File>
<File
RelativePath=".\HYDROGUI_Operation.cxx"
>
RelativePath=".\HYDROGUI_OCCDisplayer.h"
>
</File>
+ <File
+ RelativePath=".\HYDROGUI_OCCSelector.h"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Generating moc_$(InputName).cxx"
+ CommandLine="$(QTDIR)\bin\moc.exe $(InputPath) -o moc\moc_$(InputName).cxx"
+ Outputs="moc/moc_$(InputName).cxx"
+ />
+ </FileConfiguration>
+ </File>
<File
RelativePath=".\HYDROGUI_Operation.h"
>
RelativePath=".\moc\moc_HYDROGUI_ObserveImageOp.cxx"
>
</File>
+ <File
+ RelativePath=".\moc\moc_HYDROGUI_OCCSelector.cxx"
+ >
+ </File>
<File
RelativePath=".\moc\moc_HYDROGUI_Operation.cxx"
>
#include "HYDROGUI_InputPanel.h"
#include "HYDROGUI_ObjSelector.h"
#include "HYDROGUI_OCCDisplayer.h"
+#include "HYDROGUI_OCCSelector.h"
#include "HYDROGUI_Operations.h"
#include "HYDROGUI_PrsImage.h"
#include "HYDROGUI_Tool.h"
if( theViewManager->getType() == GraphicsView_Viewer::Type() )
{
- createSelector( theViewManager ); // replace the default selector
-
connect( theViewManager, SIGNAL( viewCreated( SUIT_ViewWindow* ) ),
this, SLOT( onViewCreated( SUIT_ViewWindow* ) ) );
}
this, SLOT( onViewCreated( SUIT_ViewWindow* ) ) );
}
+ createSelector( theViewManager ); // replace the default selector
+
ViewManagerInfo anInfo( theViewManager, VMR_General );
myViewManagerMap.insert( ViewManagerId++, anInfo );
}
return;
QString aViewType = theViewManager->getType();
- if( aViewType != GraphicsView_Viewer::Type() )
- return;
-
- GraphicsView_ViewManager* aViewManager =
- dynamic_cast<GraphicsView_ViewManager*>( theViewManager );
- if( !aViewManager )
+ if( aViewType != GraphicsView_Viewer::Type() &&
+ aViewType != OCCViewer_Viewer::Type())
return;
QList<SUIT_Selector*> aSelectorList;
for( anIter = aSelectorList.begin(); anIter != anIterEnd; anIter++ )
{
SUIT_Selector* aSelector = *anIter;
- if( aSelector && !dynamic_cast<HYDROGUI_GVSelector*>( aSelector ) )
+ if( aSelector && ( !dynamic_cast<HYDROGUI_GVSelector*>( aSelector ) &&
+ !dynamic_cast<HYDROGUI_OCCSelector*>( aSelector ) ) )
aSelector->setEnabled( false );
}
- new HYDROGUI_GVSelector( this, aViewManager->getViewer(), aSelectionMgr );
+ if ( aViewType == GraphicsView_Viewer::Type() )
+ {
+ GraphicsView_ViewManager* aViewManager =
+ ::qobject_cast<GraphicsView_ViewManager*>( theViewManager );
+ if( aViewManager )
+ new HYDROGUI_GVSelector( this, aViewManager->getViewer(), aSelectionMgr );
+ }
+ else if ( aViewType == OCCViewer_Viewer::Type() )
+ {
+ OCCViewer_ViewManager* aViewManager =
+ ::qobject_cast<OCCViewer_ViewManager*>( theViewManager );
+ if( aViewManager )
+ new HYDROGUI_OCCSelector( this, aViewManager->getOCCViewer(), aSelectionMgr );
+ }
}
bool HYDROGUI_Module::setUpdateEnabled( const bool theState )
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_OCCSelector.h"
+
+#include "HYDROGUI_DataModel.h"
+#include "HYDROGUI_DataObject.h"
+#include "HYDROGUI_Module.h"
+
+#include <AIS_ListOfInteractive.hxx>
+#include <AIS_ListIteratorOfListOfInteractive.hxx>
+
+#include <LightApp_DataOwner.h>
+
+HYDROGUI_OCCSelector::HYDROGUI_OCCSelector( HYDROGUI_Module* theModule,
+ OCCViewer_Viewer* theViewer,
+ SUIT_SelectionMgr* theSelMgr )
+: LightApp_OCCSelector( theViewer, theSelMgr ),
+ myModule( theModule )
+{
+}
+
+HYDROGUI_OCCSelector::~HYDROGUI_OCCSelector()
+{
+}
+
+void HYDROGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
+{
+ OCCViewer_Viewer* aViewer = viewer();
+ if ( !aViewer )
+ return;
+
+ AIS_ListOfInteractive aSelList;
+ aViewer->getSelectedObjects( aSelList );
+ for ( AIS_ListIteratorOfListOfInteractive anIt( aSelList ); anIt.More(); anIt.Next() )
+ if ( !anIt.Value().IsNull() )
+ {
+ aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( entry( anIt.Value() ) ) ) );
+ }
+ // add externally selected objects
+ SUIT_DataOwnerPtrList::const_iterator anExtIter;
+ for(anExtIter = mySelectedExternals.begin(); anExtIter != mySelectedExternals.end(); anExtIter++) {
+ aList.append(*anExtIter);
+ }
+}
+
+QString HYDROGUI_OCCSelector::entry( const Handle(AIS_InteractiveObject)& anAIS ) const
+{
+ QString aRes;
+
+ if ( anAIS.IsNull() || !anAIS->HasOwner() )
+ return aRes;
+
+ Handle(HYDROData_Object) anObj =
+ Handle(HYDROData_Object)::DownCast( anAIS->GetOwner() );
+ if ( !anObj.IsNull() )
+ aRes = HYDROGUI_DataObject::dataObjectEntry( anObj );
+
+ return aRes;
+}
\ No newline at end of file
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_OCCSELECTOR_H
+#define HYDROGUI_OCCSELECTOR_H
+
+#include <LightApp_OCCSelector.h>
+
+class HYDROGUI_Module;
+class OCCViewer_Viewer;
+class Handle_AIS_InteractiveObject;
+
+class HYDROGUI_OCCSelector : public LightApp_OCCSelector
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_OCCSelector( HYDROGUI_Module*,
+ OCCViewer_Viewer*,
+ SUIT_SelectionMgr* );
+ virtual ~HYDROGUI_OCCSelector();
+
+protected:
+ virtual void getSelection( SUIT_DataOwnerPtrList& ) const;
+
+ virtual QString entry( const Handle_AIS_InteractiveObject& ) const;
+
+private:
+ HYDROGUI_Module* myModule;
+};
+
+#endif