1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0023712: Remove dependency on Aspect_GraphicDevice from Aspect_Window

This commit is contained in:
dbv
2013-02-18 11:59:36 +04:00
parent 8db070a59d
commit dc3fe572ec
114 changed files with 809 additions and 10216 deletions

View File

@@ -1594,26 +1594,6 @@ is
-- extension must be one of ".png",".bmp",".jpg",".gif".
-- Returns FALSE when the dump has failed
Dump ( me: mutable;
theFile : CString from Standard;
theFormat : FormatOfSheetPaper from Aspect;
theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB )
returns Boolean from Standard;
---Level: Public
---Purpose: dump the full contents of the view with a
-- different scale according to the required sheet
-- paper size (format) and the ratio
-- width/height of the view.
-- and returns FALSE when the dump has failed
-- Warning : the file name extension must be one of
-- ".png",".bmp",".jpg",".gif"
-- but make becarefull about the time to dump and
-- resulting file size especially for the A0 format.
-- NOTE that you can use after any standard system utility
-- for editing or sending the image file to a laser printer.
-- (i.e: Microsoft Photo Editor on Windows system
-- or Image Viewer on SUN system)
Print (me; hPrnDC: Handle from Aspect = NULL;
showDialog: Boolean = Standard_True;
showBackground : Boolean = Standard_True;

View File

@@ -3309,37 +3309,6 @@ Standard_Boolean V3d_View::Dump (const Standard_CString theFile,
return ToPixMap (anImage, aWinWidth, aWinHeight, theBufferType) && anImage.Save (theFile);
}
////////////////////////////////////////////////////////////////
Standard_Boolean V3d_View::Dump (const Standard_CString theFile,
const Aspect_FormatOfSheetPaper theFormat,
const Graphic3d_BufferType& theBufferType)
{
// convert Aspect_FormatOfSheetPaper size to pixel ...
Quantity_Length anSPWidth, anSPHeight;
Aspect::ValuesOfFOSP (theFormat, anSPWidth, anSPHeight);
// adjusting to the ratio width/height ...
Quantity_Length aWinWidth, aWinHeight;
MyWindow->MMSize (aWinWidth, aWinHeight);
Standard_Integer aPixelWidth, aPixelHeight;
MyWindow->Size (aPixelWidth, aPixelHeight);
Quantity_Factor aScale = Min (anSPWidth / aWinWidth, anSPHeight / aWinHeight);
aPixelWidth = Standard_Integer (aPixelWidth * aScale);
aPixelHeight = Standard_Integer (aPixelHeight * aScale);
Image_AlienPixMap anImage;
ToPixMap (anImage, aPixelWidth, aPixelHeight, theBufferType);
OSD_Environment anEnvGamma ("CSF_GAMMA_CORRECTION");
TCollection_AsciiString strGamma (anEnvGamma.Value());
if (!anImage.IsEmpty() && !strGamma.IsEmpty())
{
Standard_Real aGammaValue = strGamma.RealValue();
anImage.AdjustGamma (aGammaValue);
}
return anImage.Save (theFile);
}
////////////////////////////////////////////////////////////////
Standard_Boolean V3d_View::ToPixMap (Image_PixMap& theImage,
const Standard_Integer theWidth,

View File

@@ -47,7 +47,7 @@ inherits
uses
GraphicDevice from Aspect,
GraphicDriver from Graphic3d,
TypeOfUpdate from V3d,
TypeOfVisualization from V3d,
TypeOfShadingModel from V3d,
@@ -90,7 +90,7 @@ raises
is
Create ( Device : GraphicDevice from Aspect;
Create ( theDriver : GraphicDriver from Graphic3d;
aName : ExtString from Standard;
aDomain : CString from Standard = "";
ViewSize : Length from Quantity = 1000.0 ;
@@ -103,7 +103,7 @@ is
DefaultComputedMode: Boolean from Standard = Standard_True;
SurfaceDetail : TypeOfSurfaceDetail from V3d = V3d_TEX_NONE)
returns mutable Viewer from V3d
---Purpose: Create a Viewer on the given device with the given parameters or
---Purpose: Create a Viewer with the given graphic driver and the given parameters or
-- with their default values.
-- Currently creating of more than 100 viewer instances
-- is not supported and leads to an exception.
@@ -112,9 +112,7 @@ is
---Purpose: If the size of the view is <= 0
-- if ComputedMode is false, only the degenerate mode will be used.
--
-- Warning: Client must creates a graphic-device of type
-- Graphic3d_GraphicDevice under UNIX
-- or Graphic3d_WNTGraphicDevice under WindowsNT
-- Warning: Client must creates a graphic driver
CreateView (me: mutable) returns mutable View from V3d;
---Level: Public

View File

@@ -49,15 +49,12 @@
#include <Viewer_BadValue.hxx>
#include <V3d_OrthographicView.hxx>
#include <V3d_PerspectiveView.hxx>
#ifdef WNT
#include <WNT_GraphicDevice.hxx>
#endif
/*----------------------------------------------------------------------*/
//-Constructor:
V3d_Viewer::V3d_Viewer(const Handle(Aspect_GraphicDevice)& Device , const Standard_ExtString aName, const Standard_CString aDomain,const Standard_Real ViewSize , const V3d_TypeOfOrientation ViewProj , const Quantity_NameOfColor ViewBackground , const V3d_TypeOfVisualization Visualization , const V3d_TypeOfShadingModel ShadingModel , const V3d_TypeOfUpdate UpdateMode, const Standard_Boolean ComputedMode , const Standard_Boolean DefaultComputedMode , const V3d_TypeOfSurfaceDetail SurfaceDetail )
:Viewer_Viewer(Device,aName,aDomain,-1),
V3d_Viewer::V3d_Viewer(const Handle(Graphic3d_GraphicDriver)& theDriver , const Standard_ExtString aName, const Standard_CString aDomain,const Standard_Real ViewSize , const V3d_TypeOfOrientation ViewProj , const Quantity_NameOfColor ViewBackground , const V3d_TypeOfVisualization Visualization , const V3d_TypeOfShadingModel ShadingModel , const V3d_TypeOfUpdate UpdateMode, const Standard_Boolean ComputedMode , const Standard_Boolean DefaultComputedMode , const V3d_TypeOfSurfaceDetail SurfaceDetail )
:Viewer_Viewer(theDriver,aName,aDomain,-1),
MyDefinedViews(),
MyActiveViews(),
MyDefinedLights(),
@@ -78,7 +75,7 @@ myDisplayPlaneLength(ViewSize)
#endif
{
MyViewer = new Visual3d_ViewManager(Device) ;
MyViewer = new Visual3d_ViewManager(theDriver) ;
// san (16/09/2010): It has been decided to turn depth test ON
// by default, as this is important for new font rendering
// (without it, there are numerous texture rendering artefacts)