mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0023712: Remove dependency on Aspect_GraphicDevice from Aspect_Window
This commit is contained in:
@@ -9,14 +9,12 @@
|
||||
#include <QColor>
|
||||
#include <QColorDialog>
|
||||
|
||||
#ifndef WNT
|
||||
#include <Graphic3d_GraphicDevice.hxx>
|
||||
#else
|
||||
#include <Graphic3d_WNTGraphicDevice.hxx>
|
||||
#endif
|
||||
|
||||
#include <Aspect_DisplayConnection.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Graphic3d.hxx>
|
||||
#include <Graphic3d_NameOfMaterial.hxx>
|
||||
#include <Graphic3d_GraphicDriver.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Handle(V3d_Viewer) DocumentCommon::Viewer( const Standard_CString aDisplay,
|
||||
const Standard_ExtString aName,
|
||||
@@ -26,21 +24,20 @@ Handle(V3d_Viewer) DocumentCommon::Viewer( const Standard_CString aDisplay,
|
||||
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);
|
||||
#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_GraphicDriver) aGraphicDriver;
|
||||
|
||||
if (aGraphicDriver.IsNull())
|
||||
{
|
||||
Handle(Aspect_DisplayConnection) aDisplayConnection;
|
||||
#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||
aDisplayConnection = new Aspect_DisplayConnection (aDisplay);
|
||||
#endif
|
||||
aGraphicDriver = Graphic3d::InitGraphicDriver (aDisplayConnection);
|
||||
}
|
||||
|
||||
return new V3d_Viewer(aGraphicDriver,aName,aDomain,ViewSize,ViewProj,
|
||||
Quantity_NOC_GRAY30,V3d_ZBUFFER,V3d_GOURAUD,V3d_WAIT,
|
||||
ComputedMode,aDefaultComputedMode,V3d_TEX_NONE);
|
||||
}
|
||||
|
||||
DocumentCommon::DocumentCommon( const int theIndex, ApplicationCommonWindow* app )
|
||||
|
@@ -16,11 +16,11 @@
|
||||
|
||||
#include <Visual3d_View.hxx>
|
||||
#include <Graphic3d_ExportFormat.hxx>
|
||||
#include <Graphic3d_GraphicDriver.hxx>
|
||||
#include <QWindowsStyle>
|
||||
|
||||
#if defined(_WIN32) || defined(__WIN32__)
|
||||
#include <WNT_Window.hxx>
|
||||
#include <Graphic3d_WNTGraphicDevice.hxx>
|
||||
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
|
||||
#include <Cocoa_Window.hxx>
|
||||
#else
|
||||
@@ -31,10 +31,11 @@
|
||||
#include <X11/Xmu/StdCmap.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <Xw_Window.hxx>
|
||||
#include <Graphic3d_GraphicDevice.hxx>
|
||||
#include <QColormap>
|
||||
#endif
|
||||
|
||||
#include <Aspect_DisplayConnection.hxx>
|
||||
|
||||
// the key for multi selection :
|
||||
#define MULTISELECTIONKEY Qt::ShiftModifier
|
||||
|
||||
@@ -167,16 +168,14 @@ void View::init()
|
||||
myView = myContext->CurrentViewer()->CreateView();
|
||||
#if defined(_WIN32) || defined(__WIN32__)
|
||||
Aspect_Handle aWindowHandle = (Aspect_Handle )winId();
|
||||
Handle(WNT_Window) hWnd = new WNT_Window (Handle(Graphic3d_WNTGraphicDevice)::DownCast (myContext->CurrentViewer()->Device()),
|
||||
aWindowHandle);
|
||||
Handle(WNT_Window) hWnd = new WNT_Window (aWindowHandle);
|
||||
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
|
||||
NSView* aViewHandle = (NSView* )winId();
|
||||
Handle(Cocoa_Window) hWnd = new Cocoa_Window (aViewHandle);
|
||||
#else
|
||||
Aspect_Handle aWindowHandle = (Aspect_Handle )winId();
|
||||
Handle(Xw_Window) hWnd = new Xw_Window (Handle(Graphic3d_GraphicDevice)::DownCast (myContext->CurrentViewer()->Device()),
|
||||
aWindowHandle,
|
||||
Xw_WQ_SAMEQUALITY);
|
||||
Handle(Aspect_DisplayConnection) aDispConnection = myContext->CurrentViewer()->Driver()->GetDisplayConnection();
|
||||
Handle(Xw_Window) hWnd = new Xw_Window (aDispConnection, aWindowHandle);
|
||||
#endif // WNT
|
||||
myView->SetWindow (hWnd);
|
||||
if (!hWnd->IsMapped())
|
||||
|
Reference in New Issue
Block a user