project (HYDRO)
-IF(WINDOWS)
+IF(WIN32)
ADD_DEFINITIONS(-DWNT)
-ENDIF(WINDOWS)
+ENDIF(WIN32)
SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
IF(EXISTS ${KERNEL_ROOT_DIR})
add_library(HYDROGUI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${PROJECT_HEADERS_MOC})
target_link_libraries(HYDROGUI HYDROData
- ${CAS_TKV3d} ${CAS_TKTopAlgo}
+ ${CAS_TKV3d} ${CAS_TKTopAlgo} ${CAS_TKBRep}
${LightApp} ${CAM} ${suit} ${qtx} ${ObjBrowser} ${GraphicsView} ${std} ${Event} ${OCCViewer}
${CurveCreator}
)
#include <QLayout>
#include <QPushButton>
+#include <QStackedLayout>
HYDROGUI_InputPanel::HYDROGUI_InputPanel( HYDROGUI_Module* theModule, const QString& theTitle )
: QDockWidget( theModule->application()->desktop() ),
QVBoxLayout* aLayout = new QVBoxLayout( aFrame );
myMainFrame = new QFrame( aFrame );
- QBoxLayout* aMainLayout = new QVBoxLayout( myMainFrame );
+ QVBoxLayout* aMainLayout = new QVBoxLayout( myMainFrame );
aMainLayout->setMargin( 0 );
aMainLayout->setSpacing( 5 );
+ myStackedLayout = new QStackedLayout();
+
myBtnFrame = new QFrame( aFrame );
- aLayout->addWidget( myMainFrame, 1 );
- aLayout->addWidget( myBtnFrame, 0 );
+ activateWidget( myBtnFrame );
+
+ aLayout->addWidget( myMainFrame, 3 );
+ aLayout->addLayout( myStackedLayout, 1 );
QHBoxLayout* aBtnsLayout = new QHBoxLayout( myBtnFrame );
aBtnsLayout->setMargin( 5 );
aBtnsLayout->setSpacing( 5 );
- myApply = new QPushButton( tr( "APPLY" ), myBtnFrame ),
+ myApply = new QPushButton( tr( "APPLY" ), myBtnFrame );
myCancel = new QPushButton( tr( "CANCEL" ), myBtnFrame );
myHelp = new QPushButton( tr( "HELP" ), myBtnFrame );
return myMainFrame;
}
+void HYDROGUI_InputPanel::activateWidget( QWidget* theWidget )
+{
+ if (theWidget == 0) {
+ myStackedLayout->setCurrentIndex( 0 );
+ }
+ else {
+ if ( myStackedLayout->indexOf( theWidget ) == -1 )
+ myStackedLayout->addWidget( theWidget );
+ myStackedLayout->setCurrentWidget( theWidget );
+ }
+}
class QFrame;
class QPushButton;
class QLayout;
+class QStackedLayout;
class HYDROGUI_Module;
void addLayout( QLayout* theLayout );
void addStretch();
+ void addToStackedLayout( QWidget* );
+ void activateWidget( QWidget* );
HYDROGUI_Module* module() const;
signals:
QPushButton* myApply;
QPushButton* myCancel;
QPushButton* myHelp;
+ QStackedLayout* myStackedLayout;
};
#endif
//
#include "HYDROGUI_PolylineDlg.h"
+
+#include "HYDROGUI_Module.h"
#include <CurveCreator_Widget.h>
#include <CurveCreator_Curve.hxx>
addLayout(aNameLayout);
myEditorWidget =
- new CurveCreator_Widget( this, NULL);
+ new CurveCreator_Widget( this, NULL );
addWidget( myEditorWidget );
connect( myEditorWidget, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) );
+ connect( myEditorWidget, SIGNAL( subOperationStarted(QWidget*) ), this, SLOT( processStartedSubOperation(QWidget*) ) );
+ connect( myEditorWidget, SIGNAL( subOperationFinished(QWidget*) ), this, SLOT( processFinishedSubOperation(QWidget*) ) );
}
HYDROGUI_PolylineDlg::~HYDROGUI_PolylineDlg()
{
}
+void HYDROGUI_PolylineDlg::processStartedSubOperation( QWidget* theWidget )
+{
+ myEditorWidget->setEnabled( false );
+ activateWidget( theWidget );
+}
+
+void HYDROGUI_PolylineDlg::processFinishedSubOperation( QWidget* theWidget )
+{
+ myEditorWidget->setEnabled( true );
+ activateWidget( 0 );
+}
+
void HYDROGUI_PolylineDlg::reset()
{
}
QList< QPair< int, int > > getSelectedPoints();
protected slots:
-
+ void processStartedSubOperation( QWidget* );
+ void processFinishedSubOperation( QWidget* );
signals:
void createPreview( QString );
void selectionChanged();
+ void widgetCreated(QWidget*);
+ void subOperationStarted(QWidget*);
+ void subOperationFinished(QWidget*);
private:
QLineEdit* myName;
CurveCreator_Widget* myEditorWidget;
#include <OCCViewer_ViewManager.h>
#include <OCCViewer_ViewModel.h>
+#include <OCCViewer_ViewWindow.h>
#include <OCCViewer_AISSelector.h>
aViewer->enableMultiselection(true);
Handle_AIS_InteractiveContext aCtx = aViewer->getAISContext();
+ OCCViewer_ViewWindow* vw = (OCCViewer_ViewWindow*)myPreviewViewManager->getActiveView();
+ vw->onTopView();
+
myAISCurve = new HYDROGUI_AISCurve(myCurve, aCtx);
myAISCurve->Display();
}
else{
- myCurve = new CurveCreator_Curve(CurveCreator::Dim3d);
+ myCurve = new CurveCreator_Curve(CurveCreator::Dim2d);
aPanel->setCurve(myCurve);
QString aNewName = HYDROGUI_Tool::GenerateObjectName( module(), "Polyline" );
aPanel->setPolylineName(aNewName);