mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0023712: Remove dependency on Aspect_GraphicDevice from Aspect_Window
This commit is contained in:
@@ -28,7 +28,6 @@
|
||||
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <Graphic3d_WNTGraphicDevice.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <WNT_Window.hxx>
|
||||
|
@@ -27,7 +27,6 @@
|
||||
#include <Standard.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <Graphic3d_WNTGraphicDevice.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <WNT_Window.hxx>
|
||||
|
@@ -126,8 +126,7 @@ CViewer3dView::CViewer3dView()
|
||||
myDegenerateModeIsOn=Standard_True;
|
||||
m_Pen = NULL;
|
||||
NbActiveLights=2; // There are 2 default active lights
|
||||
myGraphicDriver = Handle(Graphic3d_GraphicDriver)::DownCast(
|
||||
((CViewer3dApp*)AfxGetApp())->GetGraphicDevice()->GraphicDriver() );
|
||||
myGraphicDriver = ((CViewer3dApp*)AfxGetApp())->GetGraphicDriver();
|
||||
}
|
||||
|
||||
CViewer3dView::~CViewer3dView()
|
||||
@@ -158,11 +157,7 @@ void CViewer3dView::OnInitialUpdate()
|
||||
// store for restore state after rotation (witch is in Degenerated mode)
|
||||
myDegenerateModeIsOn = Standard_True;
|
||||
|
||||
|
||||
Handle(Graphic3d_WNTGraphicDevice) theGraphicDevice =
|
||||
((CViewer3dApp*)AfxGetApp())->GetGraphicDevice();
|
||||
|
||||
Handle(WNT_Window) aWNTWindow = new WNT_Window(theGraphicDevice,GetSafeHwnd ());
|
||||
Handle(WNT_Window) aWNTWindow = new WNT_Window(GetSafeHwnd ());
|
||||
myView->SetWindow(aWNTWindow);
|
||||
if (!aWNTWindow->IsMapped()) aWNTWindow->Map();
|
||||
|
||||
|
@@ -88,14 +88,12 @@
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <Graphic3d_WNTGraphicDevice.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_Text.hxx>
|
||||
#include <PrsMgr_PresentationManager2d.hxx>
|
||||
#include <Quantity_Factor.hxx>
|
||||
#include <Quantity_Length.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
@@ -121,9 +119,6 @@
|
||||
#include <StdPrs_Curve.hxx>
|
||||
#include <StdPrs_Point.hxx>
|
||||
#include <StdPrs_PoleCurve.hxx>
|
||||
#include <StdSelect_SensitiveText2d.hxx>
|
||||
#include <StdSelect_TextProjector2d.hxx>
|
||||
#include <StdSelect_ViewerSelector2d.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColgp_HArray1OfPnt2d.hxx>
|
||||
@@ -145,7 +140,6 @@
|
||||
#include <UnitsAPI.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <WNT_WDriver.hxx>
|
||||
#include <WNT_Window.hxx>
|
||||
|
||||
// specific STEP
|
||||
|
@@ -92,7 +92,6 @@
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <Graphic3d_NameOfMaterial.hxx>
|
||||
#include <Graphic3d_WNTGraphicDevice.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <Precision.hxx>
|
||||
@@ -100,7 +99,6 @@
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_Projector.hxx>
|
||||
#include <Prs3d_Text.hxx>
|
||||
#include <PrsMgr_PresentationManager2d.hxx>
|
||||
#include <Quantity_Factor.hxx>
|
||||
#include <Quantity_Length.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
@@ -126,9 +124,6 @@
|
||||
#include <StdPrs_Curve.hxx>
|
||||
#include <StdPrs_Point.hxx>
|
||||
#include <StdPrs_PoleCurve.hxx>
|
||||
#include <StdSelect_SensitiveText2d.hxx>
|
||||
#include <StdSelect_TextProjector2d.hxx>
|
||||
#include <StdSelect_ViewerSelector2d.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColgp_HArray1OfPnt2d.hxx>
|
||||
@@ -149,7 +144,6 @@
|
||||
#include <UnitsAPI.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <WNT_WDriver.hxx>
|
||||
#include <WNT_Window.hxx>
|
||||
#include <BRepPrimAPI_MakeBox.hxx>
|
||||
#include <BRepPrimAPI_MakeCylinder.hxx>
|
||||
|
@@ -78,7 +78,6 @@
|
||||
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <Graphic3d_WNTGraphicDevice.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <WNT_Window.hxx>
|
||||
|
@@ -49,11 +49,11 @@ CAnimationDoc::CAnimationDoc()
|
||||
StaticCount++;
|
||||
myCount = StaticCount;
|
||||
|
||||
Handle(Graphic3d_WNTGraphicDevice) theGraphicDevice =
|
||||
((CAnimationApp*)AfxGetApp())->GetGraphicDevice();
|
||||
Handle(Graphic3d_GraphicDriver) aGraphicDriver =
|
||||
((CAnimationApp*)AfxGetApp())->GetGraphicDriver();
|
||||
|
||||
TCollection_ExtendedString a3DName("Visu3D");
|
||||
myViewer = new V3d_Viewer(theGraphicDevice,a3DName.ToExtString(),"", 1000.0,
|
||||
myViewer = new V3d_Viewer(aGraphicDriver,a3DName.ToExtString(),"", 1000.0,
|
||||
V3d_XposYnegZpos, Quantity_NOC_GRAY30,
|
||||
V3d_ZBUFFER,V3d_GOURAUD,V3d_WAIT,
|
||||
Standard_True, Standard_False);
|
||||
@@ -86,7 +86,7 @@ CAnimationDoc::CAnimationDoc()
|
||||
TCHAR tchBuf[80];
|
||||
|
||||
CString CASROOTValue = ((GetEnvironmentVariable("CASROOT", tchBuf, 80) > 0) ? tchBuf : NULL);
|
||||
aString = (CASROOTValue + "\\..\\data\\occ");
|
||||
aString = (CASROOTValue + "\\data\\occ");
|
||||
|
||||
char DataDirPath[200];
|
||||
strcpy_s(DataDirPath, aString);
|
||||
|
@@ -152,10 +152,7 @@ void CAnimationView3D::OnInitialUpdate()
|
||||
// store for restore state after rotation (witch is in Degenerated mode)
|
||||
myDegenerateModeIsOn = myView->DegenerateModeIsOn();
|
||||
|
||||
Handle(Graphic3d_WNTGraphicDevice) theGraphicDevice =
|
||||
((CAnimationApp*)AfxGetApp())->GetGraphicDevice();
|
||||
|
||||
Handle(WNT_Window) aWNTWindow = new WNT_Window(theGraphicDevice,GetSafeHwnd ());
|
||||
Handle(WNT_Window) aWNTWindow = new WNT_Window(GetSafeHwnd ());
|
||||
myView->SetWindow(aWNTWindow);
|
||||
if (!aWNTWindow->IsMapped()) aWNTWindow->Map();
|
||||
|
||||
|
@@ -154,36 +154,18 @@ enum CurrentAction3d {
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <Graphic2d_Array1OfVertex.hxx>
|
||||
#include <Graphic2d_Buffer.hxx>
|
||||
#include <Graphic2d_CircleMarker.hxx>
|
||||
#include <Graphic2d_DisplayList.hxx>
|
||||
#include <Graphic2d_Drawer.hxx>
|
||||
#include <Graphic2d_PolyLine.hxx>
|
||||
#include <Graphic2d_Segment.hxx>
|
||||
#include <Graphic2d_SetOfCurves.hxx>
|
||||
#include <Graphic2d_SetOfSegments.hxx>
|
||||
#include <Graphic2d_Text.hxx>
|
||||
#include <Graphic2d_Vertex.hxx>
|
||||
#include <Graphic2d_View.hxx>
|
||||
#include <Graphic3d_WNTGraphicDevice.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_Text.hxx>
|
||||
#include <PrsMgr_PresentationManager2d.hxx>
|
||||
#include <Quantity_Factor.hxx>
|
||||
#include <Quantity_Length.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
#include <Quantity_PhysicalQuantity.hxx>
|
||||
#include <Quantity_PlaneAngle.hxx>
|
||||
#include <Quantity_TypeOfColor.hxx>
|
||||
#include <Select2D_SensitiveArc.hxx>
|
||||
#include <Select2D_SensitiveBox.hxx>
|
||||
#include <Select2D_SensitiveEntity.hxx>
|
||||
#include <Select2D_SensitiveSegment.hxx>
|
||||
#include <SelectBasics_BasicTool.hxx>
|
||||
#include <SelectBasics_ListOfBox2d.hxx>
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
@@ -207,9 +189,6 @@ enum CurrentAction3d {
|
||||
#include <StdPrs_Curve.hxx>
|
||||
#include <StdPrs_Point.hxx>
|
||||
#include <StdPrs_PoleCurve.hxx>
|
||||
#include <StdSelect_SensitiveText2d.hxx>
|
||||
#include <StdSelect_TextProjector2d.hxx>
|
||||
#include <StdSelect_ViewerSelector2d.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColgp_HArray1OfPnt2d.hxx>
|
||||
@@ -225,11 +204,8 @@ enum CurrentAction3d {
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopTools_HSequenceOfShape.hxx>
|
||||
#include <UnitsAPI.hxx>
|
||||
#include <V2d_View.hxx>
|
||||
#include <V2d_Viewer.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <WNT_WDriver.hxx>
|
||||
#include <WNT_Window.hxx>
|
||||
#include "HLRAlgo_Projector.hxx"
|
||||
#include "Aspect_MarkMap.hxx"
|
||||
|
@@ -33,7 +33,8 @@ COCCDemoApp::COCCDemoApp()
|
||||
SampleName = "";
|
||||
try
|
||||
{
|
||||
myGraphicDevice = new Graphic3d_WNTGraphicDevice;
|
||||
Handle(Aspect_DisplayConnection) aDisplayConnection;
|
||||
myGraphicDriver = Graphic3d::InitGraphicDriver (aDisplayConnection);
|
||||
}
|
||||
catch(Standard_Failure)
|
||||
{
|
||||
|
@@ -25,8 +25,8 @@ class COCCDemoApp : public OCC_BaseApp
|
||||
{
|
||||
public:
|
||||
COCCDemoApp();
|
||||
Handle(Graphic3d_WNTGraphicDevice) GetGraphicDevice() const
|
||||
{ return myGraphicDevice; } ;
|
||||
Handle(Graphic3d_GraphicDriver) GetGraphicDriver() const
|
||||
{ return myGraphicDriver; } ;
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
Handle(Graphic3d_WNTGraphicDevice) myGraphicDevice;
|
||||
Handle(Graphic3d_GraphicDriver) myGraphicDriver;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -43,10 +43,10 @@ END_MESSAGE_MAP()
|
||||
COCCDemoDoc::COCCDemoDoc()
|
||||
{
|
||||
// TODO: add one-time construction code here
|
||||
Handle(Graphic3d_WNTGraphicDevice) theGraphicDevice =
|
||||
((COCCDemoApp*)AfxGetApp())->GetGraphicDevice();
|
||||
Handle(Graphic3d_GraphicDriver) aGraphicDriver =
|
||||
((COCCDemoApp*)AfxGetApp())->GetGraphicDriver();
|
||||
|
||||
myViewer = new V3d_Viewer(theGraphicDevice,(short *) "Visu3D");
|
||||
myViewer = new V3d_Viewer(aGraphicDriver,(short *) "Visu3D");
|
||||
myViewer->SetDefaultLights();
|
||||
myViewer->SetLightOn();
|
||||
myViewer->SetDefaultBackgroundColor(Quantity_TOC_RGB, 0.,0.,0.);
|
||||
|
@@ -70,8 +70,7 @@ COCCDemoView::COCCDemoView()
|
||||
myCurrentMode = CurAction3d_Nothing;
|
||||
myVisMode = VIS_SHADE;
|
||||
m_Pen = NULL;
|
||||
myGraphicDriver = Handle(Graphic3d_GraphicDriver)::DownCast(
|
||||
((COCCDemoApp*)AfxGetApp())->GetGraphicDevice()->GraphicDriver() );
|
||||
myGraphicDriver = ((COCCDemoApp*)AfxGetApp())->GetGraphicDriver();
|
||||
}
|
||||
|
||||
COCCDemoView::~COCCDemoView()
|
||||
@@ -99,10 +98,7 @@ void COCCDemoView::OnInitialUpdate()
|
||||
|
||||
myView = GetDocument()->GetViewer()->CreateView();
|
||||
|
||||
Handle(Graphic3d_WNTGraphicDevice) theGraphicDevice =
|
||||
((COCCDemoApp*)AfxGetApp())->GetGraphicDevice();
|
||||
|
||||
Handle(WNT_Window) aWNTWindow = new WNT_Window(theGraphicDevice,GetSafeHwnd ());
|
||||
Handle(WNT_Window) aWNTWindow = new WNT_Window(GetSafeHwnd ());
|
||||
myView->SetWindow(aWNTWindow);
|
||||
if (!aWNTWindow->IsMapped()) aWNTWindow->Map();
|
||||
|
||||
|
@@ -29,10 +29,11 @@
|
||||
|
||||
#include <Standard.hxx>
|
||||
|
||||
#include <Aspect_DisplayConnection.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
#include <Graphic3d_WNTGraphicDevice.hxx>
|
||||
#include <Graphic3d.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <WNT_Window.hxx>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "OCC_BaseApp.h"
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <Handle_Graphic3d_WNTGraphicDevice.hxx>
|
||||
#include <Handle_Graphic3d_GraphicDriver.hxx>
|
||||
|
||||
class Standard_EXPORT OCC_3dApp : public OCC_BaseApp
|
||||
{
|
||||
@@ -19,10 +19,10 @@ public:
|
||||
OCC_3dApp();
|
||||
virtual ~OCC_3dApp();
|
||||
|
||||
Handle_Graphic3d_WNTGraphicDevice GetGraphicDevice() const { return myGraphicDevice; } ;
|
||||
Handle_Graphic3d_GraphicDriver GetGraphicDriver() const { return myGraphicDriver; } ;
|
||||
|
||||
protected :
|
||||
Handle_Graphic3d_WNTGraphicDevice myGraphicDevice;
|
||||
Handle_Graphic3d_GraphicDriver myGraphicDriver;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_OCC_3DAPP_H__FC7278BF_390D_11D7_8611_0060B0EE281E__INCLUDED_)
|
||||
|
@@ -9,13 +9,10 @@
|
||||
#include <Quantity_Factor.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Handle_PrsMgr_PresentationManager2d.hxx>
|
||||
#include <Handle_Graphic2d_GraphicObject.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Handle_SelectMgr_Selection.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Standard_IStream.hxx>
|
||||
#include <AIS2D_InteractiveObject.hxx>
|
||||
|
||||
DEFINE_STANDARD_HANDLE(Sample2D_Image,AIS2D_InteractiveObject)
|
||||
class Sample2D_Image : public AIS2D_InteractiveObject {
|
||||
|
@@ -24,27 +24,13 @@
|
||||
#include "Standard_ShortReal.hxx"
|
||||
#pragma warning( default : 4244 ) // Issue warning 4244
|
||||
|
||||
#include <V2d_Viewer.hxx>
|
||||
#include <V2d_View.hxx>
|
||||
#include <AIS2D_InteractiveContext.hxx>
|
||||
#include <WNT_WDriver.hxx>
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <Graphic3d_WNTGraphicDevice.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <WNT_Window.hxx>
|
||||
|
||||
#include <AIS2D_InteractiveObject.hxx>
|
||||
#include <Graphic2d_SetOfCurves.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Prs2d_AspectLine.hxx>
|
||||
#include <Graphic2d_Array1OfVertex.hxx>
|
||||
#include <Graphic2d_Polyline.hxx>
|
||||
#include <Graphic2d_Text.hxx>
|
||||
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
|
Reference in New Issue
Block a user