0024926: MeshVS - improve generation of primitive arrays
[occt.git] / src / Visual3d / Visual3d_View_Print.cxx
1 // Created by: THA
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15 // e-mail       t-hartl@muenchen.matra-dtv.fr
16
17 /************************************************************************/
18 /* Includes                                                             */
19 /************************************************************************/
20
21 #include <Visual3d_View.jxx>
22 #include <Visual3d_View.pxx>
23
24 /************************************************************************/
25 /* Print Methods                                                        */
26 /************************************************************************/
27
28 Standard_Boolean Visual3d_View::Print
29   (const Aspect_Handle    hPrintDC, 
30    const Standard_Boolean showBackground,
31    const Standard_CString filename,
32    const Aspect_PrintAlgo printAlgorithm,
33    const Standard_Real    theScaleFactor) const
34 {
35   return Print (MyViewManager->UnderLayer (),
36                 MyViewManager->OverLayer (),
37                 hPrintDC, showBackground,
38                 filename, printAlgorithm, 
39                 theScaleFactor);
40 }
41
42 Standard_Boolean Visual3d_View::Print
43   (const Handle(Visual3d_Layer)& AnUnderLayer,
44    const Handle(Visual3d_Layer)& AnOverLayer,
45    const Aspect_Handle           hPrintDC,
46    const Standard_Boolean        showBackground,
47    const Standard_CString        aFilename,
48    const Aspect_PrintAlgo        printAlgorithm,
49    const Standard_Real           theScaleFactor) const
50 {
51   if (IsDeleted ()) return Standard_False;
52
53   if ((! IsDefined ()) || (! IsActive ())) return Standard_False;
54
55   if (! MyWindow->IsMapped ()) return Standard_False;
56
57   Aspect_CLayer2d OverCLayer;
58   Aspect_CLayer2d UnderCLayer;
59
60   OverCLayer.ptrLayer = UnderCLayer.ptrLayer = NULL;
61   if (! AnOverLayer.IsNull ()) OverCLayer = AnOverLayer->CLayer ();
62   if (! AnUnderLayer.IsNull ()) UnderCLayer = AnUnderLayer->CLayer ();
63
64   return MyGraphicDriver->Print (MyCView, UnderCLayer, OverCLayer,
65                                  hPrintDC, showBackground, aFilename,
66                                  printAlgorithm, theScaleFactor);
67 }