QPoint c = center();
double x1, y1, z1, x2, y2, z2;
main->getView()->Convert( main->width()/2, main->height()/2, x1, y1, z1 );
+
+ // Patch for OCCT 6.9.1, on 7.0.0 the moving of point to plane XY is not necessary
+ gp_Dir dm = main->getView()->Camera()->Direction();
+ double t1 = -z1/dm.Z();
+ x1 += dm.X()*t1;
+ y1 += dm.Y()*t1;
+ z1 += dm.Z()*t1;
+
overview->getView()->Convert( c.x(), c.y(), x2, y2, z2 );
+ gp_Dir dov = overview->getView()->Camera()->Direction();
+ double t2 = -z2/dov.Z();
+ x2 += dov.X()*t2;
+ y2 += dov.Y()*t2;
+ z2 += dov.Z()*t2;
gp_Trsf aTrsf;
aTrsf.SetTranslation( gp_Pnt( x1, y1, z1 ), gp_Pnt( x2, y2, z2 ) );
- main->getView()->Camera()->Transform( aTrsf );
+
+ // Temporary patch for bug in OCCT 6.9.1
+ Handle(Graphic3d_Camera) cam = main->getView()->Camera();
+ gp_Dir u = cam->Up(), nu = u.Transformed (aTrsf);
+ gp_Pnt e = cam->Eye(), ne = e.Transformed (aTrsf);
+ gp_Pnt cen = cam->Center(), ncen = cen.Transformed (aTrsf);
+
+ if (!nu.IsEqual (u, 0.0))
+ cam->SetUp(nu);
+
+ if (!ne.IsEqual (e, 0.0))
+ cam->SetEye(ne);
+
+ if (!ncen.IsEqual(cen, 0.0))
+ cam->SetCenter (ncen);
+
+ //version for new OCCT:
+ //main->getView()->Camera()->Transform( aTrsf );
main->repaint();
}
}
{ \
QString aMessage; \
QImage aDump = dumpViews(); \
- if( !TestViewer::AssertImages( aMessage, &aDump, theCase ) ) \
+ if( !TestViewer::AssertImages( aMessage, &aDump, theCase, false ) ) \
{ \
TestViewer::showColorScale( false ); \
std::string aMessageStl = aMessage.toStdString(); \
QImage aMain = TestViewer::viewWindow()->getView(OCCViewer_ViewFrame::MAIN_VIEW)->dumpView();
QImage anOverview = myOverview->dump();
- aMain = aMain.rgbSwapped(); //PATCH for image came from OCCT dump
+ aMain = aMain.rgbSwapped(); //PATCH for image came from OCCT dump
//anOverview = anOverview.rgbSwapped(); //overview dump already normalizes the image, the line is not necessary!!!
int w1 = aMain.width();
myOverview->show();
myOverview->setMainView( TestViewer::viewWindow() );
TestViewer::viewWindow()->setGeometry( 400, 100, 800, 800 );
+ TestViewer::viewWindow()->onTopView();
myOverview->setGeometry( 100, 100, 200, 200 );
isPassed = true;
void test_Overview::test_default()
{
create();
+ //QTest::qWait( 50000 );
CPPUNIT_ASSERT_OVERVIEW( "overview_empty" );
}
{
create();
showShape();
+ TestViewer::viewWindow()->onTopView();
OCCViewer_ViewWindow* aMain = TestViewer::viewWindow()->getView( OCCViewer_ViewFrame::MAIN_VIEW );
OCCViewer_ViewPort3d* vp = aMain->getViewPort();