#undef HYDROGUI_EXPORTS
#include <test_HYDROGUI_ProfilesDlg.h>
+
+#define private public
#include <HYDROGUI_ProfileDlg.h>
+#undef private
+
+#include <HYDROGUI_CurveCreatorProfile.h>
+#include <CurveCreator_Widget.h>
+#include <CurveCreator_TableView.h>
+#include <CurveCreator_Displayer.hxx>
+#include <CurveCreator_Utils.hxx>
+
+#include <HYDROData_Document.h>
+#include <HYDROData_Profile.h>
+
+
#include <TestViewer.h>
#include <QApplication>
+#include <QAction>
+#include <QSplitter>
#include <QTest>
#define CPPUNIT_ASSERT_WIDGET( theWidget, theCase ) \
dlg->deleteLater();
qApp->processEvents();
}
+
+void test_HYDROGUI_ProfilesDlg::test_points_table()
+{
+ HYDROGUI_ProfileDlg* dlg = new HYDROGUI_ProfileDlg( 0, "test" );
+ dlg->resize( 320, 800 );
+
+ HYDROGUI_CurveCreatorProfile* aProfile = new HYDROGUI_CurveCreatorProfile();
+ CurveCreator::Coordinates coords;
+ coords.push_back( 0 );
+ coords.push_back( 20 );
+ coords.push_back( 30 );
+ coords.push_back( 0 );
+ coords.push_back( 60 );
+ coords.push_back( 0 );
+ coords.push_back( 90 );
+ coords.push_back( 20 );
+ aProfile->addPoints( coords, 0 );
+
+ dlg->setProfile( aProfile );
+ dlg->show();
+ QTest::qWaitForWindowExposed( dlg );
+
+ Handle(AIS_InteractiveContext) aCtx = dlg->getAISContext();
+ CurveCreator_Displayer* aDisplayer = new CurveCreator_Displayer( aCtx );
+ aProfile->setDisplayer( aDisplayer );
+ aDisplayer->display( aProfile->getAISObject( true ), true );
+
+ CurveCreator_ICurve::SectionToPointList sel;
+ sel.push_back( CurveCreator_ICurve::SectionToPoint( 0, 0 ) );
+ sel.push_back( CurveCreator_ICurve::SectionToPoint( 0, 1 ) );
+ sel.push_back( CurveCreator_ICurve::SectionToPoint( 0, 2 ) );
+ sel.push_back( CurveCreator_ICurve::SectionToPoint( 0, 3 ) );
+ dlg->myEditorWidget->getAction( CurveCreator_Widget::ModificationMode )->toggle();
+ dlg->myEditorWidget->onModificationMode( true );
+ dlg->myEditorWidget->setSelectedPoints( sel );
+ dlg->myEditorWidget->updateLocalPointView();
+
+ QList<int> sizes;
+ sizes.append( 25 );
+ sizes.append( 100 );
+ sizes.append( 200 );
+ sizes.append( 25 );
+ sizes.append( 25 );
+ dlg->splitter()->setSizes( sizes );
+
+ qApp->processEvents();
+
+ QTest::qWait( 50000 );
+
+ dlg->deleteLater();
+ delete aProfile;
+ delete aDisplayer;
+ qApp->processEvents();
+}