0022337: V3d_View::Print crashes in OCCT 6.5.0

This commit is contained in:
APL
2011-09-07 07:16:18 +00:00
committed by bugmaster
parent 31b8106853
commit 7edf74fd3d
18 changed files with 1360 additions and 419 deletions

View File

@@ -74,6 +74,7 @@ uses
RenderingContext from Aspect,
GraphicCallbackProc from Aspect,
ColorScale from Aspect,
PrintAlgo from Aspect,
CRawBufferData from Image,
@@ -1075,12 +1076,14 @@ is
-- displayed in <me>.
---Category: Private methods
Print (me; AnUnderLayer : Layer from Visual3d;
AnOverLayer : Layer from Visual3d;
hPrnDC: Handle from Aspect;
showBackground: Boolean;
filename: CString)
is static;
Print (me; AnUnderLayer : Layer from Visual3d;
AnOverLayer : Layer from Visual3d;
hPrnDC : Handle from Aspect;
showBackground : Boolean;
filename : CString;
printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
theScaleFactor : Real from Standard = 1.0)
returns Boolean from Standard is static;
---Level: Internal
---Purpose: print the contents of all layers of the view to the printer.
@@ -1089,12 +1092,21 @@ is
-- (background is white)
-- else set to TRUE for printing with current background color.
-- <filename>: If != NULL, then the view will be printed to a file.
-- <printAlgo>: Select print algorithm: stretch, tile.
-- <theScaleFactor>: Scaling coefficient, used internally to scale the
-- printings accordingly to the scale factor selected in the printer
-- properties dialog.
-- Returns Standard_True if the data is passed to the printer, otherwise
-- Standard_False if the print operation failed due to printer error
-- or insufficient memory.
-- Warning: Works only under Windows.
Print (me; hPrnDC: Handle from Aspect;
showBackground: Boolean;
filename: CString)
is static;
Print (me; hPrnDC : Handle from Aspect;
showBackground : Boolean;
filename : CString;
printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
theScaleFactor : Real from Standard = 1.0 )
returns Boolean from Standard is static;
---Level: Internal
---Purpose: print the contents of the view to printer.
@@ -1103,6 +1115,13 @@ is
-- (background is white)
-- else set to TRUE for printing with current background color.
-- <filename>: If != NULL, then the view will be printed to a file.
-- <printAlgo>: Select print algorithm: stretch, tile.
-- <theScaleFactor>: Scaling coefficient, used internally to scale the
-- printings accordingly to the scale factor selected in the printer
-- properties dialog.
-- Returns Standard_True if the data is passed to the printer, otherwise
-- Standard_False if the print operation failed due to printer error
-- or insufficient memory.
-- Warning: Works only under Windows.
SetTransparency ( me : mutable;

View File

@@ -14,28 +14,34 @@
/* Print Methods */
/************************************************************************/
void Visual3d_View::Print (const Aspect_Handle hPrintDC,
const Standard_Boolean showBackground,
const Standard_CString filename) const
Standard_Boolean Visual3d_View::Print
(const Aspect_Handle hPrintDC,
const Standard_Boolean showBackground,
const Standard_CString filename,
const Aspect_PrintAlgo printAlgorithm,
const Standard_Real theScaleFactor) const
{
Print (MyViewManager->UnderLayer (),
MyViewManager->OverLayer (),
hPrintDC,
showBackground,
filename);
return Print (MyViewManager->UnderLayer (),
MyViewManager->OverLayer (),
hPrintDC, showBackground,
filename, printAlgorithm,
theScaleFactor);
}
void Visual3d_View::Print (const Handle(Visual3d_Layer)& AnUnderLayer,
const Handle(Visual3d_Layer)& AnOverLayer,
const Aspect_Handle hPrintDC,
const Standard_Boolean showBackground,
const Standard_CString aFilename) const
Standard_Boolean Visual3d_View::Print
(const Handle(Visual3d_Layer)& AnUnderLayer,
const Handle(Visual3d_Layer)& AnOverLayer,
const Aspect_Handle hPrintDC,
const Standard_Boolean showBackground,
const Standard_CString aFilename,
const Aspect_PrintAlgo printAlgorithm,
const Standard_Real theScaleFactor) const
{
if (IsDeleted ()) return;
if (IsDeleted ()) return Standard_False;
if ((! IsDefined ()) || (! IsActive ())) return;
if ((! IsDefined ()) || (! IsActive ())) return Standard_False;
if (! MyWindow->IsMapped ()) return;
if (! MyWindow->IsMapped ()) return Standard_False;
Aspect_CLayer2d OverCLayer;
Aspect_CLayer2d UnderCLayer;
@@ -44,6 +50,7 @@ void Visual3d_View::Print (const Handle(Visual3d_Layer)& AnUnderLayer,
if (! AnOverLayer.IsNull ()) OverCLayer = AnOverLayer->CLayer ();
if (! AnUnderLayer.IsNull ()) UnderCLayer = AnUnderLayer->CLayer ();
MyGraphicDriver->Print (MyCView, UnderCLayer, OverCLayer,
hPrintDC, showBackground, aFilename);
return MyGraphicDriver->Print (MyCView, UnderCLayer, OverCLayer,
hPrintDC, showBackground, aFilename,
printAlgorithm, theScaleFactor);
}