]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Porting to dev version of OCCT
authorinv <inv@opencascade.com>
Mon, 28 Jan 2013 08:34:00 +0000 (08:34 +0000)
committerinv <inv@opencascade.com>
Mon, 28 Jan 2013 08:34:00 +0000 (08:34 +0000)
src/OCCViewer/OCCViewer_VService.cxx
src/OCCViewer/OCCViewer_VService.h

index 5614fa63b666266b2a327f33f054a4f4d4221452..86181d9538dfb24a86ffe810d182c3d9323339d9 100755 (executable)
 //
 
 #include "OCCViewer_VService.h"
+
 #include <V3d_Viewer.hxx>
 #include <V3d_View.hxx>
-#include <Viewer_Viewer.hxx>
-
-#include <V2d_Viewer.hxx>
-#include <V2d_View.hxx>
-#include <Viewer_Viewer.hxx>
 
 #ifdef WNT
 #include <WNT_Window.hxx>
 #include <Graphic3d_WNTGraphicDevice.hxx>
-#include <WNT_GraphicDevice.hxx>
-#include <WNT_WDriver.hxx>
-#include <InterfaceGraphic_WNT.hxx>
 #else
 #include <Xw_Window.hxx>
 #include <Graphic3d_GraphicDevice.hxx>
-#include <Xw_Driver.hxx>
-//#include <Xdps_Driver.hxx>
-#include <Xw_TypeOfMapping.hxx>
 #endif
 
-// For 2d
-#define LOPTIM
-#ifdef WNT
-#ifndef LOPTIM
-static Handle(WNT_GraphicDevice) XServiceDefault2dDevice;
-static Handle(WNT_GraphicDevice) XServiceImageDevice;
-#else
-static Handle(WNT_GraphicDevice)& _XServiceDefault2dDevice() {
-static Handle(WNT_GraphicDevice) XServiceDefault2dDevice;
-return XServiceDefault2dDevice;
-}
-#define XServiceDefault2dDevice _XServiceDefault2dDevice()
-
-static Handle(WNT_GraphicDevice)& _XServiceImageDevice() {
-static Handle(WNT_GraphicDevice) XServiceImageDevice;
-return XServiceImageDevice;
-}
-#define XServiceImageDevice _XServiceImageDevice()
-#endif // LOPTIM
-#else
-#ifndef LOPTIM
-static Handle(Xw_GraphicDevice) XServiceDefault2dDevice;
-static Handle(Xw_GraphicDevice) XServiceImageDevice;
-#else
-static Handle(Xw_GraphicDevice)& _XServiceDefault2dDevice() {
-static Handle(Xw_GraphicDevice) XServiceDefault2dDevice;
-return XServiceDefault2dDevice;
-}
-#define XServiceDefault2dDevice _XServiceImageDevice()
-
-static Handle(Xw_GraphicDevice)& _XServiceImageDevice() {
-static Handle(Xw_GraphicDevice) XServiceImageDevice;
-return XServiceImageDevice;
-}
-#define XServiceImageDevice _XServiceImageDevice()
-#endif // LOPTIM
-#endif // WNT
-
 /*!
     Create native view window for CasCade view [ static ]
 */
