#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"
#include "HYDROGUI_Shape.h"
#include <HYDROData_Image.h>
+#include <HYDROData_Lambert93.h>
-#include <HYDROOperations_Factory.h>
+#include <HYDROData_OperationsFactory.h>
#include <GraphicsView_ViewFrame.h>
#include <GraphicsView_ViewManager.h>
bool anIsMustBeUpdatedImage = false;
bool anIsPolyline = false;
bool anIsCalculation = false;
- bool anIsZone = false;
+ bool anIsImmersibleZone = false;
bool anIsVisualState = false;
// check the selected data model objects
HYDROData_SequenceOfObjects aSeq = HYDROGUI_Tool::GetSelectedObjects( this );
for( Standard_Integer anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ )
{
- Handle(HYDROData_Object) anObject = aSeq.Value( anIndex );
+ Handle(HYDROData_Entity) anObject = aSeq.Value( anIndex );
if( !anObject.IsNull() )
{
anIsSelectedDataObjects = true;
Handle(HYDROData_Image) anImage = Handle(HYDROData_Image)::DownCast( anObject );
if( !anImage.IsNull() )
{
- anIsImportedImage = anImage->HasTrsfPoints() && !anImage->IsSelfSplitted();
+ anIsImportedImage = anImage->HasLocalPoints() && !anImage->IsSelfSplitted();
anIsCompositeImage = anImage->NbReferences() > 0;
- if( HYDROOperations_Factory* aFactory = HYDROOperations_Factory::Factory() )
+ if( HYDROData_OperationsFactory* aFactory = HYDROData_OperationsFactory::Factory() )
{
if( ImageComposer_Operator* anOperator = aFactory->Operator( anImage ) )
{
anIsPolyline = true;
else if( anObject->GetKind() == KIND_CALCULATION )
anIsCalculation = true;
- else if( anObject->GetKind() == KIND_ZONE )
- anIsZone = true;
+ else if( anObject->GetKind() == KIND_IMMERSIBLE_ZONE )
+ anIsImmersibleZone = true;
else if( anObject->GetKind() == KIND_VISUAL_STATE )
anIsVisualState = true;
}
case KIND_CALCULATION:
theMenu->addAction( action( CreateCalculationId ) );
break;
- case KIND_ZONE:
- theMenu->addAction( action( CreateZoneId ) );
+ case KIND_IMMERSIBLE_ZONE:
+ theMenu->addAction( action( CreateImmersibleZoneId ) );
break;
}
theMenu->addSeparator();
theMenu->addAction( action( EditCalculationId ) );
theMenu->addSeparator();
}
- else if( anIsZone )
+ else if( anIsImmersibleZone )
{
- theMenu->addAction( action( EditZoneId ) );
+ theMenu->addAction( action( EditImmersibleZoneId ) );
theMenu->addSeparator();
}
else if( anIsVisualState && anIsObjectBrowser )
theMenu->addSeparator();
}
- if( anIsSelectedDataObjects && ( anIsImage || anIsPolyline || anIsZone ) )
+ if( anIsSelectedDataObjects && ( anIsImage || anIsPolyline || anIsImmersibleZone ) )
{
if( anIsHiddenInSelection )
theMenu->addAction( action( ShowId ) );
// the selection in the object browser.
// Note: processEvents() should be called after updateGV(),
// otherwise the application crashes from time to time.
- qApp->processEvents();
+ //RKV: qApp->processEvents();
getApp()->updateObjectBrowser( true );
}
}
bool HYDROGUI_Module::isObjectVisible( const int theViewId,
- const Handle(HYDROData_Object)& theObject ) const
+ const Handle(HYDROData_Entity)& theObject ) const
{
if( theObject.IsNull() )
return false;
}
void HYDROGUI_Module::setObjectVisible( const int theViewId,
- const Handle(HYDROData_Object)& theObject,
+ const Handle(HYDROData_Entity)& theObject,
const bool theState )
{
if( !theObject.IsNull() )
}
HYDROGUI_Shape* HYDROGUI_Module::getObjectShape( const int theViewId,
- const Handle(HYDROData_Object)& theObject ) const
+ const Handle(HYDROData_Entity)& theObject ) const
{
HYDROGUI_Shape* aResShape = NULL;
if( theObject.IsNull() )
}
void HYDROGUI_Module::setObjectShape( const int theViewId,
- const Handle(HYDROData_Object)& theObject,
+ const Handle(HYDROData_Entity)& theObject,
HYDROGUI_Shape* theShape )
{
if( theObject.IsNull() )
}
void HYDROGUI_Module::removeObjectShape( const int theViewId,
- const Handle(HYDROData_Object)& theObject )
+ const Handle(HYDROData_Entity)& theObject )
{
if ( !myShapesMap.contains( theViewId ) )
return;
{
if( GraphicsView_Viewer* aViewer = dynamic_cast<GraphicsView_Viewer*>( aViewFrame->getViewer() ) )
{
+ SUIT_ViewManager* aViewManager = aViewer->getViewManager();
+ ViewManagerRole aRole = getViewManagerRole( aViewManager );
+
if( GraphicsView_ViewPort* aViewPort = aViewer->getActiveViewPort() )
{
+ if( aRole != VMR_TransformImage && aRole != VMR_ReferenceImage )
+ aViewPort->scale( 1, -1 ); // invert the Y axis direction from down to up
+
aViewPort->setInteractionFlag( GraphicsView_ViewPort::TraceBoundingRect );
aViewPort->setInteractionFlag( GraphicsView_ViewPort::ImmediateContextMenu );
aViewPort->setInteractionFlag( GraphicsView_ViewPort::ImmediateSelection );
//aViewPort->setViewLabelPosition( GraphicsView_ViewPort::VLP_BottomLeft, true );
}
- SUIT_ViewManager* aViewManager = aViewer->getViewManager();
- ViewManagerRole aRole = getViewManagerRole( aViewManager );
if( aRole != VMR_TransformImage )
update( UF_Viewer );
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 );
}
void HYDROGUI_Module::onViewPortMouseEvent( QGraphicsSceneMouseEvent* theEvent )
{
+ /* ouv: currently unused
if( GraphicsView_ViewPort* aViewPort = qobject_cast<GraphicsView_ViewPort*>( sender() ) )
{
SUIT_ViewManager* aViewManager = 0;
int aXDeg = 0, aYDeg = 0;
int aXMin = 0, aYMin = 0;
double aXSec = 0, aYSec = 0;
- HYDROGUI_Tool::DoubleToLambert( aMouseX, aXDeg, aXMin, aXSec );
- HYDROGUI_Tool::DoubleToLambert( aMouseY, aYDeg, aYMin, aYSec );
+ HYDROData_Lambert93::secToDMS( aMouseX, aXDeg, aXMin, aXSec );
+ HYDROData_Lambert93::secToDMS( aMouseY, aYDeg, aYMin, aYSec );
QString aDegSymbol( QChar( 0x00B0 ) );
QString aXStr = QString( "%1%2 %3' %4\"" ).arg( aXDeg ).arg( aDegSymbol ).arg( aXMin ).arg( aXSec );
else if( aRole == VMR_TransformImage )
aViewPort->setViewLabelText( QString( "X: %1\nY: %2" ).arg( (int)aMouseX ).arg( (int)aMouseY ) );
}
+ */
}
void HYDROGUI_Module::updateGV( const bool theIsInit,
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 )