diff --git a/samples/mfc/standard/01_Geometry/src/GeometryDoc.h b/samples/mfc/standard/01_Geometry/src/GeometryDoc.h index 8b8a61530b..b90fa3e1a7 100755 --- a/samples/mfc/standard/01_Geometry/src/GeometryDoc.h +++ b/samples/mfc/standard/01_Geometry/src/GeometryDoc.h @@ -1,244 +1,244 @@ -// GeometryDoc.h : interface of the CGeometryDoc class -// -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_) -#define AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include "ISession2D_InteractiveContext.h" -#include "ResultDialog.h" - -class Handle_AIS_Point; - -class CGeometryDoc : public CDocument -{ -public: - void Put2DOnTop(bool isMax = true); - void Put3DOnTop(bool isMax = true); - void Fit2DViews(); - void Set3DViewsZoom(const Quantity_Factor& Coef ); - void Fit3DViews(Quantity_Coefficient Coef); - void simplify(const TopoDS_Shape& aShape); - - - static void Fit(); - - // 2D - - void DragEvent2D (const Standard_Integer x , - const Standard_Integer y , - const Standard_Integer TheState, - const Handle_V2d_View& aView ); - void InputEvent2D (const Standard_Integer x , - const Standard_Integer y , - const Handle_V2d_View& aView ); - void MoveEvent2D (const Standard_Integer x , - const Standard_Integer y , - const Handle_V2d_View& aView ); - void ShiftMoveEvent2D (const Standard_Integer x , - const Standard_Integer y , - const Handle_V2d_View& aView ); - void ShiftDragEvent2D (const Standard_Integer x , - const Standard_Integer y , - const Standard_Integer TheState, - const Handle_V2d_View& aView ); - void ShiftInputEvent2D (const Standard_Integer x , - const Standard_Integer y , - const Handle_V2d_View& aView ); - void Popup2D (const Standard_Integer x , - const Standard_Integer y , - const Handle_V2d_View& aView ); - - Handle_AIS_InteractiveObject drawSurface - (const Handle_Geom_Surface& theSurface, - const Quantity_Color& theColor, - const Standard_Boolean toDisplay); - +// GeometryDoc.h : interface of the CGeometryDoc class +// +///////////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_) +#define AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +#include "ISession2D_InteractiveContext.h" +#include "ResultDialog.h" + +class Handle_AIS_Point; + +class CGeometryDoc : public CDocument +{ +public: + void Put2DOnTop(bool isMax = true); + void Put3DOnTop(bool isMax = true); + void Fit2DViews(); + void Set3DViewsZoom(const Quantity_Factor& Coef ); + void Fit3DViews(Quantity_Coefficient Coef); + void simplify(const TopoDS_Shape& aShape); + + + static void Fit(); + + // 2D + + void DragEvent2D (const Standard_Integer x , + const Standard_Integer y , + const Standard_Integer TheState, + const Handle_V2d_View& aView ); + void InputEvent2D (const Standard_Integer x , + const Standard_Integer y , + const Handle_V2d_View& aView ); + void MoveEvent2D (const Standard_Integer x , + const Standard_Integer y , + const Handle_V2d_View& aView ); + void ShiftMoveEvent2D (const Standard_Integer x , + const Standard_Integer y , + const Handle_V2d_View& aView ); + void ShiftDragEvent2D (const Standard_Integer x , + const Standard_Integer y , + const Standard_Integer TheState, + const Handle_V2d_View& aView ); + void ShiftInputEvent2D (const Standard_Integer x , + const Standard_Integer y , + const Handle_V2d_View& aView ); + void Popup2D (const Standard_Integer x , + const Standard_Integer y , + const Handle_V2d_View& aView ); + + Handle_AIS_InteractiveObject drawSurface + (const Handle_Geom_Surface& theSurface, + const Quantity_Color& theColor, + const Standard_Boolean toDisplay); + Standard_Boolean WaitForInput (unsigned long aMilliSeconds); - // Waits for a user input or a period of time has been elapsed - + // Waits for a user input or a period of time has been elapsed + Handle_AIS_Point drawPoint (const gp_Pnt& thePnt, const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN), const Standard_Boolean toDisplay = Standard_True); // creates a presentation of the given point - // and displays it in the viewer if toDisplay = Standard_True - + // and displays it in the viewer if toDisplay = Standard_True + Handle_AIS_Shape drawShape (const TopoDS_Shape& theShape, const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS, const Standard_Boolean toDisplay = Standard_True); // creates a presentation of the given shape with the given material // (color is default for a given material) - // and displays it in the viewer if toDisplay = Standard_True - -protected: // create from serialization only - CGeometryDoc(); - DECLARE_DYNCREATE(CGeometryDoc) - -// Attributes -public: - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CGeometryDoc) - public: - virtual BOOL OnNewDocument(); - virtual void Serialize(CArchive& ar); - virtual void OnCloseDocument(); - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CGeometryDoc(); -#ifdef _DEBUG - virtual void AssertValid() const; - virtual void Dump(CDumpContext& dc) const; -#endif - -protected: - -// Generated message map functions -protected: - //{{AFX_MSG(CGeometryDoc) - afx_msg void OnWindowNew2d(); - afx_msg void OnBUTTONTest1(); - afx_msg void OnBUTTONTest2(); - afx_msg void OnBUTTONTest3(); - afx_msg void OnBUTTONTest4(); - afx_msg void OnBUTTONTest5(); - afx_msg void OnBUTTONTest6(); - afx_msg void OnBUTTONTest7(); - afx_msg void OnBUTTONTest8(); - afx_msg void OnBUTTONTest9(); - afx_msg void OnBUTTONTest10(); - afx_msg void OnBUTTONTest11(); - afx_msg void OnBUTTONTest12(); - afx_msg void OnBUTTONTest13(); - afx_msg void OnBUTTONTest14(); - afx_msg void OnBUTTONTest15(); - afx_msg void OnBUTTONTest16(); - afx_msg void OnBUTTONTest17(); - afx_msg void OnBUTTONTest18(); - afx_msg void OnBUTTONTest19(); - afx_msg void OnBUTTONTest20(); - afx_msg void OnBUTTONTest21(); - afx_msg void OnBUTTONTest22(); - afx_msg void OnBUTTONTest23(); - afx_msg void OnBUTTONTest24(); - afx_msg void OnBUTTONTest25(); - afx_msg void OnBUTTONTest26(); - afx_msg void OnBUTTONTest27(); - afx_msg void OnBUTTONTest28(); - afx_msg void OnBUTTONTest29(); - afx_msg void OnBUTTONTest30(); - afx_msg void OnBUTTONTest31(); - afx_msg void OnBUTTONTest32(); - afx_msg void OnBUTTONTest33(); - afx_msg void OnBUTTONTest34(); - afx_msg void OnBUTTONTest35(); - afx_msg void OnBUTTONTest36(); - afx_msg void OnBUTTONTest37(); - afx_msg void OnBUTTONTest38(); - afx_msg void OnBUTTONTest39(); - afx_msg void OnBUTTONTest40(); - afx_msg void OnBUTTONTest41(); - afx_msg void OnBUTTONTest42(); - afx_msg void OnBUTTONTest43(); - afx_msg void OnBUTTONTest44(); - afx_msg void OnBUTTONTest45(); - afx_msg void OnBUTTONTest46(); - afx_msg void OnBUTTONTest47(); - afx_msg void OnBUTTONTest48(); - afx_msg void OnBUTTONTest49(); - afx_msg void OnBUTTONTest50(); - afx_msg void OnUpdateBUTTONTest1(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest2(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest3(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest4(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest5(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest6(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest7(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest8(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest9(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest10(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest11(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest12(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest13(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest14(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest15(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest16(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest17(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest18(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest19(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest20(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest21(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest22(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest23(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest24(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest25(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest26(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest27(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest28(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest29(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest30(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest31(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest32(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest33(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest34(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest35(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest36(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest37(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest38(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest39(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest40(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest41(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest42(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest43(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest44(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest45(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest46(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest47(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest48(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest49(CCmdUI* pCmdUI); - afx_msg void OnUpdateBUTTONTest50(CCmdUI* pCmdUI); - afx_msg void OnCreateSol(); - afx_msg void OnSimplify(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - - -private: - Handle_V3d_Viewer myViewer; - Handle_V3d_Viewer myViewerCollector; - Handle_AIS_InteractiveContext myAISContext; -public : - Handle_AIS_InteractiveContext& GetAISContext(){ return myAISContext; }; - Handle_V3d_Viewer GetViewer() { return myViewer; }; - Handle_V3d_Viewer GetViewerCollector() { return myViewerCollector; }; - - -private: - Handle_V2d_Viewer myViewer2D; - Handle_ISession2D_InteractiveContext myISessionContext; -public : - int Current; - void Minimize3D(); - void Minimize2D(); - Handle_V2d_Viewer GetViewer2D() { return myViewer2D; }; - Handle_ISession2D_InteractiveContext& GetISessionContext(){ return myISessionContext; }; - BOOL FitMode; - -public : - CResultDialog myCResultDialog; - -}; - -///////////////////////////////////////////////////////////////////////////// - -#endif // !defined(AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_) + // and displays it in the viewer if toDisplay = Standard_True + +protected: // create from serialization only + CGeometryDoc(); + DECLARE_DYNCREATE(CGeometryDoc) + +// Attributes +public: + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CGeometryDoc) + public: + virtual BOOL OnNewDocument(); + virtual void Serialize(CArchive& ar); + virtual void OnCloseDocument(); + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CGeometryDoc(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + +// Generated message map functions +protected: + //{{AFX_MSG(CGeometryDoc) + afx_msg void OnWindowNew2d(); + afx_msg void OnBUTTONTest1(); + afx_msg void OnBUTTONTest2(); + afx_msg void OnBUTTONTest3(); + afx_msg void OnBUTTONTest4(); + afx_msg void OnBUTTONTest5(); + afx_msg void OnBUTTONTest6(); + afx_msg void OnBUTTONTest7(); + afx_msg void OnBUTTONTest8(); + afx_msg void OnBUTTONTest9(); + afx_msg void OnBUTTONTest10(); + afx_msg void OnBUTTONTest11(); + afx_msg void OnBUTTONTest12(); + afx_msg void OnBUTTONTest13(); + afx_msg void OnBUTTONTest14(); + afx_msg void OnBUTTONTest15(); + afx_msg void OnBUTTONTest16(); + afx_msg void OnBUTTONTest17(); + afx_msg void OnBUTTONTest18(); + afx_msg void OnBUTTONTest19(); + afx_msg void OnBUTTONTest20(); + afx_msg void OnBUTTONTest21(); + afx_msg void OnBUTTONTest22(); + afx_msg void OnBUTTONTest23(); + afx_msg void OnBUTTONTest24(); + afx_msg void OnBUTTONTest25(); + afx_msg void OnBUTTONTest26(); + afx_msg void OnBUTTONTest27(); + afx_msg void OnBUTTONTest28(); + afx_msg void OnBUTTONTest29(); + afx_msg void OnBUTTONTest30(); + afx_msg void OnBUTTONTest31(); + afx_msg void OnBUTTONTest32(); + afx_msg void OnBUTTONTest33(); + afx_msg void OnBUTTONTest34(); + afx_msg void OnBUTTONTest35(); + afx_msg void OnBUTTONTest36(); + afx_msg void OnBUTTONTest37(); + afx_msg void OnBUTTONTest38(); + afx_msg void OnBUTTONTest39(); + afx_msg void OnBUTTONTest40(); + afx_msg void OnBUTTONTest41(); + afx_msg void OnBUTTONTest42(); + afx_msg void OnBUTTONTest43(); + afx_msg void OnBUTTONTest44(); + afx_msg void OnBUTTONTest45(); + afx_msg void OnBUTTONTest46(); + afx_msg void OnBUTTONTest47(); + afx_msg void OnBUTTONTest48(); + afx_msg void OnBUTTONTest49(); + afx_msg void OnBUTTONTest50(); + afx_msg void OnUpdateBUTTONTest1(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest2(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest3(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest4(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest5(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest6(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest7(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest8(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest9(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest10(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest11(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest12(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest13(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest14(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest15(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest16(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest17(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest18(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest19(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest20(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest21(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest22(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest23(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest24(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest25(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest26(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest27(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest28(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest29(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest30(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest31(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest32(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest33(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest34(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest35(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest36(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest37(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest38(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest39(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest40(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest41(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest42(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest43(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest44(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest45(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest46(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest47(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest48(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest49(CCmdUI* pCmdUI); + afx_msg void OnUpdateBUTTONTest50(CCmdUI* pCmdUI); + afx_msg void OnCreateSol(); + afx_msg void OnSimplify(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + + +private: + Handle_V3d_Viewer myViewer; + Handle_V3d_Viewer myViewerCollector; + Handle_AIS_InteractiveContext myAISContext; +public : + Handle_AIS_InteractiveContext& GetAISContext(){ return myAISContext; }; + Handle_V3d_Viewer GetViewer() { return myViewer; }; + Handle_V3d_Viewer GetViewerCollector() { return myViewerCollector; }; + + +private: + Handle_V2d_Viewer myViewer2D; + Handle_ISession2D_InteractiveContext myISessionContext; +public : + int Current; + void Minimize3D(); + void Minimize2D(); + Handle_V2d_Viewer GetViewer2D() { return myViewer2D; }; + Handle_ISession2D_InteractiveContext& GetISessionContext(){ return myISessionContext; }; + BOOL FitMode; + +public : + CResultDialog myCResultDialog; + +}; + +///////////////////////////////////////////////////////////////////////////// + +#endif // !defined(AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_) diff --git a/samples/qt/Graphic3dDemo/src/Application.cxx b/samples/qt/Graphic3dDemo/src/Application.cxx index 543c0cee9a..0f5d737430 100755 --- a/samples/qt/Graphic3dDemo/src/Application.cxx +++ b/samples/qt/Graphic3dDemo/src/Application.cxx @@ -1,5 +1,5 @@ #include - + #include #include #include @@ -15,14 +15,14 @@ #include #include -#include +#include #include #include #include #include #include #include -#include +#include #include #include "global.h" @@ -44,15 +44,15 @@ Application::Application() : QMainWindow( 0 ) stApp = this; myIsDocuments = false; - // create and define the central widget - QFrame* vBox = new QFrame( this ); + // create and define the central widget + QFrame* vBox = new QFrame( this ); vBox->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); - QVBoxLayout* main = new QVBoxLayout( vBox ); - main->setMargin( 0 ); - - myWorkSpace = new QWorkspace( vBox ); + QVBoxLayout* main = new QVBoxLayout( vBox ); + main->setMargin( 0 ); + + myWorkSpace = new QWorkspace( vBox ); main->addWidget( myWorkSpace ); - setCentralWidget( vBox ); + setCentralWidget( vBox ); createActions(); createCCActions(); @@ -66,12 +66,12 @@ Application::Application() : QMainWindow( 0 ) myOutput->show(); #else myOutput = 0; -#endif - myViewDlg = NULL; +#endif + myViewDlg = NULL; } Application::~Application() -{ +{ if (myViewDlg) delete myViewDlg; if (myOutput) delete myOutput; } @@ -83,13 +83,13 @@ void Application::createActions() helpIcon( dir + tr( "ICON_HELP" ) ), closeIcon( dir + tr( "ICON_CLOSE" ) ), autoIcon( dir + tr( "ICON_AUTO_TEST" ) ), - optimIcon( dir + tr( "ICON_OPTIM" ) ), + optimIcon( dir + tr( "ICON_OPTIM" ) ), stopIcon( dir + tr( "ICON_STOP" ) ), tileIcon( dir + tr( "ICON_TILE" ) ), cascadeIcon( dir + tr( "ICON_CASCADE" ) ); // toolbar with standard actions: new, save... - myStdToolBar = new QToolBar( this ); + myStdToolBar = new QToolBar( this ); addToolBar( Qt::TopToolBarArea, myStdToolBar ); // menu with all actions @@ -110,78 +110,78 @@ void Application::createActions() QMenu* help = menuBar()->addMenu( tr( "MEN_HELP" ) ); menuBar()->addSeparator(); - QAction* a = new QAction( newIcon, tr( "MEN_NEW" ), this ); - a->setToolTip( tr( "TBR_NEW" ) ); + QAction* a = new QAction( newIcon, tr( "MEN_NEW" ), this ); + a->setToolTip( tr( "TBR_NEW" ) ); a->setShortcut( Qt::CTRL+Qt::Key_N ); verify( connect( a, SIGNAL( activated() ), this, SLOT( onNewDocument() ) ) ); - myStdActions.insert( FileNewId, a ); - myStdToolBar->addAction( a ); + myStdActions.insert( FileNewId, a ); + myStdToolBar->addAction( a ); myFilePopup ->addAction( a ); a = new QAction( tr( "MEN_QUIT" ), this ); - a->setShortcut( Qt::CTRL+Qt::Key_Q ); - a->setToolTip( tr( "TBR_QUIT" ) ); + a->setShortcut( Qt::CTRL+Qt::Key_Q ); + a->setToolTip( tr( "TBR_QUIT" ) ); verify( connect( a, SIGNAL( activated() ), qApp, SLOT( closeAllWindows() ) ) ); myStdActions.insert( FileQuitId, a ); - myFilePopup ->addAction( a ); + myFilePopup ->addAction( a ); a = new QAction( tr( "MEN_TOOL_BAR" ), this ); - a->setToolTip( tr( "TBR_TOOL_BAR" ) ); + a->setToolTip( tr( "TBR_TOOL_BAR" ) ); verify( connect( a, SIGNAL( activated() ), this, SLOT( onViewToolBar() ) ) ); a->setCheckable(true); a->setChecked( true ); myStdActions.insert( ViewToolId, a ); - view->addAction( a ); + view->addAction( a ); a = new QAction( tr("MEN_STATUS_BAR"), this ); - a->setToolTip( tr( "TBR_STATUS_BAR" ) ); + a->setToolTip( tr( "TBR_STATUS_BAR" ) ); verify( connect( a, SIGNAL( activated() ), this, SLOT( onViewStatusBar() ) ) ); a->setCheckable(true); a->setChecked( true ); myStdActions.insert( ViewStatusId, a ); - view->addAction( a ); + view->addAction( a ); a = new QAction( helpIcon, tr( "MEN_ABOUT" ), this ); - a->setShortcut( Qt::Key_F1 ); - a->setToolTip( tr( "TBR_ABOUT" ) ); + a->setShortcut( Qt::Key_F1 ); + a->setToolTip( tr( "TBR_ABOUT" ) ); verify( connect( a, SIGNAL( activated() ) , this, SLOT( onAbout() ) ) ); myStdActions.insert( HelpAboutId, a ); myStdToolBar->addAction( a ); - help->addAction( a ); + help->addAction( a ); myStdToolBar->addSeparator(); // Tools menu actions a = new QAction( optimIcon, tr( "MEN_OPTIM" ), this ); - a->setToolTip( tr( "TBR_OPTIM" ) ); + a->setToolTip( tr( "TBR_OPTIM" ) ); verify( connect( a, SIGNAL( toggled(bool) ) , this, SLOT( onToggleOptim(bool) ) ) ); a->setCheckable(true); a->setChecked(Graphic3d_ArrayOfPrimitives::IsEnable()); myStdActions.insert( OptimId, a ); - myToolsMenu->addAction( a ); + myToolsMenu->addAction( a ); a = new QAction( autoIcon, tr( "TBR_AUTO_TEST" ), this ); - a->setToolTip( tr( "TBR_AUTO_TEST" ) ); + a->setToolTip( tr( "TBR_AUTO_TEST" ) ); verify( connect( a, SIGNAL( activated() ) , this, SLOT( onAutoTest() ) ) ); myStdActions.insert( AutoTestId, a ); - myToolsMenu->addAction( a ); - - a = new QAction( stopIcon, tr( "TBR_STOP" ), this ); - a->setToolTip( tr( "TBR_STOP" ) ); - verify( connect( a, SIGNAL( activated() ) , this, SLOT( onStop() ) ) ); - myStdActions.insert( StopId, a ); - myToolsMenu->addAction( a ); + myToolsMenu->addAction( a ); + + a = new QAction( stopIcon, tr( "TBR_STOP" ), this ); + a->setToolTip( tr( "TBR_STOP" ) ); + verify( connect( a, SIGNAL( activated() ) , this, SLOT( onStop() ) ) ); + myStdActions.insert( StopId, a ); + myToolsMenu->addAction( a ); // Window menu action a = new QAction( cascadeIcon, tr( "MEN_CASCADE" ), this ); verify( connect( a, SIGNAL( activated() ) , myWorkSpace, SLOT( cascade() ) ) ); myStdActions.insert( CascadeId, a ); - myWinMenu->addAction( a ); + myWinMenu->addAction( a ); a = new QAction( tileIcon, tr( "MEN_TILE" ), this ); verify( connect( a, SIGNAL( activated() ), myWorkSpace, SLOT( tile() ) ) ); myStdActions.insert( TileId, a ); - myWinMenu->addAction( a ); + myWinMenu->addAction( a ); } @@ -194,7 +194,7 @@ void Application::createIEPopups() { myImportPopup = new QMenu( tr( "MEN_FILE_IMPORT" ), this ); - QAction* a = new QAction( tr( "MEN_IMPORT_BREP" ), this ); + QAction* a = new QAction( tr( "MEN_IMPORT_BREP" ), this ); a->setToolTip( tr( "TBR_IMPORT_BREP" ) ); verify( connect( a, SIGNAL( activated() ) , SLOT( onTranslate() ) ) ); myCCActions.insert( FileImportBREPId, a ); @@ -223,8 +223,8 @@ void Application::updateWindowList() for ( int i = 0; i < int(lst.count()); ++i ) { QAction* a = myWinMenu->addAction( lst.at(i)->windowTitle(), - this, SLOT( activateWindow() ) ); - a->setCheckable( true ); + this, SLOT( activateWindow() ) ); + a->setCheckable( true ); a->setChecked( myWorkSpace->activeWindow() == lst.at(i) ); } } @@ -232,14 +232,14 @@ void Application::updateWindowList() } void Application::activateWindow() -{ - QAction* a = qobject_cast( sender() ); - if ( !a ) return; +{ + QAction* a = qobject_cast( sender() ); + if ( !a ) return; int idx = myWinMenu->actions().indexOf( a ) - 3; // tile, cascade and separator QWidget* w = myWorkSpace->windowList().at( idx ); if ( w ) { w->showNormal(); - w->setFocus(); + w->setFocus(); // w->setActiveWindow(); } } @@ -256,7 +256,7 @@ void Application::updateActions() { QAction* optim = myStdActions.at(OptimId); QAction* autoTest = myStdActions.at(AutoTestId); - QAction* stop = myStdActions.at(StopId); + QAction* stop = myStdActions.at(StopId); if( myNbDocuments ) { myFilePopup->insertMenu( myFilePopup->actions().last(), myImportPopup ); @@ -266,7 +266,7 @@ void Application::updateActions() if (optim) myStdToolBar->addAction( optim ); if (autoTest) myStdToolBar->addAction( autoTest ); - if (stop) myStdToolBar->addAction( stop ); + if (stop) myStdToolBar->addAction( stop ); stop->setEnabled(false); myIsDocuments = true; } @@ -380,10 +380,10 @@ void Application::onViewStatusBar() { bool show = myStdActions.at( ViewStatusId )->isChecked(); if ( show == statusBar()->isVisible() ) - return; - if ( show ) - statusBar()->show(); - else + return; + if ( show ) + statusBar()->show(); + else statusBar()->hide(); } @@ -413,13 +413,13 @@ MDIWindow* Application::getActiveMDI() void Application::onWindowActivated( QWidget* w ) { if ( w != NULL && w->inherits( "MDIWindow" ) ){ - myActiveMDI = (MDIWindow*)w; - w->setFocus(); - } - else if (myViewDlg) - { - delete myViewDlg; myViewDlg = NULL; - } + myActiveMDI = (MDIWindow*)w; + w->setFocus(); + } + else if (myViewDlg) + { + delete myViewDlg; myViewDlg = NULL; + } } void Application::startTimer() @@ -455,11 +455,11 @@ void Application::stopTimer( int count, const char* mes, bool addToGraph, int aO { QString qmes(mes); MDIWindow::ResultType type = MDIWindow::Undefined; - bool isOptOn = false; - if(aOpt >= 0) { - isOptOn |= (aOpt > 0); - } else { - isOptOn = Graphic3d_ArrayOfPrimitives::IsEnable(); + bool isOptOn = false; + if(aOpt >= 0) { + isOptOn |= (aOpt > 0); + } else { + isOptOn = Graphic3d_ArrayOfPrimitives::IsEnable(); } if (qmes.contains(tr("MES_DISPLAY"), Qt::CaseInsensitive)) type = isOptOn ? MDIWindow::DisplayOpt : MDIWindow::DisplayNonOpt; @@ -551,11 +551,11 @@ void Application::addResult(MDIWindow::ResultType item, double value) activeWin->addResult(item, nbTriangles, value); } -QWorkspace* Application::workspace() const -{ - return myWorkSpace; -} - +QWorkspace* Application::workspace() const +{ + return myWorkSpace; +} + void Application::keyPressEvent(QKeyEvent* e) { if (e->key() == Qt::Key_Escape) @@ -568,16 +568,16 @@ void Application::onAutoTest() if (autoDlg.exec() == QDialog::Accepted) { QApplication::setOverrideCursor( Qt::WaitCursor ); - myEscPressed = false; + myEscPressed = false; myStopPressed = false; - QAction* stop = myStdActions.at(StopId); - - stop->setEnabled(true); + QAction* stop = myStdActions.at(StopId); + + stop->setEnabled(true); // Define the range for testing int startItems = autoDlg.getStartNbItems(); int stopItems = autoDlg.getStopNbItems(); - int step = autoDlg.getStep(); + int step = autoDlg.getStep(); bool isTe = autoDlg.isText(); if (stopItems < startItems) stopItems = startItems; @@ -593,7 +593,7 @@ void Application::onAutoTest() qApp->processEvents(); if (myEscPressed || myStopPressed) { - QApplication::restoreOverrideCursor(); + QApplication::restoreOverrideCursor(); stop->setEnabled(false); return; } @@ -611,8 +611,8 @@ void Application::onAutoTest() if (!obj->IsKind(STANDARD_TYPE(AIS_Trihedron))) ctx->Remove(obj, false); } - ctx->UpdateCurrentViewer(); - + ctx->UpdateCurrentViewer(); + getActiveMDI()->getView()->SetScale(3.0316); // Generate new sphere @@ -627,21 +627,21 @@ void Application::onAutoTest() ctx->Display( sphere, false ); Application::stopTimer( 0, "Display Sphere::Sphere", true, useOptim); - qApp->processEvents(); - if (myEscPressed || myStopPressed) - { - QApplication::restoreOverrideCursor(); - stop->setEnabled(false); - return; - } - + qApp->processEvents(); + if (myEscPressed || myStopPressed) + { + QApplication::restoreOverrideCursor(); + stop->setEnabled(false); + return; + } + // Update the viewer Application::startTimer(); getActiveMDI()->getView()->Update(); - Application::stopTimer( 0, "UPDATE", true, useOptim); - } + Application::stopTimer( 0, "UPDATE", true, useOptim); + } } - QApplication::restoreOverrideCursor(); + QApplication::restoreOverrideCursor(); stop->setEnabled(false); } } @@ -667,29 +667,29 @@ void OutputWindow::print( QString& s ) myLineEdit->append( QString().setNum( myLineCounter ) + s ); myLineCounter++; } - -void Application::InitApp() -{ - onNewDocument(); -} - -void Application::onStop() -{ - myStopPressed = true; -} - -void Application::onEditViewProperties() -{ - if ( !myViewDlg ) { - myViewDlg = new ViewDlg(this); - verify( connect( myWorkSpace, SIGNAL( windowActivated( QWidget* ) ), - myViewDlg, SLOT( Update() ) ) ); - } - myViewDlg->raise(); - myViewDlg->show(); -} - -void Application::updateViewDlg() -{ - if(myViewDlg) myViewDlg->Update(); + +void Application::InitApp() +{ + onNewDocument(); +} + +void Application::onStop() +{ + myStopPressed = true; +} + +void Application::onEditViewProperties() +{ + if ( !myViewDlg ) { + myViewDlg = new ViewDlg(this); + verify( connect( myWorkSpace, SIGNAL( windowActivated( QWidget* ) ), + myViewDlg, SLOT( Update() ) ) ); + } + myViewDlg->raise(); + myViewDlg->show(); +} + +void Application::updateViewDlg() +{ + if(myViewDlg) myViewDlg->Update(); } \ No newline at end of file diff --git a/samples/qt/Graphic3dDemo/src/AutoTestDlg.cxx b/samples/qt/Graphic3dDemo/src/AutoTestDlg.cxx index bc846bc5a4..ac2709169b 100755 --- a/samples/qt/Graphic3dDemo/src/AutoTestDlg.cxx +++ b/samples/qt/Graphic3dDemo/src/AutoTestDlg.cxx @@ -8,7 +8,7 @@ AutoTestDlg::AutoTestDlg(QWidget* parent) : QDialog(parent) -{ +{ setModal( true ); setWindowTitle(tr("DLG_AUTO_TEST")); QString dir = Application::getResourceDir(); @@ -26,37 +26,37 @@ AutoTestDlg::AutoTestDlg(QWidget* parent) pMainLayout->addWidget(lab, 1, 0); lab = new QLabel(tr("LAB_STEP"), this); - pMainLayout->addWidget(lab, 2, 0); - - const int MinNbOfItems = 100000; // to see noticable effect - const int MaxNbOfItems = 1000000; // to avoid too long computations - const int ItemsStep = 100000; - const int MinStep = 50000; + pMainLayout->addWidget(lab, 2, 0); + + const int MinNbOfItems = 100000; // to see noticable effect + const int MaxNbOfItems = 1000000; // to avoid too long computations + const int ItemsStep = 100000; + const int MinStep = 50000; const int StepStep = 50000; - myStartSpin = new QSpinBox(this); - myStartSpin->setMinimum(MinNbOfItems); - myStartSpin->setMaximum(MaxNbOfItems); + myStartSpin = new QSpinBox(this); + myStartSpin->setMinimum(MinNbOfItems); + myStartSpin->setMaximum(MaxNbOfItems); myStartSpin->setSingleStep(ItemsStep); pMainLayout->addWidget(myStartSpin, 0, 1); - verify(connect(myStartSpin, SIGNAL(valueChanged(int)), SLOT(checkStepSpinState()))); + verify(connect(myStartSpin, SIGNAL(valueChanged(int)), SLOT(checkStepSpinState()))); myStopSpin = new QSpinBox(this); - myStopSpin->setMinimum(MinNbOfItems); - myStopSpin->setMaximum(MaxNbOfItems); - myStartSpin->setSingleStep(ItemsStep); - pMainLayout->addWidget(myStopSpin, 1, 1); - verify(connect(myStopSpin, SIGNAL(valueChanged(int)), SLOT(setStartMaxValue(int)))); - verify(connect(myStopSpin, SIGNAL(valueChanged(int)), SLOT(checkStepSpinState()))); - - const int StopSpinDefaultValue = 2 * myStartSpin -> minimum(); - myStopSpin -> setValue(StopSpinDefaultValue); - myStartSpin -> setMaximum(myStopSpin -> value()); + myStopSpin->setMinimum(MinNbOfItems); + myStopSpin->setMaximum(MaxNbOfItems); + myStartSpin->setSingleStep(ItemsStep); + pMainLayout->addWidget(myStopSpin, 1, 1); + verify(connect(myStopSpin, SIGNAL(valueChanged(int)), SLOT(setStartMaxValue(int)))); + verify(connect(myStopSpin, SIGNAL(valueChanged(int)), SLOT(checkStepSpinState()))); + + const int StopSpinDefaultValue = 2 * myStartSpin -> minimum(); + myStopSpin -> setValue(StopSpinDefaultValue); + myStartSpin -> setMaximum(myStopSpin -> value()); myStepSpin = new QSpinBox(this); - myStepSpin->setMinimum(MinStep); - myStepSpin->setMaximum(MaxNbOfItems - MinNbOfItems); - myStepSpin->setSingleStep(StepStep); + myStepSpin->setMinimum(MinStep); + myStepSpin->setMaximum(MaxNbOfItems - MinNbOfItems); + myStepSpin->setSingleStep(StepStep); pMainLayout->addWidget(myStepSpin, 2, 1); lab = new QLabel(tr("LAB_ITEMS"), this); @@ -68,24 +68,24 @@ AutoTestDlg::AutoTestDlg(QWidget* parent) lab = new QLabel(tr("LAB_ITEMS"), this); pMainLayout->addWidget(lab, 2, 2); - QFrame* separator = new QFrame(this); - separator->setFrameStyle(QFrame::HLine | QFrame::Sunken); - pMainLayout->addWidget(separator, 3, 0, 1, 3 ); - + QFrame* separator = new QFrame(this); + separator->setFrameStyle(QFrame::HLine | QFrame::Sunken); + pMainLayout->addWidget(separator, 3, 0, 1, 3 ); + QHBoxLayout* hcbox = new QHBoxLayout(); - hcbox->setSpacing(5); - - myTeCheck = new QCheckBox(tr( "MEN_BTN_TEXT" ), this); - hcbox->addWidget(myTeCheck); - verify(connect(myTeCheck, SIGNAL(clicked()), this, SLOT(onText()))); - - hcbox->addSpacing( 5 ); - - pMainLayout->addLayout(hcbox, 4, 0, 1, 3); - - QHBoxLayout* hbox = new QHBoxLayout(); - hbox->setSpacing(5); - + hcbox->setSpacing(5); + + myTeCheck = new QCheckBox(tr( "MEN_BTN_TEXT" ), this); + hcbox->addWidget(myTeCheck); + verify(connect(myTeCheck, SIGNAL(clicked()), this, SLOT(onText()))); + + hcbox->addSpacing( 5 ); + + pMainLayout->addLayout(hcbox, 4, 0, 1, 3); + + QHBoxLayout* hbox = new QHBoxLayout(); + hbox->setSpacing(5); + QPushButton* btn = new QPushButton(tr("BTN_START"), this); // btn->setDefault(true); verify(connect(btn, SIGNAL(clicked()), this, SLOT(onStart()))); @@ -96,7 +96,7 @@ AutoTestDlg::AutoTestDlg(QWidget* parent) btn->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); hbox->addWidget(btn); hbox->addSpacing(5); - pMainLayout->addLayout(hbox, 5, 0, 1, 3); + pMainLayout->addLayout(hbox, 5, 0, 1, 3); } void AutoTestDlg::onStart() @@ -107,63 +107,63 @@ void AutoTestDlg::onStart() void AutoTestDlg::onCancel() { reject(); -} - -void AutoTestDlg::setStartMaxValue(int i) -{ - myStartSpin -> setMaximum(i); - if (myStartSpin -> value() > myStartSpin -> maximum()) - myStartSpin -> setValue(myStartSpin -> maximum()); -} - -void AutoTestDlg::checkStepSpinState() -{ - if (isVisible()) - { - if (myStartSpin -> value() == myStopSpin -> value()) - myStepSpin -> setEnabled(false); - else - myStepSpin -> setEnabled(true); - } -} - -void AutoTestDlg::onText() -{ - int MinNbOfItems, MaxNbOfItems, DefaultStartSpinVal, DefaultStopSpinVal, - ItemsStep, MinStep, StepStep; - - if (myTeCheck -> isChecked()) - { - MinNbOfItems = 1000; // to see noticeable effect - MaxNbOfItems = 100000; // to avoid too long computations - DefaultStartSpinVal = 10000; - DefaultStopSpinVal = 20000; - ItemsStep = 10000; - MinStep = 5000; - StepStep = 5000; - } - else - { - MinNbOfItems = 100000; // to see noticeable effect - MaxNbOfItems = 1000000; // to avoid too long computations - DefaultStartSpinVal = 100000; - DefaultStopSpinVal = 200000; - ItemsStep = 100000; - MinStep = 50000; - StepStep = 50000; - } - - myStartSpin -> setRange(MinNbOfItems, MaxNbOfItems); - myStartSpin -> setSingleStep(ItemsStep); - myStartSpin -> setValue(DefaultStartSpinVal); - - myStopSpin -> setRange(MinNbOfItems, MaxNbOfItems); - myStopSpin -> setSingleStep(ItemsStep); - - myStopSpin -> setValue(DefaultStopSpinVal); - myStartSpin -> setMaximum(myStopSpin -> value()); - - myStepSpin -> setRange(MinStep, MaxNbOfItems - MinNbOfItems); - myStepSpin -> setSingleStep(StepStep); - myStepSpin -> setValue(MinStep); +} + +void AutoTestDlg::setStartMaxValue(int i) +{ + myStartSpin -> setMaximum(i); + if (myStartSpin -> value() > myStartSpin -> maximum()) + myStartSpin -> setValue(myStartSpin -> maximum()); +} + +void AutoTestDlg::checkStepSpinState() +{ + if (isVisible()) + { + if (myStartSpin -> value() == myStopSpin -> value()) + myStepSpin -> setEnabled(false); + else + myStepSpin -> setEnabled(true); + } +} + +void AutoTestDlg::onText() +{ + int MinNbOfItems, MaxNbOfItems, DefaultStartSpinVal, DefaultStopSpinVal, + ItemsStep, MinStep, StepStep; + + if (myTeCheck -> isChecked()) + { + MinNbOfItems = 1000; // to see noticeable effect + MaxNbOfItems = 100000; // to avoid too long computations + DefaultStartSpinVal = 10000; + DefaultStopSpinVal = 20000; + ItemsStep = 10000; + MinStep = 5000; + StepStep = 5000; + } + else + { + MinNbOfItems = 100000; // to see noticeable effect + MaxNbOfItems = 1000000; // to avoid too long computations + DefaultStartSpinVal = 100000; + DefaultStopSpinVal = 200000; + ItemsStep = 100000; + MinStep = 50000; + StepStep = 50000; + } + + myStartSpin -> setRange(MinNbOfItems, MaxNbOfItems); + myStartSpin -> setSingleStep(ItemsStep); + myStartSpin -> setValue(DefaultStartSpinVal); + + myStopSpin -> setRange(MinNbOfItems, MaxNbOfItems); + myStopSpin -> setSingleStep(ItemsStep); + + myStopSpin -> setValue(DefaultStopSpinVal); + myStartSpin -> setMaximum(myStopSpin -> value()); + + myStepSpin -> setRange(MinStep, MaxNbOfItems - MinNbOfItems); + myStepSpin -> setSingleStep(StepStep); + myStepSpin -> setValue(MinStep); } \ No newline at end of file diff --git a/samples/qt/Graphic3dDemo/src/Document.cxx b/samples/qt/Graphic3dDemo/src/Document.cxx index 96b7ddca46..0a4277987d 100755 --- a/samples/qt/Graphic3dDemo/src/Document.cxx +++ b/samples/qt/Graphic3dDemo/src/Document.cxx @@ -41,7 +41,7 @@ Handle(V3d_Viewer) Document::Viewer( const Standard_CString aDisplay, Document::Document( int theIndex, Application* app ) : QObject( app ) -{ +{ myIndex = theIndex; myNbViews = 0; myApp = app; @@ -51,16 +51,16 @@ Document::Document( int theIndex, Application* app ) myViewer->SetDefaultLights(); myViewer->SetLightOn(); myViewer->SetZBufferManagment(false); - myContext = new AIS_InteractiveContext( myViewer ); - - createNewView(); + myContext = new AIS_InteractiveContext( myViewer ); + + createNewView(); myOperations = new ViewOperations( myContext ); } Document::~Document() -{ - qDeleteAll( myViews ); +{ + qDeleteAll( myViews ); } Application* Document::getApplication() @@ -73,7 +73,7 @@ void Document::createNewView( V3d_TypeOfView type ) QWorkspace* ws = myApp->getWorkspace(); MDIWindow* w = new MDIWindow( this, ws, type ); - myViews.append( w ); + myViews.append( w ); ws->addWindow( w ); //connect( w, SIGNAL( message(const QString&, int) ), myApp->statusBar(), SLOT( message(const QString&, int )) ); @@ -86,11 +86,11 @@ void Document::createNewView( V3d_TypeOfView type ) QString dir = Application::getResourceDir(); w->setWindowIcon( QPixmap( dir + tr( "ICON_DOC" ) ) ); - // show the very first window in maximized mode + // show the very first window in maximized mode if ( ws->windowList().isEmpty() ) w->showMaximized(); else - w->show(); + w->show(); } void Document::createMagView( int xMin, int yMin, int xMax, int yMax ) diff --git a/samples/qt/Graphic3dDemo/src/Graphic3dDemo.cxx b/samples/qt/Graphic3dDemo/src/Graphic3dDemo.cxx index 3ac0413133..94b225b411 100755 --- a/samples/qt/Graphic3dDemo/src/Graphic3dDemo.cxx +++ b/samples/qt/Graphic3dDemo/src/Graphic3dDemo.cxx @@ -3,28 +3,28 @@ #include #include #include -#include +#include #include #include "global.h" #include "Application.h" - -#define GLOBAL_CONTEXT "@default" - -class Translator : public QTranslator -{ -public: - Translator( QObject* parent = 0 ) : QTranslator( parent ) {} - virtual QString translate( const char* context, - const char* sourceText, - const char* comment = 0 ) const - { - QString res = QTranslator::translate( context, sourceText, comment ); - if( res.isNull() ) - res = QTranslator::translate( GLOBAL_CONTEXT, sourceText, comment ); - return res; - } -}; + +#define GLOBAL_CONTEXT "@default" + +class Translator : public QTranslator +{ +public: + Translator( QObject* parent = 0 ) : QTranslator( parent ) {} + virtual QString translate( const char* context, + const char* sourceText, + const char* comment = 0 ) const + { + QString res = QTranslator::translate( context, sourceText, comment ); + if( res.isNull() ) + res = QTranslator::translate( GLOBAL_CONTEXT, sourceText, comment ); + return res; + } +}; int main(int argc, char* argv[]) { @@ -46,8 +46,8 @@ int main(int argc, char* argv[]) app->setWindowIcon( pix ); QApplication::setOverrideCursor( Qt::WaitCursor ); - app->show(); - app->InitApp(); + app->show(); + app->InitApp(); QApplication::restoreOverrideCursor(); return a.exec(); diff --git a/samples/qt/Graphic3dDemo/src/MDIWindow.cxx b/samples/qt/Graphic3dDemo/src/MDIWindow.cxx index 617d49e942..8d175921ab 100755 --- a/samples/qt/Graphic3dDemo/src/MDIWindow.cxx +++ b/samples/qt/Graphic3dDemo/src/MDIWindow.cxx @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include "MDIWindow.h" @@ -26,8 +26,8 @@ MDIWindow::MDIWindow( Document* aDocument, QWidget* parent, V3d_TypeOfView type myDocument = aDocument; Handle(AIS_InteractiveContext) cxt = myDocument->getContext(); cxt->CurrentViewer()->SetDefaultTypeOfView( type ); - myView = new View( cxt, central, this ); - verify(connect(myView, SIGNAL(ViewInitialized()), + myView = new View( cxt, central, this ); + verify(connect(myView, SIGNAL(ViewInitialized()), Application::getApplication(), SLOT(updateViewDlg()))); // Graph initialization @@ -53,15 +53,15 @@ MDIWindow::MDIWindow( Document* aDocument, QWidget* parent, V3d_TypeOfView type pGraph->setYTitle(tr("LAB_SECONDS")); pGraph->installEventFilter(this); pGraph->setOperationEnabled(GraphView::voRect, true); - pGraph->setOperationEnabled(GraphView::voZoom, true); + pGraph->setOperationEnabled(GraphView::voZoom, true); pGraph->setOperationEnabled(GraphView::voZoomX, true); pGraph->setOperationEnabled(GraphView::voZoomY, true); - pGraph->setOperationEnabled(GraphView::voPan, true); - pGraph->setOperationEnabled(GraphView::voPanX, true); - pGraph->setOperationEnabled(GraphView::voPanY, true); - - central->setStretchFactor(0, 5); - central->setStretchFactor(1, 1); + pGraph->setOperationEnabled(GraphView::voPan, true); + pGraph->setOperationEnabled(GraphView::voPanX, true); + pGraph->setOperationEnabled(GraphView::voPanY, true); + + central->setStretchFactor(0, 5); + central->setStretchFactor(1, 1); setCentralWidget( central ); myGraphPopup = new QMenu(pGraph); @@ -73,8 +73,8 @@ MDIWindow::MDIWindow( Document* aDocument, QWidget* parent, V3d_TypeOfView type verify( connect( myOperations, SIGNAL( setCursor( const QCursor& ) ), SLOT( setCursor( const QCursor& ) ) ) ); - createViewActions(); - createGraphActions(); + createViewActions(); + createGraphActions(); } MDIWindow::~MDIWindow() @@ -99,16 +99,16 @@ void MDIWindow::closeEvent(QCloseEvent* e) void MDIWindow::createViewActions() { - QToolBar* aToolBar = new QToolBar( tr( "View Operations" ), this ); + QToolBar* aToolBar = new QToolBar( tr( "View Operations" ), this ); addToolBar( Qt::TopToolBarArea, aToolBar ); QList aList = myOperations->getToolActions(); QActionGroup* dModeGroup = new QActionGroup( aToolBar ); - QAction* a; - - int i = 0; - foreach( a, aList ) { + QAction* a; + + int i = 0; + foreach( a, aList ) { aToolBar->addAction( a ); // if ( i == 1 ) // aToolBar->addSeparator(); @@ -119,7 +119,7 @@ void MDIWindow::createViewActions() } aToolBar->addSeparator(); - aList = myOperations->getViewActions(); + aList = myOperations->getViewActions(); foreach( a, aList ) aToolBar->addAction( a ); } @@ -168,7 +168,7 @@ bool MDIWindow::eventFilter(QObject* dstObj, QEvent* event) void MDIWindow::createGraphActions() { - QAction* a = new QAction( tr( "MEN_GRAPH_FIT_ALL" ), this ); + QAction* a = new QAction( tr( "MEN_GRAPH_FIT_ALL" ), this ); a->setToolTip( tr( "TBR_GRAPH_FIT_ALL" ) ); verify( connect( a, SIGNAL( activated() ) , this, SLOT( onGraphFitAll() ) ) ); myGraphPopup->addAction( a ); @@ -176,9 +176,9 @@ void MDIWindow::createGraphActions() myGraphPopup->addSeparator(); a = new QAction( tr( "MEN_GRAPH_CLEAR" ), this ); - a->setToolTip( tr( "TBR_GRAPH_CLEAR" ) ); + a->setToolTip( tr( "TBR_GRAPH_CLEAR" ) ); verify( connect( a, SIGNAL( activated() ) , this, SLOT( onGraphClear() ) ) ); - myGraphPopup->addAction( a ); + myGraphPopup->addAction( a ); } void MDIWindow::graphPopup(const QPoint& pos) diff --git a/samples/qt/Graphic3dDemo/src/ObjectDlg.cxx b/samples/qt/Graphic3dDemo/src/ObjectDlg.cxx index c766a6032a..449f54d2c2 100755 --- a/samples/qt/Graphic3dDemo/src/ObjectDlg.cxx +++ b/samples/qt/Graphic3dDemo/src/ObjectDlg.cxx @@ -26,7 +26,7 @@ ObjectDlg::ObjectDlg( QWidget* parent, Handle(V3d_View)& view, Handle(AIS_InteractiveContext)& cxt ) : QDialog( parent ), myAutoApply( true ), myView( view ), myContext( cxt ) -{ +{ setModal( false ); setWindowTitle( tr( "TITLE_OBJECT_DLG" ) ); @@ -39,7 +39,7 @@ ObjectDlg::ObjectDlg( QWidget* parent, Handle(V3d_View)& view, topLayout->addSpacing( 10 ); // view properties - QGridLayout* pLayout = new QGridLayout( mainFrame ); + QGridLayout* pLayout = new QGridLayout( mainFrame ); pLayout->setMargin( 5 ); myDegModelLabel = new QLabel( tr("MEN_DLG_DEGMODEL"), mainFrame ); myDegRatioLabel = new QLabel( tr("MEN_DLG_DEGRATIO"), mainFrame ); @@ -56,8 +56,8 @@ ObjectDlg::ObjectDlg( QWidget* parent, Handle(V3d_View)& view, //QSpinBox* degRatioSpin = new QSpinBox( mainFrame ); //QSpinBox ( QWidget * parent = 0, const char * name = 0 ) - myDegRatioSpin = new QSpinBox( mainFrame ); - myDegRatioSpin->setRange(0, 10); + myDegRatioSpin = new QSpinBox( mainFrame ); + myDegRatioSpin->setRange(0, 10); myDegRatioSpin->setSingleStep(1); verify( connect( myDegRatioSpin, SIGNAL( valueChanged( int ) ), SLOT( onDegRatio( int ) ) ) ); @@ -77,8 +77,8 @@ ObjectDlg::ObjectDlg( QWidget* parent, Handle(V3d_View)& view, verify( connect( myEdgeBox, SIGNAL( activated( int ) ), SLOT( onEdgeStyle( int ) ) ) ); //myEdgeSpin = new QSpinBox( mainFrame ); - myEdgeSpin = new QSpinBox( mainFrame ); - myEdgeSpin->setRange(1, 10); + myEdgeSpin = new QSpinBox( mainFrame ); + myEdgeSpin->setRange(1, 10); myEdgeSpin->setSingleStep(10); verify( connect( myEdgeSpin, SIGNAL( valueChanged( int ) ), SLOT( onEdgeWidth( int ) ) ) ); @@ -105,7 +105,7 @@ ObjectDlg::ObjectDlg( QWidget* parent, Handle(V3d_View)& view, QHBoxLayout* applyLayout = new QHBoxLayout(); applyLayout->addWidget( autoApply ); - applyLayout->addStretch( 10 ); + applyLayout->addStretch( 10 ); topLayout->addLayout(applyLayout); topLayout->addSpacing( 10 ); @@ -115,17 +115,17 @@ ObjectDlg::ObjectDlg( QWidget* parent, Handle(V3d_View)& view, verify( connect( bOk, SIGNAL( clicked() ), SLOT( onOk() ) ) ); bCancel = new QPushButton( tr( "BTN_CANCEL" ), this ); verify( connect( bCancel, SIGNAL( clicked() ), SLOT( onCancel() ) ) ); -// bHelp = new QPushButton( tr( "BTN_HELP" ), this ); -// verify( connect( bHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ) ); +// bHelp = new QPushButton( tr( "BTN_HELP" ), this ); +// verify( connect( bHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ) ); QHBoxLayout* btnLayout = new QHBoxLayout(); btnLayout->setSpacing( 5 ); - btnLayout->addStretch( 10 ); + btnLayout->addStretch( 10 ); btnLayout->addWidget( bOk ); btnLayout->addWidget( bCancel ); btnLayout->addStretch( 10 ); // btnLayout->addWidget( bHelp ); - topLayout->addLayout(btnLayout); + topLayout->addLayout(btnLayout); QSize s = topLayout->totalMinimumSize(); s.setWidth( s.width() + topLayout->margin() + 10 ); @@ -241,38 +241,38 @@ void ObjectDlg::onAutoApply( bool on ) } void ObjectDlg::updateEdgeAspect( bool edgeStyle ) -{ - Aspect_TypeOfLine type; - if ( edgeStyle ) - switch( myCurrentEdgeStyle ) { - case SolidEdgeId : - type = Aspect_TOL_SOLID; - break; - case DashEdgeId : - type = Aspect_TOL_DASH; - break; - case DotEdgeId : - type = Aspect_TOL_DOT; - break; - case DotDashEdgeId : - type = Aspect_TOL_DOTDASH; - break; - } - Handle(AIS_InteractiveObject) object; - Handle(Prs3d_ShadingAspect) aspect; - myContext->InitSelected(); - for( ; myContext->MoreSelected(); myContext->NextSelected() ) { - object = myContext->SelectedInteractive(); - aspect = object->Attributes()->ShadingAspect(); - if ( edgeStyle ) - aspect->Aspect()->SetEdgeLineType( type ); - else - aspect->Aspect()->SetEdgeWidth( myCurrentEdgeWidth ); - object->SetAspect( aspect ); - } - if ( myAutoApply ) - //myContext->UpdateCurrentViewer(); - myView->Viewer()->Update(); +{ + Aspect_TypeOfLine type; + if ( edgeStyle ) + switch( myCurrentEdgeStyle ) { + case SolidEdgeId : + type = Aspect_TOL_SOLID; + break; + case DashEdgeId : + type = Aspect_TOL_DASH; + break; + case DotEdgeId : + type = Aspect_TOL_DOT; + break; + case DotDashEdgeId : + type = Aspect_TOL_DOTDASH; + break; + } + Handle(AIS_InteractiveObject) object; + Handle(Prs3d_ShadingAspect) aspect; + myContext->InitSelected(); + for( ; myContext->MoreSelected(); myContext->NextSelected() ) { + object = myContext->SelectedInteractive(); + aspect = object->Attributes()->ShadingAspect(); + if ( edgeStyle ) + aspect->Aspect()->SetEdgeLineType( type ); + else + aspect->Aspect()->SetEdgeWidth( myCurrentEdgeWidth ); + object->SetAspect( aspect ); + } + if ( myAutoApply ) + //myContext->UpdateCurrentViewer(); + myView->Viewer()->Update(); } void ObjectDlg::updateDegenerationModel() diff --git a/samples/qt/Graphic3dDemo/src/ShapeDlg.cxx b/samples/qt/Graphic3dDemo/src/ShapeDlg.cxx index 722ce84cbf..44cd91299d 100755 --- a/samples/qt/Graphic3dDemo/src/ShapeDlg.cxx +++ b/samples/qt/Graphic3dDemo/src/ShapeDlg.cxx @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include @@ -34,7 +34,7 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view, Handle(AIS_InteractiveContext)& cxt ) : QDialog( parent ), myView( view ), myContext( cxt ) -{ +{ setModal( false ); setWindowTitle( tr( "TITLE_SHAPE_DLG" ) ); @@ -43,7 +43,7 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view, myNbPanes = 0; myNbItems = 0; - QVBoxLayout* topLayout = new QVBoxLayout( this ); + QVBoxLayout* topLayout = new QVBoxLayout( this ); topLayout->setMargin( 5 ); // radius frame @@ -53,15 +53,15 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view, topLayout->addSpacing( 10 ); QHBoxLayout* rBox = new QHBoxLayout( rFrame ); - rBox->setMargin( 5 ); + rBox->setMargin( 5 ); QLabel* rad = new QLabel( tr( "MEN_DLG_RADIUS" ), rFrame ); - QDoubleSpinBox* rSpin = new QDoubleSpinBox( rFrame ); - rSpin->setRange( 1, 10000 ); - rSpin->setSingleStep( 1 ); + QDoubleSpinBox* rSpin = new QDoubleSpinBox( rFrame ); + rSpin->setRange( 1, 10000 ); + rSpin->setSingleStep( 1 ); // rSpin->setValueDouble( myRadius ); - rSpin->setValue( myRadius ); + rSpin->setValue( myRadius ); // verify( connect( rSpin, SIGNAL( sbdValueChanged( double ) ), SLOT( onRadiusChanged( double ) ) ) ); - verify( connect( rSpin, SIGNAL( valueChanged( double ) ), SLOT( onRadiusChanged( double ) ) ) ); + verify( connect( rSpin, SIGNAL( valueChanged( double ) ), SLOT( onRadiusChanged( double ) ) ) ); rBox->addWidget( rad ); rBox->addWidget( rSpin ); @@ -70,7 +70,7 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view, // sphere position frame QFrame* pFrame = new QFrame( this ); QHBoxLayout* pBox = new QHBoxLayout( pFrame ); - pBox->setMargin( 5 ); + pBox->setMargin( 5 ); pFrame->setFrameStyle( QFrame::Box | QFrame::Sunken ); topLayout->addWidget( pFrame ); @@ -82,22 +82,22 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view, lY = new QLabel( tr( "MEN_DLG_Y" ), pFrame ); lZ = new QLabel( tr( "MEN_DLG_Z" ), pFrame ); - myXSpin = new QDoubleSpinBox( pFrame ); - myXSpin->setRange( -10000, 10000 ); - myXSpin->setSingleStep( 1 ); - myXSpin->setValue( 0 ); - connect(myXSpin, SIGNAL(valueChanged (double)), SLOT(onPositionChanged())); - myYSpin = new QDoubleSpinBox( pFrame ); - myYSpin->setRange( -10000, 10000 ); - myYSpin->setSingleStep( 1 ); - myYSpin->setValue( 0 ); - connect(myYSpin, SIGNAL(valueChanged (double)), SLOT(onPositionChanged())); - myZSpin = new QDoubleSpinBox( pFrame ); - myZSpin->setRange( -10000, 10000 ); - myZSpin->setSingleStep( 1 ); - myZSpin->setValue( 0 ); - connect(myZSpin, SIGNAL(valueChanged (double)), SLOT(onPositionChanged())); - + myXSpin = new QDoubleSpinBox( pFrame ); + myXSpin->setRange( -10000, 10000 ); + myXSpin->setSingleStep( 1 ); + myXSpin->setValue( 0 ); + connect(myXSpin, SIGNAL(valueChanged (double)), SLOT(onPositionChanged())); + myYSpin = new QDoubleSpinBox( pFrame ); + myYSpin->setRange( -10000, 10000 ); + myYSpin->setSingleStep( 1 ); + myYSpin->setValue( 0 ); + connect(myYSpin, SIGNAL(valueChanged (double)), SLOT(onPositionChanged())); + myZSpin = new QDoubleSpinBox( pFrame ); + myZSpin->setRange( -10000, 10000 ); + myZSpin->setSingleStep( 1 ); + myZSpin->setValue( 0 ); + connect(myZSpin, SIGNAL(valueChanged (double)), SLOT(onPositionChanged())); + pBox->addStretch( 2 ); pBox->addWidget( lX ); @@ -113,7 +113,7 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view, // sphere aspect frame QFrame* aFrame = new QFrame( this ); QHBoxLayout* aBox = new QHBoxLayout( aFrame ); - aBox->setMargin( 5 ); + aBox->setMargin( 5 ); aFrame->setFrameStyle( QFrame::Box | QFrame::Sunken ); topLayout->addWidget( aFrame ); @@ -132,10 +132,10 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view, myVTexel->setText( tr( "MEN_BTN_VTEXEL" ) ); //verify( connect( myVTexel, SIGNAL( toggled( bool ) ), SLOT( onShowEdges( bool ) ) ) ); - myText = new QCheckBox( aFrame ); - myText->setText( tr( "MEN_BTN_TEXT" ) ); - verify( connect( myText, SIGNAL( clicked() ), SLOT( onText() ) ) ); - + myText = new QCheckBox( aFrame ); + myText->setText( tr( "MEN_BTN_TEXT" ) ); + verify( connect( myText, SIGNAL( clicked() ), SLOT( onText() ) ) ); + aBox->addStretch( 2 ); aBox->addWidget( myVNormal ); aBox->addStretch( 2 ); @@ -143,13 +143,13 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view, aBox->addStretch( 2 ); aBox->addWidget( myVTexel ); aBox->addStretch( 2 ); - aBox->addWidget( myText ); - aBox->addStretch( 2 ); + aBox->addWidget( myText ); + aBox->addStretch( 2 ); // tesselation frame QFrame* tFrame = new QFrame( this ); QHBoxLayout* tBox = new QHBoxLayout( tFrame ); - tBox->setMargin( 5 ); + tBox->setMargin( 5 ); tFrame->setFrameStyle( QFrame::Box | QFrame::Sunken ); topLayout->addWidget( tFrame ); @@ -161,18 +161,18 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view, panes = new QLabel( tr( "MEN_DLG_PANES" ), tFrame ); items = new QLabel( tr( "MEN_DLG_ITEMS" ), tFrame ); - myDefSpin = new QDoubleSpinBox( tFrame ); - myDefSpin->setRange( 0.1, 13 ); - myDefSpin->setSingleStep( 0.1 ); - myDefSpin->setValue( 1 ); - verify( connect( myDefSpin, SIGNAL( valueChanged( double ) ), SLOT( onDeflectionChanged( double ) ) ) ); - myPanesSpin = new QSpinBox( tFrame ); - myPanesSpin->setRange( 8, 10000 ); - myPanesSpin->setSingleStep( 1 ); + myDefSpin = new QDoubleSpinBox( tFrame ); + myDefSpin->setRange( 0.1, 13 ); + myDefSpin->setSingleStep( 0.1 ); + myDefSpin->setValue( 1 ); + verify( connect( myDefSpin, SIGNAL( valueChanged( double ) ), SLOT( onDeflectionChanged( double ) ) ) ); + myPanesSpin = new QSpinBox( tFrame ); + myPanesSpin->setRange( 8, 10000 ); + myPanesSpin->setSingleStep( 1 ); verify( connect( myPanesSpin, SIGNAL( valueChanged( int ) ), SLOT( onPanesChanged( int ) ) ) ); myItemsSpin = new QSpinBox( tFrame ); - myItemsSpin->setRange( 25, 10000000 ); - myItemsSpin->setSingleStep( 1 ); + myItemsSpin->setRange( 25, 10000000 ); + myItemsSpin->setSingleStep( 1 ); verify( connect( myItemsSpin, SIGNAL( valueChanged( int ) ), SLOT( onItemsChanged( int ) ) ) ); tBox->addWidget( defl ); @@ -188,19 +188,19 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view, bOk->setDefault(true); verify( connect( bOk, SIGNAL( clicked() ), SLOT( onOk() ) ) ); bCancel = new QPushButton( tr( "BTN_CANCEL" ), this ); - verify( connect( bCancel, SIGNAL( clicked() ), SLOT( onCancel() ) ) ); + verify( connect( bCancel, SIGNAL( clicked() ), SLOT( onCancel() ) ) ); verify( connect( this, SIGNAL( destroyed() ), SLOT( onCancel() ) ) ); -// bHelp = new QPushButton( tr( "BTN_HELP" ), this ); -// verify( connect( bHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ) ); +// bHelp = new QPushButton( tr( "BTN_HELP" ), this ); +// verify( connect( bHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ) ); QHBoxLayout* btnLayout = new QHBoxLayout(); - btnLayout->setSpacing( 5 ); + btnLayout->setSpacing( 5 ); btnLayout->addStretch( 10 ); btnLayout->addWidget( bOk ); btnLayout->addWidget( bCancel ); - btnLayout->addStretch( 10 ); -// btnLayout->addWidget( bHelp ); - topLayout->addLayout( btnLayout ); + btnLayout->addStretch( 10 ); +// btnLayout->addWidget( bHelp ); + topLayout->addLayout( btnLayout ); QSize s = topLayout->totalMinimumSize(); s.setWidth( s.width() + topLayout->margin() + 10 ); @@ -218,9 +218,9 @@ void ShapeDlg::showEvent ( QShowEvent* e ) // myXSpin->setValueDouble( 0 ); // myYSpin->setValueDouble( 0 ); // myZSpin->setValueDouble( 0 ); - myXSpin->setValue( 0 ); - myYSpin->setValue( 0 ); - myZSpin->setValue( 0 ); + myXSpin->setValue( 0 ); + myYSpin->setValue( 0 ); + myZSpin->setValue( 0 ); onRadiusChanged( myRadius ); } @@ -257,7 +257,7 @@ void ShapeDlg::onRadiusChanged( double value ) myPanesSpin->blockSignals( false ); myItemsSpin->blockSignals( false ); - + updateSphere(); } @@ -271,7 +271,7 @@ void ShapeDlg::onItemsChanged( int value ) myPanesSpin->blockSignals( true ); // myDefSpin->setValueDouble( myDeflection ); - myDefSpin->setValue( myDeflection ); + myDefSpin->setValue( myDeflection ); myPanesSpin->setValue( myNbPanes ); myDefSpin->blockSignals( false ); @@ -290,7 +290,7 @@ void ShapeDlg::onPanesChanged( int value ) myItemsSpin->blockSignals( true ); // myDefSpin->setValueDouble( myDeflection ); - myDefSpin->setValue( myDeflection ); + myDefSpin->setValue( myDeflection ); myItemsSpin->setValue( myNbItems ); myDefSpin->blockSignals( false ); @@ -316,12 +316,12 @@ void ShapeDlg::onDeflectionChanged( double value ) updateSphere(); } - -void ShapeDlg::onText() -{ - updateSphere(); -} - + +void ShapeDlg::onText() +{ + updateSphere(); +} + void ShapeDlg::updateSphere() { @@ -345,13 +345,13 @@ void ShapeDlg::updateSphere() Application::stopTimer( 0, "UPDATE", !visible ); QApplication::restoreOverrideCursor(); } - -void ShapeDlg::onPositionChanged() -{ - updateSphere(); -} - -void ShapeDlg::closeEvent ( QCloseEvent* e ) -{ - onCancel(); -} + +void ShapeDlg::onPositionChanged() +{ + updateSphere(); +} + +void ShapeDlg::closeEvent ( QCloseEvent* e ) +{ + onCancel(); +} diff --git a/samples/qt/Graphic3dDemo/src/Sphere_Sphere.cxx b/samples/qt/Graphic3dDemo/src/Sphere_Sphere.cxx index 7f73766656..9a5cd6a6a8 100755 --- a/samples/qt/Graphic3dDemo/src/Sphere_Sphere.cxx +++ b/samples/qt/Graphic3dDemo/src/Sphere_Sphere.cxx @@ -32,17 +32,17 @@ #include #include #endif - -#include - -Standard_CString stText="Test"; -Standard_Integer stTextHeight=10; + +#include + +Standard_CString stText="Test"; +Standard_Integer stTextHeight=10; static void ShadeWithVertex(const Handle(Graphic3d_Group) aGroup, const gp_Pnt aPosition, const Standard_Real aRadius, - const Standard_Real aDeflection, - const Standard_Boolean isText, + const Standard_Real aDeflection, + const Standard_Boolean isText, const Standard_Boolean isOptText) { Standard_Real R1,R2; @@ -58,12 +58,12 @@ static void ShadeWithVertex(const Handle(Graphic3d_Group) aGroup, Standard_Real Dalpha = 2.*Standard_PI/nbpanes; Standard_Integer i,j; - aPosition.Coord (Xc, Yc, Zc); - if(isText) { - Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d(); - Text3d->SetTextureMappedFont(isOptText); - aGroup->SetPrimitivesAspect(Text3d); - } + aPosition.Coord (Xc, Yc, Zc); + if(isText) { + Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d(); + Text3d->SetTextureMappedFont(isOptText); + aGroup->SetPrimitivesAspect(Text3d); + } #ifdef G005 if( Graphic3d_ArrayOfPrimitives::IsEnable() ) { @@ -72,8 +72,8 @@ static void ShadeWithVertex(const Handle(Graphic3d_Group) aGroup, Standard_False,Standard_False,Standard_False,Standard_False); Handle(Graphic3d_ArrayOfQuadrangles) pquad = new Graphic3d_ArrayOfQuadrangles(4*nbpanes*(nbpanes/2-2),0, - Standard_False,Standard_False,Standard_False,Standard_False); - aGroup->BeginPrimitives(); + Standard_False,Standard_False,Standard_False,Standard_False); + aGroup->BeginPrimitives(); for( j=0; jAddVertex(X1+Xc,Y1+Yc,Z1+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); - ptri->AddVertex(X2+Xc,Y2+Yc,Z2+Zc); + ptri->AddVertex(X1+Xc,Y1+Yc,Z1+Zc); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + ptri->AddVertex(X2+Xc,Y2+Yc,Z2+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); - ptri->AddVertex(X3+Xc,Y3+Yc,Z3+Zc); + ptri->AddVertex(X3+Xc,Y3+Yc,Z3+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); } else if( j == nbpanes/2-1 ) { - ptri->AddVertex(X1+Xc,Y1+Yc,Z1+Zc); + ptri->AddVertex(X1+Xc,Y1+Yc,Z1+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); - ptri->AddVertex(X2+Xc,Y2+Yc,Z2+Zc); + ptri->AddVertex(X2+Xc,Y2+Yc,Z2+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); - ptri->AddVertex(X4+Xc,Y4+Yc,Z4+Zc); + ptri->AddVertex(X4+Xc,Y4+Yc,Z4+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); } else { - pquad->AddVertex(X1+Xc,Y1+Yc,Z1+Zc); + pquad->AddVertex(X1+Xc,Y1+Yc,Z1+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); - pquad->AddVertex(X2+Xc,Y2+Yc,Z2+Zc); + pquad->AddVertex(X2+Xc,Y2+Yc,Z2+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); - pquad->AddVertex(X3+Xc,Y3+Yc,Z3+Zc); + pquad->AddVertex(X3+Xc,Y3+Yc,Z3+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); - pquad->AddVertex(X4+Xc,Y4+Yc,Z4+Zc); + pquad->AddVertex(X4+Xc,Y4+Yc,Z4+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); } } @@ -124,7 +124,7 @@ static void ShadeWithVertex(const Handle(Graphic3d_Group) aGroup, } else #endif { - aGroup->BeginPrimitives(); + aGroup->BeginPrimitives(); Graphic3d_Array1OfVertex TriVertex(1,3*nbpanes*2); Graphic3d_Array1OfVertex QuadVertex(1,4*nbpanes*(nbpanes/2-2)); Aspect_Array1OfEdge TriEdge(1,3*nbpanes*2); @@ -149,45 +149,45 @@ static void ShadeWithVertex(const Handle(Graphic3d_Group) aGroup, Y4 = R1*sin(Alpha); if( j == 0 ) { nt++; - TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); + TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; - TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); + TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; - TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc); + TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE); } else if( j == nbpanes/2-1 ) { nt++; - TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); + TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; - TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); + TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; - TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc); + TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE); } else { nq++; - QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); + QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE); nq++; - QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); + QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE); nq++; - QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc); + QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE); nq++; - QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc); + QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc); if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); QuadEdge(nq).SetValues(nq,nq-3,Aspect_TOE_VISIBLE); } @@ -203,8 +203,8 @@ static void ShadeWithVertex(const Handle(Graphic3d_Group) aGroup, static void ShadeWithVertexN(const Handle(Graphic3d_Group) aGroup, const gp_Pnt aPosition, const Standard_Real aRadius, - const Standard_Real aDeflection, - const Standard_Boolean isText, + const Standard_Real aDeflection, + const Standard_Boolean isText, const Standard_Boolean isOptText) { Standard_Real R1,R2; @@ -220,12 +220,12 @@ static void ShadeWithVertexN(const Handle(Graphic3d_Group) aGroup, Standard_Real Dalpha = 2.*Standard_PI/nbpanes; Standard_Integer i,j; - aPosition.Coord (Xc, Yc, Zc); - if(isText) { - Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d(); - Text3d->SetTextureMappedFont(isOptText); - aGroup->SetPrimitivesAspect(Text3d); - } + aPosition.Coord (Xc, Yc, Zc); + if(isText) { + Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d(); + Text3d->SetTextureMappedFont(isOptText); + aGroup->SetPrimitivesAspect(Text3d); + } #ifdef G005 if( Graphic3d_ArrayOfPrimitives::IsEnable() ) { Handle(Graphic3d_ArrayOfTriangles) ptri = @@ -233,8 +233,8 @@ static void ShadeWithVertexN(const Handle(Graphic3d_Group) aGroup, Standard_True,Standard_False,Standard_False,Standard_False); Handle(Graphic3d_ArrayOfQuadrangles) pquad = new Graphic3d_ArrayOfQuadrangles(4*nbpanes*(nbpanes/2-2),0, - Standard_True,Standard_False,Standard_False,Standard_False); - aGroup->BeginPrimitives(); + Standard_True,Standard_False,Standard_False,Standard_False); + aGroup->BeginPrimitives(); for( j=0; jAddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc), + ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc), gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc), gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc), gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); } else if( j == nbpanes/2-1 ) { ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc), gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc), gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc), gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); } else { pquad->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc), gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); pquad->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc), gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); pquad->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc), gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); pquad->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc), gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); } } } @@ -294,8 +294,8 @@ static void ShadeWithVertexN(const Handle(Graphic3d_Group) aGroup, aGroup->EndPrimitives(); } else #endif - { - aGroup->BeginPrimitives(); + { + aGroup->BeginPrimitives(); Graphic3d_Array1OfVertexN TriVertex(1,3*nbpanes*2); Graphic3d_Array1OfVertexN QuadVertex(1,4*nbpanes*(nbpanes/2-2)); Aspect_Array1OfEdge TriEdge(1,3*nbpanes*2); @@ -321,54 +321,54 @@ static void ShadeWithVertexN(const Handle(Graphic3d_Group) aGroup, if( j == 0 ) { nt++; TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); TriVertex(nt).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius); TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE); } else if( j == nbpanes/2-1 ) { nt++; TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); TriVertex(nt).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius); TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE); } else { nq++; QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); QuadVertex(nq).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius); QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE); nq++; QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); QuadVertex(nq).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius); QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE); nq++; QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); QuadVertex(nq).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius); QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE); nq++; QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); QuadVertex(nq).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius); QuadEdge(nq).SetValues(nq,nq-3,Aspect_TOE_VISIBLE); } @@ -384,8 +384,8 @@ static void ShadeWithVertexN(const Handle(Graphic3d_Group) aGroup, static void ShadeWithVertexC(const Handle(Graphic3d_Group) aGroup, const gp_Pnt aPosition, const Standard_Real aRadius, - const Standard_Real aDeflection, - const Standard_Boolean isText, + const Standard_Real aDeflection, + const Standard_Boolean isText, const Standard_Boolean isOptText) { Standard_Real R1,R2; @@ -403,11 +403,11 @@ static void ShadeWithVertexC(const Handle(Graphic3d_Group) aGroup, Standard_Integer i,j; aPosition.Coord (Xc, Yc, Zc); - if(isText) { - Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d(); - Text3d->SetTextureMappedFont(isOptText); - aGroup->SetPrimitivesAspect(Text3d); - } + if(isText) { + Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d(); + Text3d->SetTextureMappedFont(isOptText); + aGroup->SetPrimitivesAspect(Text3d); + } #ifdef G005 if( Graphic3d_ArrayOfPrimitives::IsEnable() ) { Handle(Graphic3d_ArrayOfTriangles) ptri = @@ -416,7 +416,7 @@ static void ShadeWithVertexC(const Handle(Graphic3d_Group) aGroup, Handle(Graphic3d_ArrayOfQuadrangles) pquad = new Graphic3d_ArrayOfQuadrangles(4*nbpanes*(nbpanes/2-2),0, Standard_False,Standard_True,Standard_False,Standard_False); - aGroup->BeginPrimitives(); + aGroup->BeginPrimitives(); for( j=0; jAddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),C1); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),C2); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),C3); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); } else if( j == nbpanes/2-1 ) { ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),C1); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),C2); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),C4); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); } else { pquad->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),C1); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); pquad->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),C2); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); pquad->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),C3); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); pquad->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),C4); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); } } } @@ -475,7 +475,7 @@ static void ShadeWithVertexC(const Handle(Graphic3d_Group) aGroup, } else #endif { - aGroup->BeginPrimitives(); + aGroup->BeginPrimitives(); Graphic3d_Array1OfVertexC TriVertex(1,3*nbpanes*2); Graphic3d_Array1OfVertexC QuadVertex(1,4*nbpanes*(nbpanes/2-2)); Aspect_Array1OfEdge TriEdge(1,3*nbpanes*2); @@ -509,54 +509,54 @@ static void ShadeWithVertexC(const Handle(Graphic3d_Group) aGroup, if( j == 0 ) { nt++; TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); TriVertex(nt).SetColor(C1); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); TriVertex(nt).SetColor(C2); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); TriVertex(nt).SetColor(C3); TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE); } else if( j == nbpanes/2-1 ) { nt++; TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); TriVertex(nt).SetColor(C1); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); TriVertex(nt).SetColor(C2); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); TriVertex(nt).SetColor(C4); TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE); } else { nq++; QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); QuadVertex(nq).SetColor(C1); QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE); nq++; QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); QuadVertex(nq).SetColor(C2); QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE); nq++; QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); QuadVertex(nq).SetColor(C3); QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE); nq++; QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); QuadVertex(nq).SetColor(C4); QuadEdge(nq).SetValues(nq,nq-3,Aspect_TOE_VISIBLE); } @@ -572,8 +572,8 @@ static void ShadeWithVertexC(const Handle(Graphic3d_Group) aGroup, static void ShadeWithVertexNC(const Handle(Graphic3d_Group) aGroup, const gp_Pnt aPosition, const Standard_Real aRadius, - const Standard_Real aDeflection, - const Standard_Boolean isText, + const Standard_Real aDeflection, + const Standard_Boolean isText, const Standard_Boolean isOptText) { Standard_Real R1,R2; @@ -591,11 +591,11 @@ static void ShadeWithVertexNC(const Handle(Graphic3d_Group) aGroup, Standard_Integer i,j; aPosition.Coord (Xc, Yc, Zc); - if(isText) { - Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d(); - Text3d->SetTextureMappedFont(isOptText); - aGroup->SetPrimitivesAspect(Text3d); - } + if(isText) { + Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d(); + Text3d->SetTextureMappedFont(isOptText); + aGroup->SetPrimitivesAspect(Text3d); + } #ifdef G005 if( Graphic3d_ArrayOfPrimitives::IsEnable() ) { Handle(Graphic3d_ArrayOfTriangles) ptri = @@ -604,7 +604,7 @@ static void ShadeWithVertexNC(const Handle(Graphic3d_Group) aGroup, Handle(Graphic3d_ArrayOfQuadrangles) pquad = new Graphic3d_ArrayOfQuadrangles(4*nbpanes*(nbpanes/2-2),0, Standard_True,Standard_True,Standard_False,Standard_False); - aGroup->BeginPrimitives(); + aGroup->BeginPrimitives(); for( j=0; jAddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc), gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius),C1); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc), gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius),C2); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc), gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius),C3); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); } else if( j == nbpanes/2-1 ) { ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc), gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius),C1); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc), gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius),C2); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc), gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius),C4); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); } else { pquad->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc), gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius),C1); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); pquad->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc), gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius),C2); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); pquad->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc), gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius),C3); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); pquad->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc), gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius),C4); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); } } } @@ -673,7 +673,7 @@ static void ShadeWithVertexNC(const Handle(Graphic3d_Group) aGroup, } else #endif { - aGroup->BeginPrimitives(); + aGroup->BeginPrimitives(); Graphic3d_Array1OfVertexNC TriVertex(1,3*nbpanes*2); Graphic3d_Array1OfVertexNC QuadVertex(1,4*nbpanes*(nbpanes/2-2)); Aspect_Array1OfEdge TriEdge(1,3*nbpanes*2); @@ -707,63 +707,63 @@ static void ShadeWithVertexNC(const Handle(Graphic3d_Group) aGroup, if( j == 0 ) { nt++; TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius); TriVertex(nt).SetColor(C1); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius); TriVertex(nt).SetColor(C2); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); TriVertex(nt).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius); TriVertex(nt).SetColor(C3); TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE); } else if( j == nbpanes/2-1 ) { nt++; TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius); TriVertex(nt).SetColor(C1); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius); TriVertex(nt).SetColor(C2); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); TriVertex(nt).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius); TriVertex(nt).SetColor(C4); TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE); } else { nq++; QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); QuadVertex(nq).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius); QuadVertex(nq).SetColor(C1); QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE); nq++; QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); QuadVertex(nq).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius); QuadVertex(nq).SetColor(C2); QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE); nq++; QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); QuadVertex(nq).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius); QuadVertex(nq).SetColor(C3); QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE); nq++; QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); QuadVertex(nq).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius); QuadVertex(nq).SetColor(C4); QuadEdge(nq).SetValues(nq,nq-3,Aspect_TOE_VISIBLE); @@ -780,8 +780,8 @@ static void ShadeWithVertexNC(const Handle(Graphic3d_Group) aGroup, static void ShadeWithVertexNT(const Handle(Graphic3d_Group) aGroup, const gp_Pnt aPosition, const Standard_Real aRadius, - const Standard_Real aDeflection, - const Standard_Boolean isText, + const Standard_Real aDeflection, + const Standard_Boolean isText, const Standard_Boolean isOptText) { Standard_Real R1,R2; @@ -799,11 +799,11 @@ static void ShadeWithVertexNT(const Handle(Graphic3d_Group) aGroup, Standard_Integer i,j; aPosition.Coord (Xc, Yc, Zc); - if(isText) { - Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d(); - Text3d->SetTextureMappedFont(isOptText); - aGroup->SetPrimitivesAspect(Text3d); - } + if(isText) { + Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d(); + Text3d->SetTextureMappedFont(isOptText); + aGroup->SetPrimitivesAspect(Text3d); + } #ifdef G005 if( Graphic3d_ArrayOfPrimitives::IsEnable() ) { Handle(Graphic3d_ArrayOfTriangles) ptri = @@ -812,7 +812,7 @@ static void ShadeWithVertexNT(const Handle(Graphic3d_Group) aGroup, Handle(Graphic3d_ArrayOfQuadrangles) pquad = new Graphic3d_ArrayOfQuadrangles(4*nbpanes*(nbpanes/2-2),0, Standard_True,Standard_False,Standard_True,Standard_False); - aGroup->BeginPrimitives(); + aGroup->BeginPrimitives(); for( j=0; jAddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc), gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius), gp_Pnt2d(Tx1,Ty1)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc), gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius), gp_Pnt2d(Tx1,Ty2)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc), gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius), gp_Pnt2d(Tx2,Ty2)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); } else if( j == nbpanes/2-1 ) { ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc), gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius), gp_Pnt2d(Tx1,Ty1)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc), gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius), gp_Pnt2d(Tx1,Ty2)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); ptri->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc), gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius), gp_Pnt2d(Tx2,Ty1)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); } else { pquad->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc), gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius), gp_Pnt2d(Tx1,Ty1)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); pquad->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc), gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius), gp_Pnt2d(Tx1,Ty2)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); pquad->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc), gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius), gp_Pnt2d(Tx2,Ty2)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); pquad->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc), gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius), gp_Pnt2d(Tx2,Ty1)); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); } } } @@ -887,7 +887,7 @@ static void ShadeWithVertexNT(const Handle(Graphic3d_Group) aGroup, } else #endif { - aGroup->BeginPrimitives(); + aGroup->BeginPrimitives(); Graphic3d_Array1OfVertexNT TriVertex(1,3*nbpanes*2); Graphic3d_Array1OfVertexNT QuadVertex(1,4*nbpanes*(nbpanes/2-2)); Aspect_Array1OfEdge TriEdge(1,3*nbpanes*2); @@ -917,63 +917,63 @@ static void ShadeWithVertexNT(const Handle(Graphic3d_Group) aGroup, if( j == 0 ) { nt++; TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius); TriVertex(nt).SetTextureCoordinate(Tx1,Ty1); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius); TriVertex(nt).SetTextureCoordinate(Tx1,Ty2); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); TriVertex(nt).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius); TriVertex(nt).SetTextureCoordinate(Tx2,Ty2); TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE); } else if( j == nbpanes/2-1 ) { nt++; TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius); TriVertex(nt).SetTextureCoordinate(Tx1,Ty1); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius); TriVertex(nt).SetTextureCoordinate(Tx1,Ty2); TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE); nt++; TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); TriVertex(nt).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius); TriVertex(nt).SetTextureCoordinate(Tx2,Ty1); TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE); } else { nq++; QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight); QuadVertex(nq).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius); QuadVertex(nq).SetTextureCoordinate(Tx1,Ty1); QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE); nq++; QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight); QuadVertex(nq).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius); QuadVertex(nq).SetTextureCoordinate(Tx1,Ty2); QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE); nq++; QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight); QuadVertex(nq).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius); QuadVertex(nq).SetTextureCoordinate(Tx2,Ty2); QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE); nq++; QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc); - if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); + if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight); QuadVertex(nq).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius); QuadVertex(nq).SetTextureCoordinate(Tx2,Ty1); QuadEdge(nq).SetValues(nq,nq-3,Aspect_TOE_VISIBLE); @@ -997,15 +997,15 @@ Sphere_Sphere::Sphere_Sphere(const gp_Pnt& aPosition, const Standard_Real aDeflection, const Standard_Boolean hasVNormals, const Standard_Boolean hasVColors, - const Standard_Boolean hasVTexels, - const Standard_Boolean hasText, + const Standard_Boolean hasVTexels, + const Standard_Boolean hasText, const Standard_Boolean isOptText ) : Sphere_BasicShape(BRepPrimAPI_MakeSphere(aRadius).Shape(), aDeflection,hasVNormals,hasVColors,hasVTexels), -myRadius(aRadius), +myRadius(aRadius), myText(hasText), -myOptText(isOptText) +myOptText(isOptText) { gp_Trsf trsf; trsf.SetTranslation(gp_Vec(aPosition.X(),aPosition.Y(),aPosition.Z())); diff --git a/samples/qt/Graphic3dDemo/src/Translate.cxx b/samples/qt/Graphic3dDemo/src/Translate.cxx index 65c62c81fc..0528085ec8 100755 --- a/samples/qt/Graphic3dDemo/src/Translate.cxx +++ b/samples/qt/Graphic3dDemo/src/Translate.cxx @@ -69,10 +69,10 @@ Translate::~Translate() 'filter' */ QString Translate::selectFileName( const QString& filter, bool isImport ) const -{ - return isImport ? - QFileDialog::getOpenFileName( QApplication::activeWindow(), tr("INF_APP_IMPORT"), QString::null, filter ) : - QFileDialog::getSaveFileName( QApplication::activeWindow(), tr("INF_APP_EXPORT"), QString::null, filter ); +{ + return isImport ? + QFileDialog::getOpenFileName( QApplication::activeWindow(), tr("INF_APP_IMPORT"), QString::null, filter ) : + QFileDialog::getSaveFileName( QApplication::activeWindow(), tr("INF_APP_EXPORT"), QString::null, filter ); /* QFileDialog fd ( 0, 0, true ); fd.setFilters( filter ); @@ -82,7 +82,7 @@ QString Translate::selectFileName( const QString& filter, bool isImport ) const qApp->processEvents(); - return ( ret == QDialog::Accepted ? fd.selectedFile() : QString::null ); + return ( ret == QDialog::Accepted ? fd.selectedFile() : QString::null ); */ } diff --git a/samples/qt/Graphic3dDemo/src/View.cxx b/samples/qt/Graphic3dDemo/src/View.cxx index 6b1cc6b4e9..091145b8d1 100755 --- a/samples/qt/Graphic3dDemo/src/View.cxx +++ b/samples/qt/Graphic3dDemo/src/View.cxx @@ -6,8 +6,8 @@ #include #include #include -#include -#include +#include +#include #include #include "View.h" @@ -58,12 +58,12 @@ View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent, MDIWindow* mdi ) : QWidget( parent ), myMDI( mdi ), myRubberBand( 0 ) { - setBackgroundRole( QPalette::NoRole );//NoBackground ); - // set focus policy to threat QContextMenuEvent from keyboard - setFocusPolicy( Qt::StrongFocus ); - setAttribute( Qt::WA_PaintOnScreen ); - setAttribute( Qt::WA_NoSystemBackground ); - + setBackgroundRole( QPalette::NoRole );//NoBackground ); + // set focus policy to threat QContextMenuEvent from keyboard + setFocusPolicy( Qt::StrongFocus ); + setAttribute( Qt::WA_PaintOnScreen ); + setAttribute( Qt::WA_NoSystemBackground ); + #ifndef WNT XSynchronize( x11Display(), true ); // it is possible to use QApplication::syncX(); #endif @@ -88,17 +88,17 @@ View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent, MDIWindo */ Visual *v = DefaultVisual( x11Display(), DefaultScreen( x11Display() ) ); int visualID = XVisualIDFromVisual( v ); - + /* Here we use the settings from Optimizer_ViewInfo::TxglCreateWindow() */ int visualAttr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 1, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER, - None }; + None }; pVisualInfo = ::glXChooseVisual (x11Display(), DefaultScreen(x11Display()), visualAttr); - if ( isVisible() ) + if ( isVisible() ) hide(); XSetWindowAttributes a; @@ -119,81 +119,81 @@ View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent, MDIWindo int count; if ( XGetWMColormapWindows( x11Display(), topLevelWidget()->winId(), &cmwret, &count ) ) { - cmw = new Window[count+1]; - memcpy( (char *)cmw, (char *)cmwret, sizeof(Window)*count ); - XFree( (char *)cmwret ); - int i; - for (i = 0; i < count; i++) { - if ( cmw[i] == winId() ) { /* replace old window */ - cmw[i] = w; - break; - } - } - if ( i >= count ) /* append new window */ - cmw[count++] = w; - } else { - count = 1; - cmw = new Window[count]; - cmw[0] = w; - } - /* Creating new window (with good VisualID) for this widget */ - create( w ); - XSetWMColormapWindows( x11Display(), topLevelWidget()->winId(), cmw, count ); - delete [] cmw; - - if ( isVisible() ) - show(); - if ( pVisualInfo ) { - XFree( (char *)pVisualInfo ); - } - XFlush( x11Display() ); - } -#endif // !defined WNT - - // will be set in OnInitial update, but, for more security : - myCurrentMode = CurAction3d_Nothing; - setMouseTracking( true ); - myView = NULL; + cmw = new Window[count+1]; + memcpy( (char *)cmw, (char *)cmwret, sizeof(Window)*count ); + XFree( (char *)cmwret ); + int i; + for (i = 0; i < count; i++) { + if ( cmw[i] == winId() ) { /* replace old window */ + cmw[i] = w; + break; + } + } + if ( i >= count ) /* append new window */ + cmw[count++] = w; + } else { + count = 1; + cmw = new Window[count]; + cmw[0] = w; + } + /* Creating new window (with good VisualID) for this widget */ + create( w ); + XSetWMColormapWindows( x11Display(), topLevelWidget()->winId(), cmw, count ); + delete [] cmw; + + if ( isVisible() ) + show(); + if ( pVisualInfo ) { + XFree( (char *)pVisualInfo ); + } + XFlush( x11Display() ); + } +#endif // !defined WNT + + // will be set in OnInitial update, but, for more security : + myCurrentMode = CurAction3d_Nothing; + setMouseTracking( true ); + myView = NULL; } View::~View() -{ +{ } void View::init() -{ - myView = myContext->CurrentViewer()->CreateView(); - int windowHandle = (int) winId(); - short hi, lo; - lo = (short) windowHandle; - hi = (short) ( windowHandle >> 16 ); -#ifdef WNT - Handle(WNT_Window) hWnd = - new WNT_Window( Handle(Graphic3d_WNTGraphicDevice):: - DownCast( myContext->CurrentViewer()->Device() ) , (int) hi, (int) lo ); -#else - Handle(Xw_Window) hWnd = - new Xw_Window( Handle(Graphic3d_GraphicDevice):: - DownCast( myContext->CurrentViewer()->Device() ), - (int) hi, (int) lo, Xw_WQ_SAMEQUALITY, Quantity_NOC_BLACK ); -#endif // WNT - myView->SetWindow( hWnd ); - if ( !hWnd->IsMapped() ) - hWnd->Map(); - myView->SetBackgroundColor(Quantity_NOC_GRAY40); - myView->MustBeResized(); - - Handle(Geom_Axis2Placement) anAxis = new Geom_Axis2Placement( gp::XOY() ); - myTrihedron = new AIS_Trihedron( anAxis ); - myContext->Display( myTrihedron ); - - //myView->SetAntialiasingOn(); - myComputedModeIsOn = true; - myView->SetScale(3.0316); - - // This is to update View properties dialog - emit ViewInitialized(); -} +{ + myView = myContext->CurrentViewer()->CreateView(); + int windowHandle = (int) winId(); + short hi, lo; + lo = (short) windowHandle; + hi = (short) ( windowHandle >> 16 ); +#ifdef WNT + Handle(WNT_Window) hWnd = + new WNT_Window( Handle(Graphic3d_WNTGraphicDevice):: + DownCast( myContext->CurrentViewer()->Device() ) , (int) hi, (int) lo ); +#else + Handle(Xw_Window) hWnd = + new Xw_Window( Handle(Graphic3d_GraphicDevice):: + DownCast( myContext->CurrentViewer()->Device() ), + (int) hi, (int) lo, Xw_WQ_SAMEQUALITY, Quantity_NOC_BLACK ); +#endif // WNT + myView->SetWindow( hWnd ); + if ( !hWnd->IsMapped() ) + hWnd->Map(); + myView->SetBackgroundColor(Quantity_NOC_GRAY40); + myView->MustBeResized(); + + Handle(Geom_Axis2Placement) anAxis = new Geom_Axis2Placement( gp::XOY() ); + myTrihedron = new AIS_Trihedron( anAxis ); + myContext->Display( myTrihedron ); + + //myView->SetAntialiasingOn(); + myComputedModeIsOn = true; + myView->SetScale(3.0316); + + // This is to update View properties dialog + emit ViewInitialized(); +} void View::paintEvent ( QPaintEvent * e) { @@ -268,9 +268,9 @@ void View::onLButtonDown( Qt::KeyboardModifiers nFlags, const QPoint point ) case CurAction3d_GlobalPanning :// noting break; case CurAction3d_DynamicRotation : - if (!myComputedModeIsOn){ - myView->SetComputedMode(false); - } + if (!myComputedModeIsOn){ + myView->SetComputedMode(false); + } myView->SetAnimationModeOn(); myView->StartRotation(point.x(),point.y()); break; @@ -283,15 +283,15 @@ void View::onLButtonDown( Qt::KeyboardModifiers nFlags, const QPoint point ) void View::onRButtonDown( Qt::KeyboardModifiers nFlags, const QPoint point ) { - if ( nFlags == CASCADESHORTCUTKEY ) { + if ( nFlags == CASCADESHORTCUTKEY ) { if ( !myComputedModeIsOn ) myView->SetComputedMode(false); -// Standard_Boolean anim, deg; -// anim = myView->AnimationMode( deg ); -// if ( anim /*&& deg*/ ) { +// Standard_Boolean anim, deg; +// anim = myView->AnimationMode( deg ); +// if ( anim /*&& deg*/ ) { myCycleCounter = 0; Application::startTimer(); - myView->SetAnimationModeOn(); + myView->SetAnimationModeOn(); // myView->SetAnimationMode(true,true); // myContext->DeactivateStandardMode( TopAbs_SHAPE ); // } @@ -366,7 +366,7 @@ void View::onLButtonUp(Qt::KeyboardModifiers nFlags, const QPoint point) emit noActiveActions(); break; case CurAction3d_DynamicRotation : - myCurrentMode = CurAction3d_Nothing; + myCurrentMode = CurAction3d_Nothing; myView->SetAnimationModeOff(); emit noActiveActions(); break; @@ -382,16 +382,16 @@ void View::onRButtonUp(Qt::KeyboardModifiers nFlags, const QPoint point) QApplication::setOverrideCursor( Qt::WaitCursor ); // reset computed mode according to the stored one // --> dynamic rotation may have change it - + if (!myComputedModeIsOn) - { + { myView->SetComputedMode(false); myComputedModeIsOn = Standard_False; } else - { + { myView->SetComputedMode(false); myComputedModeIsOn = Standard_True; - } + } //if ( myView->AnimationModeIsOn() ) { myView->SetAnimationModeOff(); @@ -555,83 +555,83 @@ void View::Popup() { QMenu* popMenu = new QMenu( this ); - if( myContext->NbCurrents()) { - QAction* a; - myContext->InitCurrent(); - if (! myContext->Current()->IsKind(STANDARD_TYPE(AIS_Trihedron))) + if( myContext->NbCurrents()) { + QAction* a; + myContext->InitCurrent(); + if (! myContext->Current()->IsKind(STANDARD_TYPE(AIS_Trihedron))) { a = new QAction( tr( "MEN_POP_OBJPROP" ), this ); - verify( connect( a, SIGNAL( activated() ), SLOT( onEditObjectProperties() ) ) ); + verify( connect( a, SIGNAL( activated() ), SLOT( onEditObjectProperties() ) ) ); popMenu->addAction( a ); QMenu* dMode = popMenu->addMenu( tr( "MEN_POP_DISPLAYMODE" ) ); a = new QAction( tr( "MEN_POP_WIREFRAME" ), this ); - verify( connect( a, SIGNAL( activated() ), SLOT( onWireframeMode() ) ) ); + verify( connect( a, SIGNAL( activated() ), SLOT( onWireframeMode() ) ) ); dMode->addAction( a ); - + a = new QAction( tr( "MEN_POP_SHADING" ), this ); verify( connect( a, SIGNAL( activated() ), SLOT( onShadingMode() ) ) ); - dMode->addAction( a ); + dMode->addAction( a ); } a = new QAction( tr( "MEN_POP_REMOVEOBJECT" ), this ); verify( connect( a, SIGNAL( activated() ), SLOT( onRemoveObject() ) ) ); - popMenu->addAction( a ); + popMenu->addAction( a ); } else { QAction* a = new QAction( tr( "MEN_POP_VIEWPROP" ), this ); verify( connect( a, SIGNAL( activated() ), Application::getApplication(), SLOT( onEditViewProperties() ) ) ); - popMenu->addAction( a ); + popMenu->addAction( a ); a = new QAction( tr( "MEN_POP_IMPORT" ), this ); verify( connect( a, SIGNAL( activated() ), SLOT( onImportObject() ) ) ); - popMenu->addAction( a ); + popMenu->addAction( a ); popMenu->addSeparator(); if ( myContext->IsDisplayed( myTrihedron ) ) { a = new QAction( tr( "MEN_POP_ERASETRIHEDRON" ), this ); verify( connect( a, SIGNAL( activated() ), SLOT( onEraseTrihedron() ) ) ); - popMenu->addAction( a ); + popMenu->addAction( a ); } else { a = new QAction( tr( "MEN_POP_DISPLAYTRIHEDRON" ), this ); verify( connect( a, SIGNAL( activated() ), SLOT( onDisplayTrihedron() ) ) ); - popMenu->addAction( a ); + popMenu->addAction( a ); } popMenu->addSeparator(); a = new QAction( tr( "MEN_POP_CREATESHAPE" ), this ); verify( connect( a, SIGNAL( activated() ), SLOT( onCreateShape() ) ) ); - popMenu->addAction( a ); + popMenu->addAction( a ); QMenu* loadObj = popMenu->addMenu( tr( "MEN_POP_LOADOBJECT" ) ); a = new QAction( tr( "MEN_POP_BOX" ), this ); verify( connect( a, SIGNAL( activated() ), SLOT( onLoadBox() ) ) ); - loadObj->addAction( a ); + loadObj->addAction( a ); a = new QAction( tr( "MEN_POP_SPHERE" ), this ); verify( connect( a, SIGNAL( activated() ), SLOT( onLoadSphere() ) ) ); - loadObj->addAction( a ); + loadObj->addAction( a ); a = new QAction( tr( "MEN_POP_TORUS" ), this ); verify( connect( a, SIGNAL( activated() ), SLOT( onLoadTorus() ) ) ); - loadObj->addAction( a ); + loadObj->addAction( a ); -// a = new QAction( tr( "MEN_POP_LINE" ), this ); -// verify( connect( a, SIGNAL( activated() ), SLOT( onLoadLine() ) ) ); -// loadObj->addAction( a ); +// a = new QAction( tr( "MEN_POP_LINE" ), this ); +// verify( connect( a, SIGNAL( activated() ), SLOT( onLoadLine() ) ) ); +// loadObj->addAction( a ); } popMenu->exec( QCursor::pos() ); } void View::DrawRectangle( int MinX, int MinY, int MaxX, int MaxY, bool Draw ) -{ - if ( !myRubberBand ) - myRubberBand = new QRubberBand( QRubberBand::Rectangle, this ); - - myRubberBand->setGeometry( QRect( QPoint( MinX, MinY ), QPoint( MaxX, MaxY ) ).normalized() ); - myRubberBand->setVisible( Draw ); +{ + if ( !myRubberBand ) + myRubberBand = new QRubberBand( QRubberBand::Rectangle, this ); + + myRubberBand->setGeometry( QRect( QPoint( MinX, MinY ), QPoint( MaxX, MaxY ) ).normalized() ); + myRubberBand->setVisible( Draw ); /* QPainter thePainter(this); thePainter.setRasterOp(Qt::XorROP); @@ -658,7 +658,7 @@ void View::DrawRectangle( int MinX, int MinY, int MaxX, int MaxY, bool Draw ) thePainter.drawRect(aRect); m_IsVisible = true; } - */ + */ } void View::onImportObject() @@ -756,7 +756,7 @@ void View::startAction( ViewOperations::Action action ) } void View::onCreateShape() -{ +{ myView->SetScale(3.0316); if ( !myShapeDlg ) myShapeDlg = new ShapeDlg( Application::getApplication(), myView, myContext ); @@ -764,7 +764,7 @@ void View::onCreateShape() } void View::onLoadBox() -{ +{ myView->SetScale(1.0); Standard_Real size = myContext->CurrentViewer()->DefaultViewSize() / 4.; gp_Pnt origin( -size / 2., -size / 2., -size / 2. ); @@ -783,7 +783,7 @@ void View::onLoadBox() } void View::onLoadSphere() -{ +{ myView->SetScale(1.0); Standard_Real radius = myContext->CurrentViewer()->DefaultViewSize() / 4.; Handle(AIS_Shape) sphere = @@ -801,7 +801,7 @@ void View::onLoadSphere() } void View::onLoadTorus() -{ +{ myView->SetScale(1.0); Handle(V3d_Viewer) viewer = myContext->CurrentViewer(); Standard_Real r1 = viewer->DefaultViewSize() / 3.; @@ -820,7 +820,7 @@ void View::onLoadTorus() } void View::onLoadLine() -{ +{ myView->SetScale(1.0); Handle(AIS_Line) line = new AIS_Line( new Geom_Line( gp_Pnt( 0, 0, 0), gp_Dir( 0, 0, 1) ) ); @@ -857,18 +857,18 @@ void View::onWireframeMode() } void View::onShadingMode() -{ - - myContext->InitSelected(); - for( ; myContext->MoreSelected(); myContext->NextSelected() ) { - Handle(AIS_InteractiveObject) obj = myContext->SelectedInteractive(); - //myContext->Erase( obj, false ); - //myContext->Display( obj /*, 1, 0*/, false ); - //myContext->Activate( obj, 0 ); - myContext->SetDisplayMode( obj, 1 ); - } - myContext->UpdateCurrentViewer(); - +{ + + myContext->InitSelected(); + for( ; myContext->MoreSelected(); myContext->NextSelected() ) { + Handle(AIS_InteractiveObject) obj = myContext->SelectedInteractive(); + //myContext->Erase( obj, false ); + //myContext->Display( obj /*, 1, 0*/, false ); + //myContext->Activate( obj, 0 ); + myContext->SetDisplayMode( obj, 1 ); + } + myContext->UpdateCurrentViewer(); + } void View::onDisplayTrihedron() diff --git a/samples/qt/Graphic3dDemo/src/ViewDlg.cxx b/samples/qt/Graphic3dDemo/src/ViewDlg.cxx index 8bd0b61458..f8f564884c 100755 --- a/samples/qt/Graphic3dDemo/src/ViewDlg.cxx +++ b/samples/qt/Graphic3dDemo/src/ViewDlg.cxx @@ -10,7 +10,7 @@ #include #include - + #include "Application.h" #include "ViewDlg.h" #include "global.h" @@ -22,7 +22,7 @@ ViewDlg::ViewDlg( QWidget* parent/*, Handle(V3d_View)& view*/ ) :QDialog( parent ), myAutoApply( true ), /*myView( view ),*/ myApplyAllViews(false) -{ +{ setModal( false ); setWindowTitle( tr( "TITLE_VIEW_DLG" ) ); @@ -35,15 +35,15 @@ ViewDlg::ViewDlg( QWidget* parent/*, Handle(V3d_View)& view*/ ) topLayout->addSpacing( 10 ); // view properties - QGridLayout* pLayout = new QGridLayout( mainFrame ); + QGridLayout* pLayout = new QGridLayout( mainFrame ); pLayout->setMargin( 5 ); myZBufferBox = new QCheckBox( mainFrame );; myZBufferBox->setText( tr( "BTN_ZBUFFER" ) ); - verify( connect( myZBufferBox, SIGNAL( toggled( bool ) ), SLOT( onZBuffer( bool ) ) ) ); + verify( connect( myZBufferBox, SIGNAL( toggled( bool ) ), SLOT( onZBuffer( bool ) ) ) ); myAnimBox = new QCheckBox( mainFrame ); myAnimBox->setText( tr( "BTN_ANIMATION" ) ); - verify( connect( myAnimBox, SIGNAL( toggled( bool ) ), SLOT( onAnimation( bool ) ) ) ); + verify( connect( myAnimBox, SIGNAL( toggled( bool ) ), SLOT( onAnimation( bool ) ) ) ); myDegBox = new QCheckBox( mainFrame ); myDegBox->setText( tr( "BTN_DEGENERATION" ) ); @@ -53,7 +53,7 @@ ViewDlg::ViewDlg( QWidget* parent/*, Handle(V3d_View)& view*/ ) pLayout->addWidget( myAnimBox, 1, 0 ); pLayout->addWidget( myDegBox, 2, 0 ); pLayout->setRowStretch( 3, 10 ); - pLayout->setColumnStretch( 1, 10 ); + pLayout->setColumnStretch( 1, 10 ); // apply controls QCheckBox *autoApply, *applyAllViews; @@ -69,39 +69,39 @@ ViewDlg::ViewDlg( QWidget* parent/*, Handle(V3d_View)& view*/ ) QHBoxLayout* applyLayout = new QHBoxLayout(); applyLayout->addWidget( autoApply ); applyLayout->addStretch( 10 ); - applyLayout->addWidget( applyAllViews ); + applyLayout->addWidget( applyAllViews ); topLayout->addLayout( applyLayout ); topLayout->addSpacing( 10 ); // control buttons - QPushButton *bOk, *bCancel/*, *bHelp*/; - + QPushButton *bOk, *bCancel/*, *bHelp*/; + bOk = new QPushButton( tr( "BTN_OK" ), this ); - verify( connect( bOk, SIGNAL( clicked() ), SLOT( onOk() ) ) ); + verify( connect( bOk, SIGNAL( clicked() ), SLOT( onOk() ) ) ); bOk->setDefault(true); bCancel = new QPushButton( tr( "BTN_CANCEL" ), this ); - verify( connect( bCancel, SIGNAL( clicked() ), SLOT( onCancel() ) ) ); - + verify( connect( bCancel, SIGNAL( clicked() ), SLOT( onCancel() ) ) ); -// bHelp = new QPushButton( tr( "BTN_HELP" ), this ); -// verify( connect( bHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ) ); + +// bHelp = new QPushButton( tr( "BTN_HELP" ), this ); +// verify( connect( bHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ) ); QHBoxLayout* btnLayout = new QHBoxLayout(); - btnLayout->setSpacing( 5 ); - btnLayout->addStretch( 10 ); + btnLayout->setSpacing( 5 ); + btnLayout->addStretch( 10 ); btnLayout->addWidget( bOk ); btnLayout->addWidget( bCancel ); btnLayout->addStretch( 10 ); -// btnLayout->addWidget( bHelp ); +// btnLayout->addWidget( bHelp ); topLayout->addLayout( btnLayout ); QSize s = topLayout->totalMinimumSize(); s.setWidth( s.width() + topLayout->margin() + 10 ); s.setHeight( s.height() + topLayout->margin() + 10 ); - setFixedSize( s ); - - Handle(V3d_View) aView = Application::getApplication()->getActiveMDI()->getView(); - myIsAnim = aView->AnimationMode(myIsDeg); + setFixedSize( s ); + + Handle(V3d_View) aView = Application::getApplication()->getActiveMDI()->getView(); + myIsAnim = aView->AnimationMode(myIsDeg); } ViewDlg::~ViewDlg() @@ -109,20 +109,20 @@ ViewDlg::~ViewDlg() } void ViewDlg::showEvent ( QShowEvent* e ) -{ - Update(); - QWidget::showEvent( e ); +{ + Update(); + QWidget::showEvent( e ); } void ViewDlg::onOk() { - hide(); - bool Auto = myAutoApply; - - myAutoApply = true; - onZBuffer(myZBufferBox->isChecked()); - onAnimation(myAnimBox->isChecked()); - onDegeneration(myDegBox->isChecked()); + hide(); + bool Auto = myAutoApply; + + myAutoApply = true; + onZBuffer(myZBufferBox->isChecked()); + onAnimation(myAnimBox->isChecked()); + onDegeneration(myDegBox->isChecked()); myAutoApply = Auto; } @@ -130,83 +130,83 @@ void ViewDlg::onCancel() { hide(); } - + void ViewDlg::onHelp() { } void ViewDlg::onZBuffer( bool on ) -{ - QWidgetList aWidgetList; - Handle(V3d_View) aView; - QWidget* aWidget; - - if (!myApplyAllViews) - aWidgetList.append(Application::getApplication()->getActiveMDI()); - else - aWidgetList = Application::getWorkspace()->windowList(); - - if ( myAutoApply ){ - foreach(aWidget, aWidgetList){ - if ( !aWidget ) continue; - MDIWindow* aMDIWindow = (MDIWindow*)aWidget; - aView = aMDIWindow->getView(); +{ + QWidgetList aWidgetList; + Handle(V3d_View) aView; + QWidget* aWidget; + + if (!myApplyAllViews) + aWidgetList.append(Application::getApplication()->getActiveMDI()); + else + aWidgetList = Application::getWorkspace()->windowList(); + + if ( myAutoApply ){ + foreach(aWidget, aWidgetList){ + if ( !aWidget ) continue; + MDIWindow* aMDIWindow = (MDIWindow*)aWidget; + aView = aMDIWindow->getView(); if ( on ) aView->SetVisualization( V3d_ZBUFFER ); else - aView->SetVisualization( V3d_WIREFRAME ); - } + aView->SetVisualization( V3d_WIREFRAME ); + } } } void ViewDlg::onAnimation( bool on ) -{ - QWidgetList aWidgetList; - Handle(V3d_View) aView; - - myIsAnim = on; - myDegBox->setEnabled( myIsAnim ); - if (!myIsAnim) myDegBox->setChecked(false); - - if (!myApplyAllViews) - aWidgetList.append(Application::getApplication()->getActiveMDI()); - else - aWidgetList = Application::getWorkspace()->windowList(); - - if ( myAutoApply ){ - QWidget* aWidget; - foreach(aWidget, aWidgetList){ - if ( !aWidget ) continue; - MDIWindow* aMDIWindow = (MDIWindow*)aWidget; +{ + QWidgetList aWidgetList; + Handle(V3d_View) aView; + + myIsAnim = on; + myDegBox->setEnabled( myIsAnim ); + if (!myIsAnim) myDegBox->setChecked(false); + + if (!myApplyAllViews) + aWidgetList.append(Application::getApplication()->getActiveMDI()); + else + aWidgetList = Application::getWorkspace()->windowList(); + + if ( myAutoApply ){ + QWidget* aWidget; + foreach(aWidget, aWidgetList){ + if ( !aWidget ) continue; + MDIWindow* aMDIWindow = (MDIWindow*)aWidget; aView = aMDIWindow->getView(); - aView->SetAnimationMode( myIsAnim, myIsDeg ); - aView->Redraw(); - aView->SetImmediateUpdate(true); - aView->Update(); + aView->SetAnimationMode( myIsAnim, myIsDeg ); + aView->Redraw(); + aView->SetImmediateUpdate(true); + aView->Update(); } - } + } } void ViewDlg::onDegeneration( bool on ) -{ - QWidgetList aWidgetList; - Handle(V3d_View) aView; - QWidget* aWidget; - - if (!myApplyAllViews) - aWidgetList.append(Application::getApplication()->getActiveMDI()); - else - aWidgetList = Application::getWorkspace()->windowList(); - +{ + QWidgetList aWidgetList; + Handle(V3d_View) aView; + QWidget* aWidget; + + if (!myApplyAllViews) + aWidgetList.append(Application::getApplication()->getActiveMDI()); + else + aWidgetList = Application::getWorkspace()->windowList(); + myIsDeg = on; - if ( myAutoApply ){ - foreach(aWidget, aWidgetList){ - if ( !aWidget ) continue; - MDIWindow* aMDIWindow = (MDIWindow*)aWidget; - aView = aMDIWindow->getView(); - aView->SetAnimationMode( myIsAnim, myIsDeg ); - } + if ( myAutoApply ){ + foreach(aWidget, aWidgetList){ + if ( !aWidget ) continue; + MDIWindow* aMDIWindow = (MDIWindow*)aWidget; + aView = aMDIWindow->getView(); + aView->SetAnimationMode( myIsAnim, myIsDeg ); + } } } @@ -216,33 +216,33 @@ void ViewDlg::onAutoApply( bool on ) } void ViewDlg::onApplyAllViews( bool on ) -{ +{ myApplyAllViews = on; } - -void ViewDlg::Update() -{ - MDIWindow* anActiveMDIWindow = Application::getApplication()->getActiveMDI(); - if (anActiveMDIWindow){ - Handle(V3d_View) aView = anActiveMDIWindow->getView(); - if(!aView.IsNull()){ - - myIsAnim = aView->AnimationMode( myIsDeg ); - myAnimBox->blockSignals( true ); - myDegBox->blockSignals( true ); - myAnimBox->setChecked( myIsAnim ); - myDegBox->setChecked( myIsDeg ); - myDegBox->setEnabled( myIsAnim ); - myAnimBox->blockSignals( false ); - myDegBox->blockSignals( false ); - - myZBufferBox->blockSignals(true); - V3d_TypeOfVisualization aVisuType = aView->Visualization(); - if(aVisuType == V3d_WIREFRAME) - myZBufferBox -> setChecked(false); - else - myZBufferBox -> setChecked(true); - myZBufferBox->blockSignals(false); - } - } -} + +void ViewDlg::Update() +{ + MDIWindow* anActiveMDIWindow = Application::getApplication()->getActiveMDI(); + if (anActiveMDIWindow){ + Handle(V3d_View) aView = anActiveMDIWindow->getView(); + if(!aView.IsNull()){ + + myIsAnim = aView->AnimationMode( myIsDeg ); + myAnimBox->blockSignals( true ); + myDegBox->blockSignals( true ); + myAnimBox->setChecked( myIsAnim ); + myDegBox->setChecked( myIsDeg ); + myDegBox->setEnabled( myIsAnim ); + myAnimBox->blockSignals( false ); + myDegBox->blockSignals( false ); + + myZBufferBox->blockSignals(true); + V3d_TypeOfVisualization aVisuType = aView->Visualization(); + if(aVisuType == V3d_WIREFRAME) + myZBufferBox -> setChecked(false); + else + myZBufferBox -> setChecked(true); + myZBufferBox->blockSignals(false); + } + } +} diff --git a/samples/qt/Graphic3dDemo/src/ViewOperations.cxx b/samples/qt/Graphic3dDemo/src/ViewOperations.cxx index 9114240527..edf3b1b519 100755 --- a/samples/qt/Graphic3dDemo/src/ViewOperations.cxx +++ b/samples/qt/Graphic3dDemo/src/ViewOperations.cxx @@ -106,90 +106,90 @@ QList ViewOperations::getViewActions() void ViewOperations::initViewActions() { - if ( myViewActions.count() ) + if ( myViewActions.count() ) return; QString dir = Application::getResourceDir(); QAction* a; - a = new QAction( QPixmap( dir + tr( "ICON_VIEW_FITALL" ) ), "", this ); + a = new QAction( QPixmap( dir + tr( "ICON_VIEW_FITALL" ) ), "", this ); a->setToolTip( tr( "TBR_FITALL" ) ); verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) ); myViewActions.insert( ViewFitAllId, a ); - a = new QAction( QPixmap( dir + tr( "ICON_VIEW_FITAREA" ) ), "", this ); + a = new QAction( QPixmap( dir + tr( "ICON_VIEW_FITAREA" ) ), "", this ); a->setToolTip( tr( "TBR_FITAREA" ) ); verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) ); a->setCheckable( true ); verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) ); myViewActions.insert( ViewFitAreaId, a ); - a = new QAction( QPixmap( dir + tr( "ICON_VIEW_ZOOM" ) ), "", this ); + a = new QAction( QPixmap( dir + tr( "ICON_VIEW_ZOOM" ) ), "", this ); a->setToolTip( tr( "TBR_ZOOM" ) ); verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) ); a->setCheckable( true ); verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) ); myViewActions.insert( ViewZoomId, a ); - a = new QAction( QPixmap( dir + tr( "ICON_VIEW_PAN" ) ), "", this ); + a = new QAction( QPixmap( dir + tr( "ICON_VIEW_PAN" ) ), "", this ); a->setToolTip( tr( "TBR_PAN" ) ); verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) ); a->setCheckable( true ); verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) ); myViewActions.insert( ViewPanId, a ); - a = new QAction( QPixmap( dir + tr( "ICON_VIEW_GLOBALPAN" ) ), "", this ); + a = new QAction( QPixmap( dir + tr( "ICON_VIEW_GLOBALPAN" ) ), "", this ); a->setToolTip( tr( "TBR_GLOBALPAN" ) ); verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) ); a->setCheckable( true ); verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) ); myViewActions.insert( ViewGlobalPanId, a ); - a = new QAction( QPixmap( dir + tr( "ICON_VIEW_FRONT" ) ), "", this ); + a = new QAction( QPixmap( dir + tr( "ICON_VIEW_FRONT" ) ), "", this ); a->setToolTip( tr( "TBR_FRONT" ) ); verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) ); myViewActions.insert( ViewFrontId, a ); - a = new QAction( QPixmap( dir + tr( "ICON_VIEW_BACK" ) ), "", this ); + a = new QAction( QPixmap( dir + tr( "ICON_VIEW_BACK" ) ), "", this ); a->setToolTip( tr( "TBR_BACK" ) ); verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) ); myViewActions.insert( ViewBackId, a ); - a = new QAction( QPixmap( dir + tr( "ICON_VIEW_TOP" ) ), "", this ); + a = new QAction( QPixmap( dir + tr( "ICON_VIEW_TOP" ) ), "", this ); a->setToolTip( tr( "TBR_TOP" ) ); verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) ); myViewActions.insert( ViewTopId, a ); - a = new QAction( QPixmap( dir + tr( "ICON_VIEW_BOTTOM" ) ), "", this ); + a = new QAction( QPixmap( dir + tr( "ICON_VIEW_BOTTOM" ) ), "", this ); a->setToolTip( tr( "TBR_BOTTOM" ) ); verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) ); myViewActions.insert( ViewBottomId, a ); - a = new QAction( QPixmap( dir + tr( "ICON_VIEW_LEFT" ) ), "", this ); + a = new QAction( QPixmap( dir + tr( "ICON_VIEW_LEFT" ) ), "", this ); a->setToolTip( tr( "TBR_LEFT" ) ); verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) ); myViewActions.insert( ViewLeftId, a ); - a = new QAction( QPixmap( dir + tr( "ICON_VIEW_RIGHT" ) ), "", this ); + a = new QAction( QPixmap( dir + tr( "ICON_VIEW_RIGHT" ) ), "", this ); a->setToolTip( tr( "TBR_RIGHT" ) ); verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) ); myViewActions.insert( ViewRightId, a ); - a = new QAction( QPixmap( dir + tr( "ICON_VIEW_AXO" ) ), "", this ); + a = new QAction( QPixmap( dir + tr( "ICON_VIEW_AXO" ) ), "", this ); a->setToolTip( tr( "TBR_AXO" ) ); verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) ); myViewActions.insert( ViewAxoId, a ); - a = new QAction( QPixmap( dir + tr( "ICON_VIEW_ROTATION" ) ), "", this ); + a = new QAction( QPixmap( dir + tr( "ICON_VIEW_ROTATION" ) ), "", this ); a->setToolTip( tr( "TBR_ROTATION" ) ); verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) ); a->setCheckable( true ); verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) ); myViewActions.insert( ViewRotationId, a ); - a = new QAction( QPixmap( dir + tr( "ICON_VIEW_RESET" ) ), "", this ); - a->setToolTip( tr( "TBR_RESET" ) ); + a = new QAction( QPixmap( dir + tr( "ICON_VIEW_RESET" ) ), "", this ); + a->setToolTip( tr( "TBR_RESET" ) ); verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) ); myViewActions.insert( ViewResetId, a ); } @@ -257,14 +257,14 @@ void ViewOperations::initToolActions() // verify( connect( a, SIGNAL( activated() ), SLOT( onToolAction() ) ) ); // myToolActions->insert( PerViewId, a ); - QAction* a = new QAction( QPixmap( dir + tr( "ICON_TOOL_WIRE" ) ), "", this ); + QAction* a = new QAction( QPixmap( dir + tr( "ICON_TOOL_WIRE" ) ), "", this ); a->setToolTip( tr( "TBR_TOOL_WIRE" ) ); a->setCheckable( true ); verify( connect( a, SIGNAL( activated() ), SLOT( onToolAction() ) ) ); myToolActions.insert( ToolWireframeId, a ); a = new QAction( QPixmap( dir + tr( "ICON_TOOL_SHAD") ), "", this ); - a->setToolTip( tr( "TBR_TOOL_SHAD" ) ); + a->setToolTip( tr( "TBR_TOOL_SHAD" ) ); a->setCheckable( true ); a->setChecked( true ); verify( connect( a, SIGNAL( activated() ), SLOT( onToolAction() ) ) ); diff --git a/src/BRepMesh/FILES b/src/BRepMesh/FILES index 8da01f5161..eab9073509 100755 --- a/src/BRepMesh/FILES +++ b/src/BRepMesh/FILES @@ -8,4 +8,5 @@ BRepMesh_ListOfInteger.hxx BRepMesh_BaseAllocator.hxx BRepMesh_PairOfIndex.hxx BRepMesh_Status.hxx +BRepMesh_CMPLRS.edl EXTERNLIB