@@ -114,21 +66,21 @@ void OCCViewer_VService::SetWindow( const Handle(V3d_View)& view,
     Magnifies 'view' based on previous view [ static ]
 */
 void OCCViewer_VService::SetMagnify( const Handle(V3d_View)& view,
-                                   const Standard_Integer hiwin,
-                                   const Standard_Integer lowin,
-                                   const Handle(V3d_View)& prevView,
-                                   const Standard_Integer x1,
-                                   const Standard_Integer y1,
-                                   const Standard_Integer x2,
-                                   const Standard_Integer y2,
-                               const Xw_WindowQuality aQuality )
+                                    const Standard_Integer hiwin,
+                                    const Standard_Integer lowin,
+                                    const Handle(V3d_View)& prevView,
+                                    const Standard_Integer x1,
+                                    const Standard_Integer y1,
+                                    const Standard_Integer x2,
+                                    const Standard_Integer y2,
+                                    const Xw_WindowQuality aQuality )
 {
 #ifdef WNT
   Handle(WNT_Window) w =
-      new WNT_Window( Handle(Graphic3d_WNTGraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin );
+    new WNT_Window( Handle(Graphic3d_WNTGraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin );
 #else
   Handle(Xw_Window) w =
-      new Xw_Window( Handle(Graphic3d_GraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin, aQuality );
+    new Xw_Window( Handle(Graphic3d_GraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin, aQuality );
 #endif
   view->SetMagnify( w, prevView, x1, y1, x2, y2 );
 }
@@ -137,180 +89,26 @@ void OCCViewer_VService::SetMagnify( const Handle(V3d_View)& view,
     Creates viewer 3d [ static ]
 */
 Handle(V3d_Viewer) OCCViewer_VService::Viewer3d( const Standard_CString aDisplay,
-                                           const Standard_ExtString aName,
-                                           const Standard_CString aDomain,
-                                           const Standard_Real ViewSize ,
-                                           const V3d_TypeOfOrientation ViewProj,
-                                           const Standard_Boolean ComputedMode,
-                                           const Standard_Boolean aDefaultComputedMode )
+                                                const Standard_ExtString aName,
+                                                const Standard_CString aDomain,
+                                                const Standard_Real ViewSize ,
+                                                const V3d_TypeOfOrientation ViewProj,
+                                                const Standard_Boolean ComputedMode,
+                                                const Standard_Boolean aDefaultComputedMode )
 {
 #ifndef WNT
-    static Handle(Graphic3d_GraphicDevice) defaultdevice;
-    if ( defaultdevice.IsNull() )
-        defaultdevice = new Graphic3d_GraphicDevice( aDisplay );
-    return new V3d_Viewer( defaultdevice, aName, aDomain, ViewSize, ViewProj,
-                           Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT,
-                           ComputedMode, aDefaultComputedMode, V3d_TEX_NONE );
+  static Handle(Graphic3d_GraphicDevice) defaultdevice;
+  if ( defaultdevice.IsNull() )
+    defaultdevice = new Graphic3d_GraphicDevice( aDisplay );
+  return new V3d_Viewer( defaultdevice, aName, aDomain, ViewSize, ViewProj,
+                        Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT,
+                        ComputedMode, aDefaultComputedMode, V3d_TEX_NONE );
 #else
-    static Handle(Graphic3d_WNTGraphicDevice) defaultdevice;
-    if ( defaultdevice.IsNull() )
-        defaultdevice = new Graphic3d_WNTGraphicDevice();
-    return new V3d_Viewer( defaultdevice, aName, aDomain, ViewSize, ViewProj,
-                           Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT,
-                           ComputedMode, aDefaultComputedMode, V3d_TEX_NONE);
+  static Handle(Graphic3d_WNTGraphicDevice) defaultdevice;
+  if ( defaultdevice.IsNull() )
+    defaultdevice = new Graphic3d_WNTGraphicDevice();
+  return new V3d_Viewer( defaultdevice, aName, aDomain, ViewSize, ViewProj,
+                        Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT,
+                        ComputedMode, aDefaultComputedMode, V3d_TEX_NONE);
 #endif  // WNT
 }
-
-/*!
-    Creates view 2D and maps it to the window [ static ]
-*/
-/*Handle(V2d_View) OCCViewer_VService::View2d( const Handle(V2d_Viewer)& aViewer,
-                                                           const Standard_Integer hiwin,
-                                                           const Standard_Integer lowin,
-                                                           const Xw_WindowQuality aQuality,
-                                                           const Standard_Boolean Update,
-                                                           const Quantity_NameOfColor BackColor )
-{
-#ifdef WNT
-    Handle(WNT_GraphicDevice) GD = Handle(WNT_GraphicDevice)::DownCast(aViewer->Device());
-    Handle(WNT_Window) W = new WNT_Window( GD, hiwin, lowin, BackColor );
-    Handle(WNT_WDriver) D = new WNT_WDriver( W );
-#else
-    Handle(Xw_GraphicDevice) GD = Handle(Xw_GraphicDevice)::DownCast(aViewer->Device());
-    Handle(Xw_Window) W = new Xw_Window( GD, hiwin, lowin, aQuality, BackColor );
-    Handle(Xw_Driver) D = new Xw_Driver( W );
-#endif
-    Handle(V2d_View)  V = new V2d_View( D, aViewer );
-    if ( Update )
-        V->Update();
-    return V;
-}*/
-
-/*!
-    Creates view 2D and maps it to the window [ static ]
-*/
-/*Handle(V2d_View) OCCViewer_VService::dpsView2d( const Handle(V2d_Viewer)& aViewer,
-                                                              const Standard_Integer hiwin,
-                                                              const Standard_Integer lowin,
-                                                              const Xw_WindowQuality aQuality,
-                                                              const Standard_Boolean Update,
-                                                              const Quantity_NameOfColor BackColor )
-{
-#ifdef WNT
-    Handle(WNT_GraphicDevice) GD = Handle(WNT_GraphicDevice)::DownCast(aViewer->Device());
-    Handle(WNT_Window) W = new WNT_Window( GD, hiwin, lowin, BackColor );
-    W->SetBackground( BackColor );
-    Handle(WNT_WDriver) D = new WNT_WDriver( W );
-#else
-    Handle(Xw_GraphicDevice) GD = Handle(Xw_GraphicDevice)::DownCast(aViewer->Device());
-    Handle(Xw_Window) W = new Xw_Window( GD,  hiwin, lowin, aQuality, BackColor );
-    Handle(Xdps_Driver) D = new Xdps_Driver( W );
-#endif
-    Handle(V2d_View)  V = new V2d_View( D, aViewer );
-    if ( Update )
-        V->Update();
-    return V;
-}*/
-
-/*!
-    Creates viewer 2D [ static ]
-*/
-/*Handle(V2d_Viewer) OCCViewer_VService::Viewer2d( const Standard_CString aDisplay,
-                                                           const Standard_ExtString aName,
-                                                           const Standard_CString aDomain )
-{
-#ifdef WNT
-    if ( XServiceDefault2dDevice.IsNull() )
-        XServiceDefault2dDevice = new WNT_GraphicDevice();
-#else
-    if ( XServiceDefault2dDevice.IsNull() )
-        XServiceDefault2dDevice = new Xw_GraphicDevice( aDisplay, Xw_TOM_READONLY );
-#endif
-    return new V2d_Viewer( XServiceDefault2dDevice, aName, aDomain );
-}*/
-
-/*!
-    Creates viewer 2D [ static ]
-*/
-/*Handle(V2d_Viewer) OCCViewer_VService::Viewer2d( const Standard_CString aDisplay,
-                                                           const Handle(Graphic2d_View)& aView,
-                                                           const Standard_ExtString aName,
-                                                           const Standard_CString aDomain )
-{
-#ifdef WNT
-    if ( XServiceDefault2dDevice.IsNull() )
-        XServiceDefault2dDevice = new WNT_GraphicDevice();
-#else
-    if ( XServiceDefault2dDevice.IsNull() )
-        XServiceDefault2dDevice = new Xw_GraphicDevice( aDisplay, Xw_TOM_READONLY );
-#endif
-    return new V2d_Viewer( XServiceDefault2dDevice, aView, aName, aDomain );
-}*/
-
-/*!
-    Creates window driver [ static ]
-*/
-Handle(Aspect_WindowDriver) OCCViewer_VService::WindowDriver( const Standard_CString aDisplay,
-                                                        const Standard_Integer ahiwin,
-                                                        const Standard_Integer alowin,
-                                                        const Quantity_NameOfColor aColor )
-{
-#ifdef WNT
-    if ( XServiceDefault2dDevice.IsNull() )
-        XServiceDefault2dDevice = new WNT_GraphicDevice();
-    Handle(WNT_Window) W = new WNT_Window( XServiceDefault2dDevice, ahiwin, alowin, aColor );
-    return new WNT_WDriver( W );
-#else
-    if ( XServiceDefault2dDevice.IsNull() )
-        XServiceDefault2dDevice = new Xw_GraphicDevice( aDisplay, Xw_TOM_READONLY );
-    Handle(Xw_Window) W = new Xw_Window( XServiceDefault2dDevice, ahiwin, alowin, Xw_WQ_DRAWINGQUALITY , aColor );
-    return new Xw_Driver( W );
-#endif
-}
-
-/*!
-    Creates Xdps window driver [ static ]
-    On Win32 the same as OCCViewer_VService::WindowDriver()
-*/
-/*
-Handle(Aspect_WindowDriver) OCCViewer_VService::XdpsDriver( const Standard_CString aDisplay,
-                                                      const Standard_Integer ahiwin,
-                                                      const Standard_Integer alowin,
-                                                      const Quantity_NameOfColor aColor )
-{
-#ifdef WNT
-    if ( XServiceDefault2dDevice.IsNull() )
-        XServiceDefault2dDevice = new WNT_GraphicDevice();
-    Handle(WNT_Window) W = new WNT_Window( XServiceDefault2dDevice, ahiwin, alowin, aColor );
-    return new WNT_WDriver( W );
-#else
-    if ( XServiceDefault2dDevice.IsNull() )
-        XServiceDefault2dDevice = new Xw_GraphicDevice( aDisplay, Xw_TOM_READONLY );
-    Handle(Xw_Window) W = new Xw_Window( XServiceDefault2dDevice, ahiwin, alowin,
-                                         Xw_WQ_DRAWINGQUALITY, aColor );
-    return new Xdps_Driver( W );
-#endif
-}
-*/
-/*!
-    Creates Xw window driver [ static ]
-    On Win32 the same as OCCViewer_VService::WindowDriver()
-*/
-Handle(Aspect_WindowDriver) OCCViewer_VService::ImageDriver( const Standard_CString aDisplay,
-                                                       const Standard_Integer ahiwin,
-                                                       const Standard_Integer alowin,
-                                                       const Quantity_NameOfColor aColor )
-{
-#ifdef WNT
-    if ( XServiceImageDevice.IsNull() )
-        XServiceImageDevice = new WNT_GraphicDevice();
-    Handle(WNT_Window) W = new WNT_Window( XServiceImageDevice, ahiwin, alowin, aColor );
-    return new WNT_WDriver( W );
-#else
-    if ( XServiceImageDevice.IsNull() )
-        XServiceImageDevice = new Xw_GraphicDevice( aDisplay, Xw_TOM_READONLY );
-    Handle(Xw_Window) W = new Xw_Window( XServiceImageDevice, ahiwin, alowin,
-                                         Xw_WQ_PICTUREQUALITY, aColor );
-    return new Xw_Driver( W );
-#endif
-}
index 06af9e043ee9ea7d0ba0cfb51aee35d2a278e27b..73dfcff4525fe2e9b85d96ea82f5c432f07285d2 100755 (executable)
 #ifndef OCCVIEWER_VSERVICE_H
 #define OCCVIEWER_VSERVICE_H
 
-#ifndef _Handle_V3d_View_HeaderFile
+#include <Handle_Aspect_Window.hxx>
 #include <Handle_V3d_View.hxx>
-#endif
-#ifndef _Standard_Integer_HeaderFile
-#include <Standard_Integer.hxx>
-#endif
-#ifndef _Xw_WindowQuality_HeaderFile
-#include <Xw_WindowQuality.hxx>
-#endif
-#ifndef _Handle_V3d_Viewer_HeaderFile
 #include <Handle_V3d_Viewer.hxx>
-#endif
-#ifndef _Standard_CString_HeaderFile
+#include <Standard_Boolean.hxx>
 #include <Standard_CString.hxx>
-#endif
-#ifndef _Standard_ExtString_HeaderFile
 #include <Standard_ExtString.hxx>
-#endif
-#ifndef _Quantity_Length_HeaderFile
+#include <Standard_Integer.hxx>
 #include <Quantity_Length.hxx>
-#endif
-#ifndef _Quantity_NameOfColor_HeaderFile
-#include <Quantity_NameOfColor.hxx>
-#endif
-#ifndef _V3d_TypeOfOrientation_HeaderFile
+#include <Xw_WindowQuality.hxx>
 #include <V3d_TypeOfOrientation.hxx>
-#endif
-#ifndef _Standard_Boolean_HeaderFile
-#include <Standard_Boolean.hxx>
-#endif
-#ifndef _Handle_Graphic2d_View_HeaderFile
-#include <Handle_Graphic2d_View.hxx>
-#endif
-#ifndef _Handle_Aspect_WindowDriver_HeaderFile
-#include <Handle_Aspect_WindowDriver.hxx>
-#endif
-#ifndef _Handle_Aspect_Window_HeaderFile
-#include <Handle_Aspect_Window.hxx>
-#endif
-
-class V3d_View;
-class V2d_View;
-class V3d_Viewer;
-class V2d_Viewer;
-class Graphic2d_View;
-class Aspect_WindowDriver;
-
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
 
 class Standard_EXPORT OCCViewer_VService
 {
@@ -122,24 +79,6 @@ public:
                               const V3d_TypeOfOrientation ViewProj = V3d_XposYnegZpos,
                               const Standard_Boolean ComputedMode = Standard_True,
                               const Standard_Boolean DefaultComputedMode = Standard_True );
-
-    static Handle_Aspect_WindowDriver
-                    WindowDriver( const Standard_CString display,
-                                  const Standard_Integer hiwin,
-                                  const Standard_Integer lowin,
-                                  const Quantity_NameOfColor color = Quantity_NOC_GRAY69 );
-    /*static Handle_Aspect_WindowDriver
-                    XdpsDriver( const Standard_CString display,
-                                const Standard_Integer hiwin,
-                                const Standard_Integer lowin,
-                                const Quantity_NameOfColor color = Quantity_NOC_GRAY69 );
-    */
-    static Handle_Aspect_WindowDriver
-                    ImageDriver( const Standard_CString display,
-                                 const Standard_Integer hiwin,
-                                 const Standard_Integer lowin,
-                                 const Quantity_NameOfColor color = Quantity_NOC_GRAY69 );
-
 };
 
 #endif