source: trunk/source/visualization/OpenInventor/src/SoGL2PSAction.cc@ 925

Last change on this file since 925 was 925, checked in by garnier, 17 years ago

marche, mais en cours de debug sur OI

  • Property svn:mime-type set to text/cpp
File size: 5.0 KB
RevLine 
[529]1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26#ifdef G4VIS_BUILD_OI_DRIVER
27
28/*----------------------------HEPVis----------------------------------------*/
29/* */
30/* Node: SoGL2PSAction */
31/* Author: Guy Barrand */
32/* */
33/*--------------------------------------------------------------------------*/
34
[925]35#define G4DEBUG_VIS_OGL 1
36
[529]37// this :
38#include <HEPVis/actions/SoGL2PSAction.h>
39
40// Inventor :
41#include <Inventor/elements/SoViewportRegionElement.h>
42#include <Inventor/errors/SoDebugError.h>
43
[923]44#include "Geant4_gl2ps.h"
[529]45
46#include <stdio.h>
47
48SO_ACTION_SOURCE(SoGL2PSAction)
49//////////////////////////////////////////////////////////////////////////////
50void SoGL2PSAction::initClass(
51)
52//////////////////////////////////////////////////////////////////////////////
53//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
54{
[925]55#ifdef G4DEBUG_VIS_OGL
56 printf("SoGL2PSAction::initClass\n");
57#endif
[529]58 SO_ACTION_INIT_CLASS(SoGL2PSAction,SoGLRenderAction);
59}
60//////////////////////////////////////////////////////////////////////////////
61SoGL2PSAction::SoGL2PSAction(
62 const SbViewportRegion& aViewPortRegion
63)
64:SoGLRenderAction(aViewPortRegion)
[921]65,G4OpenGL2PSAction()
[529]66//////////////////////////////////////////////////////////////////////////////
67//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
68{
[925]69#ifdef G4DEBUG_VIS_OGL
70 printf("SoGL2PSAction::SoGL2PSAction\n");
71#endif
72 setFileName("out.ps");
[529]73 SO_ACTION_CONSTRUCTOR(SoGL2PSAction);
74}
75//////////////////////////////////////////////////////////////////////////////
[921]76void SoGL2PSAction::setViewport(
[529]77)
78//////////////////////////////////////////////////////////////////////////////
79//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
80{
[925]81#ifdef G4DEBUG_VIS_OGL
82 printf("SoGL2PSAction::setViewport\n");
83#endif
84 // Useful ? L.Garnier 02/2009
85
[529]86#ifdef __COIN__
87#else //SGI
88 const SbViewportRegion& vpr = getViewportRegion();
89 SoViewportRegionElement::set(getState(),vpr);
[921]90
91 const SbVec2s& win = vpr.getWindowSize();
92 fViewport[0] = 0;
93 fViewport[1] = 0;
94 fViewport[2] = win[0];
95 fViewport[3] = win[1];
[529]96#endif
97}
98//////////////////////////////////////////////////////////////////////////////
99void SoGL2PSAction::beginTraversal(
100 SoNode* aNode
101)
102//////////////////////////////////////////////////////////////////////////////
103//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
104{
[925]105#ifdef G4DEBUG_VIS_OGL
106 printf("SoGL2PSAction::beginTraversal\n");
107#endif
[529]108 if(fFile) {
109#ifdef __COIN__
110 const SbViewportRegion& vpr = getViewportRegion();
111 SoViewportRegionElement::set(getState(),vpr);
[925]112#ifdef G4DEBUG_VIS_OGL
113 printf("SoGL2PSAction::beginTraversal 1\n");
114#endif
[923]115 G4gl2psBegin();
[925]116#ifdef G4DEBUG_VIS_OGL
117 printf("SoGL2PSAction::beginTraversal 2\n");
118#endif
[529]119 traverse(aNode);
[925]120#ifdef G4DEBUG_VIS_OGL
121 printf("SoGL2PSAction::beginTraversal 3\n");
122#endif
[923]123 gl2psEndPage();
[925]124#ifdef G4DEBUG_VIS_OGL
125 printf("SoGL2PSAction::beginTraversal 4\n");
126#endif
[529]127#else //SGI
128 SoGLRenderAction::beginTraversal(aNode);
129#endif
130 } else {
131 SoGLRenderAction::beginTraversal(aNode);
132 }
[925]133#ifdef G4DEBUG_VIS_OGL
134 printf("SoGL2PSAction::beginTraversal 5\n");
135#endif
[529]136}
137
138#endif
Note: See TracBrowser for help on using the repository browser.