Import Geant4 9.2.0 source tree
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4DAWNFILE.hh,v 1.9 2006/06/29 21:16:28 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
// DAWNFILE driver factory.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4DAWNFILESceneHandler.hh,v 1.16 2006/06/29 21:16:30 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4DAWNFILEViewer.hh,v 1.10 2006/06/29 21:16:32 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
// DAWNFILE viewer - opens window, hard copy, etc.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FRClientServer.hh,v 1.7 2006/06/29 21:16:34 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// Satoshi TANAKA, Wed Jul 3 14:13:52 JST 1996
|
||||
////////////////////////////////
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FRConst.hh,v 1.7 2006/06/29 21:16:36 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// Satoshi TANAKA, Tue Jul 2 15:30:49 JST 1996
|
||||
///////////////////////////////////
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FRFeatures.hh,v 1.6 2006/06/29 21:16:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
#if !defined G4_FR_FEATURES_HH
|
||||
#define G4_FR_FEATURES_HH
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FRSceneFunc.icc,v 1.15 2006/07/10 15:31:45 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
|
||||
#include "G4PhysicalVolumeModel.hh"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FRofstream.hh,v 1.9 2006/06/29 21:16:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
#include <fstream>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FukuiRenderer.hh,v 1.8 2006/06/29 21:16:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FukuiRendererSceneHandler.hh,v 1.15 2006/06/29 21:16:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Satoshi TANAKA, Fri Jun 28 11:19:19 JST 1996
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FukuiRendererViewer.hh,v 1.8 2006/06/29 21:16:48 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Satoshi TANAKA, Fri Jun 28 12:10:14 JST 1996
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4DAWNFILE.cc,v 1.11 2006/06/29 21:16:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
// DAWNFILE factory.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4DAWNFILESceneHandler.cc,v 1.18 2006/06/29 21:16:52 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
// DAWNFILE scene.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4DAWNFILEViewer.cc,v 1.20 2006/06/29 21:16:54 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
// DAWNFILE view - opens window, hard copy, etc.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FRClientServer.cc,v 1.6 2006/06/29 21:16:56 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// Satoshi TANAKA, Wed Jul 3 14:14:29 JST 1996
|
||||
////////////////////////////////
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FukuiRenderer.cc,v 1.9 2006/06/29 21:16:58 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FukuiRendererSceneHandler.cc,v 1.14 2006/06/29 21:17:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Satoshi TANAKA, Fri Jun 28 11:34:24 JST 1996
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FukuiRendererViewer.cc,v 1.11 2006/06/29 21:17:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Satoshi TANAKA, Fri Jun 28 12:09:11 JST 1996
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.$Id: History,v 1.127 2007/11/16 20:29:04 perl Exp $
|
||||
.$Id: History,v 1.128 2008/01/04 22:11:31 allison Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -20,6 +20,9 @@ committal in the CVS repository !
|
||||
History file for visualization/HepRep sub-category
|
||||
--------------------------------------------------
|
||||
|
||||
4th January 2008 John Allison (vis-HepRep-V09-01-00)
|
||||
- Adapted to new BeginPrimitives2D signature.
|
||||
|
||||
16 Nov 2007 Joseph Perl (vis-HepRep-V09-00-01)
|
||||
- Adjust geometry hierarchy in G4HepRepFileSceneHandler to accomodate
|
||||
parallel worlds. Where used to just have world at top of hierarchy,
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRep.hh,v 1.17 2006/06/29 21:17:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HepRepFile.hh,v 1.8 2006/06/29 21:17:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// John Allison 5th April 2001
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4HepRepFileSceneHandler.hh,v 1.29 2006/06/29 21:17:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4HepRepFileSceneHandler.hh,v 1.30 2008/01/04 22:11:31 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Joseph Perl 27th January 2002
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
void BeginModeling();
|
||||
void EndModeling();
|
||||
|
||||
void BeginPrimitives2D();
|
||||
void BeginPrimitives2D(const G4Transform3D& objectTransformation);
|
||||
void EndPrimitives2D();
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HepRepFileViewer.hh,v 1.9 2006/06/29 21:17:10 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// John Allison 5th April 2001
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepMessenger.hh,v 1.7 2006/06/29 21:17:14 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
#ifndef G4HepRepMessenger_HH
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepSceneHandler.hh,v 1.42 2006/11/06 09:22:26 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepViewer.hh,v 1.18 2006/06/29 21:17:18 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRep.cc,v 1.22 2006/06/29 21:17:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepFile.cc,v 1.11 2007/05/22 17:05:26 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Joseph Perl 1 October 2001
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepFileSceneHandler.cc,v 1.65 2007/11/16 20:29:04 perl Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4HepRepFileSceneHandler.cc,v 1.66 2008/01/04 22:11:31 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Joseph Perl 27th January 2002
|
||||
@@ -119,12 +119,13 @@ void G4HepRepFileSceneHandler::EndModeling() {
|
||||
G4VSceneHandler::EndModeling(); // Required: see G4VSceneHandler.hh.
|
||||
}
|
||||
|
||||
void G4HepRepFileSceneHandler::BeginPrimitives2D () {
|
||||
void G4HepRepFileSceneHandler::BeginPrimitives2D
|
||||
(const G4Transform3D& objectTransformation) {
|
||||
#ifdef G4HEPREPFILEDEBUG
|
||||
G4cout << "G4HepRepFileSceneHandler::BeginPrimitives2D() " << G4endl;
|
||||
#endif
|
||||
inPrimitives2D = true;
|
||||
G4VSceneHandler::BeginPrimitives2D();
|
||||
G4VSceneHandler::BeginPrimitives2D(objectTransformation);
|
||||
}
|
||||
|
||||
void G4HepRepFileSceneHandler::EndPrimitives2D () {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepFileViewer.cc,v 1.15 2006/06/29 21:17:26 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
|
||||
#include "G4HepRepFileViewer.hh"
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepMessenger.cc,v 1.10 2006/06/29 21:17:30 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
#include "G4HepRepMessenger.hh"
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepSceneHandler.cc,v 1.101 2007/11/16 20:29:04 perl Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HepRepViewer.cc,v 1.26 2006/06/29 21:17:34 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.418 2007/11/19 19:56:26 perl Exp $
|
||||
$Id: History,v 1.424 2008/11/21 22:03:51 perl Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -24,6 +24,46 @@ committal in the CVS repository !
|
||||
History file for visualization category
|
||||
---------------------------------------
|
||||
|
||||
21st November 2008 Joseph Perl (vis-V09-01-06)
|
||||
- visman-V09-01-05: Trap recursive use of /vis/reviewKeptEvents.
|
||||
- modeling-V09-01-01: Improve message.
|
||||
- opengl-V09-01-03: Many changes to add Qt support.
|
||||
|
||||
30th April 2008 John Allison (vis-V09-01-05)
|
||||
- visman-V09-01-04: Fixes more gcc-4.3.0 compiler warnings.
|
||||
- openinventor-V09-01-01: Fixes more gcc-4.3.0 compiler warnings.
|
||||
|
||||
28th April 2008 John Allison (vis-V09-01-04)
|
||||
- visman-V09-01-03: Cosmetic improvements.
|
||||
- opengl-V09-01-02: Tidied.
|
||||
|
||||
4th April 2008 John Allison (vis-V09-01-03, needs greps-V09-01-03)
|
||||
- Back on HEAD. Contains vis-V09-01-00.
|
||||
- visman-V09-01-02: Fixed gcc-4.3.0 compiler warnings.
|
||||
- opengl-V09-01-01:
|
||||
o Fixed gcc-4.3.0 compiler warnings.
|
||||
o Fixed DBL_MAX problem in 2D drawing.
|
||||
o A lot of Qt development.
|
||||
- openinventor-V09-01-00): Fixed most gcc-4.3.0 compiler warnings.
|
||||
- raytracer-V09-01-00): Fixed gcc-4.3.0 compiler warnings.
|
||||
- vistest-V09-01-01: Zero thickness of box for 2D drawing.
|
||||
|
||||
30th January 2008 John Allison (vis-V09-01-02)
|
||||
- Bug fix tag (re-instated G4DAWNFILE) on branch vis-V09-00-03-branch.
|
||||
- DOES NOT CONTAIN vis-V09-01-00 STUFF.
|
||||
|
||||
29th January 2008 John Allison (vis-V09-01-01)
|
||||
- visman-V09-01-01: Re-instated G4DAWNFILE (somehow got lost!!)
|
||||
|
||||
4th January 2008 John Allison (vis-V09-01-00 with greps-V09-01-00)
|
||||
- Draw2D capability, already available for G4Text, extended to:
|
||||
G4Circle, G4Polyhedron, G4Polyline, G4Polymarker, G4Square.
|
||||
o modeling-V09-01-00: Adapted to new BeginPrimitives2D signature.
|
||||
o visman-V09-01-00: Implemented extended 2D interface.
|
||||
o opengl-V09-01-00: Implemented extended 2D interface.
|
||||
o vis-HepRep-V09-01-00: Adapted to new BeginPrimitives2D signature.
|
||||
o vistest-V09-01-00: MyEventAction: Added 2D polyhedron.
|
||||
|
||||
19th November 2007 Joseph Perl (vis-V09-00-03)
|
||||
- visman-V09-00-02: Replace references to Wired3 in command guidance
|
||||
- vis-HepRep-V09-00-01: Adjust geometry hierarchy for parallel worlds.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.6 2004/06/03 11:40:13 gcosmo Exp $
|
||||
# $Id: GNUmakefile,v 1.8 2008/04/29 16:58:04 lgarnier Exp $
|
||||
|
||||
name := G4OpenGL
|
||||
|
||||
@@ -6,6 +6,9 @@ ifndef G4INSTALL
|
||||
G4INSTALL = ../../..
|
||||
endif
|
||||
|
||||
# Definition of macro for moc files (for Qt use only)
|
||||
MOC_MACRO = -DG4VIS_BUILD_OPENGLQT_DRIVER
|
||||
|
||||
GLOBLIBS = libG4vis_management.lib libG4modeling.lib
|
||||
GLOBLIBS += libG4interfaces.lib libG4run.lib libG4event.lib
|
||||
GLOBLIBS += libG4tracking.lib libG4processes.lib libG4digits_hits.lib
|
||||
@@ -30,4 +33,5 @@ CPPFLAGS += -I$(G4BASE)/interfaces/common/include
|
||||
CPPFLAGS += -I$(G4BASE)/tracking/include
|
||||
CPPFLAGS += -I$(G4BASE)/digits_hits/hits/include
|
||||
|
||||
include $(G4INSTALL)/config/moc.gmk
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.103 2007/11/19 19:45:39 perl Exp $
|
||||
$Id: History,v 1.120 2008/11/21 21:56:28 perl Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -20,6 +20,87 @@ committal in the CVS repository !
|
||||
History file for visualization/OpenGL
|
||||
-------------------------------------
|
||||
|
||||
24 October, Laurent Garnier (opengl-V09-01-03)
|
||||
- Change GEANT4_QT_DEBUG flag by QTDEBUG
|
||||
- Suppress unuseful DEBUG messages
|
||||
|
||||
12th October Laurent Garnier
|
||||
- G4OpenGLQtExportDialog : improvments for Qt3"
|
||||
- G4OpenGLQtViewer,G4OpenGLImmediateQtViewer,G4OpenGLStoreQtViewer : Add the name on OpenGlQt viewers
|
||||
- G4OpenGLStoredQtViewer,G4OpenGLImmediateQt, G4OpenGLStoredQt : Change OGLSQT and OGLIQT by OGLSQt and OGLIQt
|
||||
|
||||
2 October Laurent Garnier
|
||||
- Fix a crash when there was no scene.
|
||||
|
||||
28 July Laurent Garnier
|
||||
- Fix a bug in XmRotation panel introduce in last commit by myself.
|
||||
|
||||
20th June 2008 Laurent Garnier
|
||||
- Correct some warnings
|
||||
- Move rotation code of Xm and Qt in G4OpenGLViewer::rotateScene. Same code in now shared
|
||||
|
||||
12th June 2008 Laurent Garnier
|
||||
- Emit signals when moving/rotate scene, in order to get them in external app
|
||||
|
||||
28th Mai 2008 Laurent Garnier
|
||||
- Add mouse wheel zoom commands
|
||||
|
||||
28th April 2008 Laurent Garnier
|
||||
- Add better moc control/compilation step in GNUmakefile
|
||||
- Fix a problem when launching QT VIS without QT UI (N02 for example)
|
||||
|
||||
28th April 2008 John Allison (opengl-V09-01-02)
|
||||
- G4OpenGLStoredSceneHandler: Tidied constructors of nested classes.
|
||||
|
||||
4th April 2008 John Allison (opengl-V09-01-01)
|
||||
- Fixed DBL_MAX problem in 2D drawing:
|
||||
o changed G4OPENGL_DBL_MAX to G4OPENGL_FLT_BIG.
|
||||
- Fix gcc-4.3.0 compiler warnings.
|
||||
|
||||
11th March 2008, Laurent Garnier
|
||||
- Resolve QT3 compilation errors
|
||||
|
||||
10th March 2008, Laurent Garnier
|
||||
- Add a dialog panel to make movies (Right button->Actions->Movie parameters)
|
||||
- Add ability to "auto rotate" volume launched with quick mouse move
|
||||
- Lots of improvments for Qt3
|
||||
- Improvments on moving steps with shortcuts
|
||||
- Could now select between orthogonal/perspective view mode
|
||||
|
||||
1st February 2008 John Allison
|
||||
- G4OpenGLQtViewer.cc: Fix #ifdef QT protection.
|
||||
- G4OpenGLSceneHandler.cc: Small improvement to logic of setting GL_LIGHTING.
|
||||
|
||||
30th January 2008, Laurent Garnier
|
||||
- Add moving camera on left/right/up/down arrown, going forward/backward
|
||||
on SHIFT+up/down, zoom in with +/- keys
|
||||
- Add a context menu entry for projection perspective/orthographic
|
||||
- Fix some bugs on windows in export dialog
|
||||
|
||||
15th January 2008, Laurent Garnier
|
||||
- Fixed some layout problems on export dialog box
|
||||
- Some improvements on exports formats
|
||||
- Fix a bug in the help command : The clic callback on a item was not
|
||||
working on windows
|
||||
- Fix a crash at exit when launched on a MAC.
|
||||
- EPS export format is now ready for Qt3
|
||||
- Add Vectoriel EPS export format
|
||||
- Fix an aspect ratio deformation when resize the widget
|
||||
- Fix a crash at launch with leopard
|
||||
- When selecting the "move" mouse action, this action was set even when
|
||||
mouse button was released. Fixed : Now we should clic to have the move action
|
||||
- GNUmakefile : Added a macro for moc file
|
||||
- Moc files : Suppression of all theses files. They are now autogenerated
|
||||
thanks to config/common.gmk
|
||||
|
||||
4th January 2008 John Allison (opengl-V09-01-00)
|
||||
- Implemented extended 2D interface.
|
||||
|
||||
30th November 2007 Laurent Garnier
|
||||
- Improvements for Qt3
|
||||
- moc files : Adding other versions for QT_MOC_REVISION 28,58 and
|
||||
59, but this is not the right solution..
|
||||
|
||||
19th November 2007 Joseph Perl (for Laurent Garnier) (opengl-V09-00-04)
|
||||
- Added GEANT4_QT_DEBUG flag to more places
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4OpenGL.hh,v 1.6 2007/11/15 10:14:23 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4OpenGL.hh,v 1.7 2008/04/04 13:32:22 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// G.Barrand.
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
||||
#define G4OPENGL_DBL_MAX 1.e308
|
||||
#define G4OPENGL_FLT_BIG 1.e20
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLBitMapStore.hh,v 1.2 2007/11/15 10:14:23 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// John Allison 6th January 2007
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4OpenGLFontBaseStore.hh,v 1.3 2006/06/29 21:17:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// J.Allison Apr 2005.
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateQt.hh,v 1.1 2007/09/28 14:44:13 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// OpenGLImmediateQt graphics system factory.
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateQtViewer.hh,v 1.3 2007/11/09 15:03:21 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4OpenGLImmediateQtViewer.hh,v 1.4 2008/11/06 13:43:44 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Class G4OpenGLImmediateQtViewer : a class derived from
|
||||
@@ -60,10 +60,19 @@ public:
|
||||
void resizeGL(int width,int height);
|
||||
void paintGL();
|
||||
void updateQWidget();
|
||||
void ShowView ();
|
||||
|
||||
protected:
|
||||
void wheelEvent(QWheelEvent *event);
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseMoveEvent(QMouseEvent *event);
|
||||
void mouseDoubleClickEvent(QMouseEvent *event);
|
||||
void mouseReleaseEvent(QMouseEvent *event);
|
||||
void contextMenuEvent(QContextMenuEvent *e);
|
||||
void keyPressEvent (QKeyEvent * event);
|
||||
private:
|
||||
void ComputeView ();
|
||||
|
||||
private :
|
||||
int readyToPaint;
|
||||
int nbPaint;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateSceneHandler.hh,v 1.13 2007/04/04 16:50:26 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4OpenGLImmediateSceneHandler.hh,v 1.14 2008/01/04 22:07:01 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 10th February 1997
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
virtual ~G4OpenGLImmediateSceneHandler ();
|
||||
void BeginPrimitives (const G4Transform3D& objectTransformation);
|
||||
void EndPrimitives ();
|
||||
void BeginPrimitives2D ();
|
||||
void BeginPrimitives2D (const G4Transform3D& objectTransformation);
|
||||
void EndPrimitives2D ();
|
||||
void BeginModeling ();
|
||||
void EndModeling ();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateViewer.hh,v 1.9 2006/09/04 12:07:59 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 7th February 1997
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateWin32.hh,v 1.7 2006/06/29 21:17:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// OpenGLImmediateWin32 graphics system factory.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateWin32Viewer.hh,v 1.9 2006/06/29 21:17:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Class G4OpenGLImmediateWin32Viewer : a class derived from
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateX.hh,v 1.7 2006/06/29 21:17:48 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 10th February 1997
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateXViewer.hh,v 1.9 2006/07/03 16:38:13 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 7th February 1997
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateXm.hh,v 1.7 2006/06/29 21:17:52 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 10th February 1997
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateXmViewer.hh,v 1.9 2006/07/03 16:38:13 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 10th February 1997
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLQtExportDialog.hh,v 1.3 2007/11/09 15:03:21 lgarnier Exp $
|
||||
// $Id: G4OpenGLQtExportDialog.hh,v 1.6 2008/10/15 10:16:17 lgarnier Exp $
|
||||
// GEANT4 tag $Name:
|
||||
//
|
||||
//
|
||||
@@ -35,6 +35,7 @@
|
||||
#define G4OPENGLQTEXPORTDIALOG_HH
|
||||
|
||||
#include <qdialog.h>
|
||||
#include <qobject.h>
|
||||
|
||||
class QButtonGroup;
|
||||
class QPushButton;
|
||||
@@ -45,21 +46,25 @@ class QComboBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
class QGroupBox;
|
||||
#endif
|
||||
|
||||
/** The G4OpenGLQtExportDialog class provide a Dialog displaying differents options
|
||||
for each file format
|
||||
*/
|
||||
for each file format
|
||||
*/
|
||||
class G4OpenGLQtExportDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
public:
|
||||
/** Construct a G4OpenGLQtExportDialog
|
||||
@param parent : parent widget
|
||||
@param name : name of the saved file with extention
|
||||
@param format : format of save file in lower case
|
||||
@param height : height of the original file
|
||||
@param width : width of the original file
|
||||
*/
|
||||
G4OpenGLQtExportDialog(QWidget* parent, QString name, int height =0, int width=0);
|
||||
G4OpenGLQtExportDialog(QWidget* parent, QString format, int height =0, int width=0);
|
||||
|
||||
/** Destroys G4OpenGLQtExportDialog */
|
||||
~G4OpenGLQtExportDialog();
|
||||
@@ -67,24 +72,34 @@ public:
|
||||
/** @return the value of the slider if format has a slider widget, instead return -1 */
|
||||
int getSliderValue();
|
||||
|
||||
/** return the new width for file if format has a width widget, instead return -1 */
|
||||
/** return the new width for file if format has a width widget, instead return
|
||||
the original value */
|
||||
int getWidth();
|
||||
|
||||
/** return the new height for file if format has a height widget, instead return -1 */
|
||||
/** return the new height for file if format has a height widget, instead return
|
||||
the original value */
|
||||
int getHeight();
|
||||
|
||||
/** return the value of the transparency if format has a transparency, instead return -1 */
|
||||
bool getTransparency();
|
||||
int getTransparency();
|
||||
|
||||
/** return the numbers of colors in the picture if format has a BW/Color widget, instead return -1 */
|
||||
int getNbColor();
|
||||
|
||||
public slots:
|
||||
/** return if vector EPS is checked, if button does'nt exist, return 0 */
|
||||
bool getVectorEPS();
|
||||
|
||||
/** Called by a clic on modify/original size button.This will
|
||||
invert buttons and hide/unhide size
|
||||
*/
|
||||
void changeSizeBox(bool);
|
||||
public slots:
|
||||
|
||||
/** Called by a clic on modify/original size button.This will
|
||||
invert buttons and hide/unhide size
|
||||
*/
|
||||
void changeSizeBox();
|
||||
|
||||
/** Called by a clic on vectorEPS check box.If vectorEPS checkBox is checked,
|
||||
it will enable change size buttons. Else it will disable them.
|
||||
*/
|
||||
void changeVectorEPS();
|
||||
|
||||
/** Called by changing value in height lineEdit. If ratio is keep, will also change the width
|
||||
*/
|
||||
@@ -94,13 +109,18 @@ public slots:
|
||||
*/
|
||||
void textHeightChanged(const QString &);
|
||||
|
||||
private:
|
||||
private:
|
||||
QString f_name, f_type, f_dir;
|
||||
QLabel* qualityLabel;
|
||||
bool expAll;
|
||||
QPushButton* buttonOk;
|
||||
QPushButton* buttonCancel;
|
||||
QCheckBox* transparencyEPS,*boxTransparency;
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
QGroupBox * sizeGroupBox;
|
||||
#endif
|
||||
|
||||
QCheckBox* transparencyEPS,*boxTransparency,*vectorEPSCheckBox;
|
||||
QCheckBox* ratioCheckBox;
|
||||
QSlider * qualitySlider;
|
||||
QLabel *formatLabel;
|
||||
@@ -110,7 +130,7 @@ private:
|
||||
QWidget* heightWidget,* widthWidget;
|
||||
int originalWidth;
|
||||
int originalHeight;
|
||||
|
||||
bool isChangingSize;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLQtMovieDialog.hh,v 1.4 2008/10/07 05:36:11 lgarnier Exp $
|
||||
// GEANT4 tag $Name:
|
||||
//
|
||||
//
|
||||
|
||||
#ifdef G4VIS_BUILD_OPENGLQT_DRIVER
|
||||
|
||||
#ifndef G4OPENGLQTMOVIEDIALOG_HH
|
||||
#define G4OPENGLQTMOVIEDIALOG_HH
|
||||
|
||||
#include <qdialog.h>
|
||||
|
||||
class QPushButton;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class G4OpenGLQtViewer;
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
class QGroupBox;
|
||||
#endif
|
||||
|
||||
/** The G4OpenGLQtMovieDialog class provide a Dialog displaying differents options
|
||||
for each file format
|
||||
*/
|
||||
class G4OpenGLQtMovieDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/** Construct a G4OpenGLQtMovieDialog
|
||||
@param parent : parent widget
|
||||
*/
|
||||
G4OpenGLQtMovieDialog(G4OpenGLQtViewer*,QWidget*);
|
||||
|
||||
/** Destroys G4OpenGLQtMovieDialog */
|
||||
~G4OpenGLQtMovieDialog();
|
||||
void setRecordingStatus(QString);
|
||||
void setRecordingInfos(QString);
|
||||
|
||||
private :
|
||||
QLineEdit* fEncoderPath;
|
||||
QLineEdit* fTempFolderPath;
|
||||
QLineEdit* fSaveFileName;
|
||||
G4OpenGLQtViewer *fParentViewer;
|
||||
QLabel *fEncoderStatus;
|
||||
QLabel *fTempFolderStatus;
|
||||
QLabel *fSaveFileStatus;
|
||||
QLabel *fRecordingStatus;
|
||||
QLabel *fRecordingInfos;
|
||||
QPushButton *fButtonStopFinishClose;
|
||||
QPushButton *fButtonSave;
|
||||
QPushButton *fButtonStartPause;
|
||||
|
||||
public slots :
|
||||
void stopFinishClose();
|
||||
void save();
|
||||
bool checkEncoderSwParameters();
|
||||
bool checkSaveFileNameParameters();
|
||||
bool checkTempFolderParameters();
|
||||
|
||||
private slots :
|
||||
void selectEncoderPathAction();
|
||||
void selectTempPathAction();
|
||||
void selectSaveFileNameAction();
|
||||
void resetRecording();
|
||||
void enabledApplyButton();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLQtViewer.hh,v 1.4 2007/11/13 17:48:51 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4OpenGLQtViewer.hh,v 1.13 2008/11/06 13:43:44 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// G4OpenGLQtViewer : Class to provide WindowsNT specific
|
||||
@@ -54,8 +54,14 @@ class QMenu;
|
||||
#endif
|
||||
class QImage;
|
||||
class QAction;
|
||||
class QMouseEvent;
|
||||
class QKeyEvent;
|
||||
class QWheelEvent;
|
||||
class QProcess;
|
||||
class QTime;
|
||||
|
||||
class G4OpenGLSceneHandler;
|
||||
class G4OpenGLQtMovieDialog;
|
||||
|
||||
class G4OpenGLQtViewer: public QObject, virtual public G4OpenGLViewer {
|
||||
|
||||
@@ -65,19 +71,51 @@ public:
|
||||
G4OpenGLQtViewer (G4OpenGLSceneHandler& scene);
|
||||
virtual ~G4OpenGLQtViewer ();
|
||||
void SetView ();
|
||||
void ShowView ();
|
||||
virtual void updateQWidget()=0;
|
||||
void setupViewport(int, int);
|
||||
QString setEncoderPath(QString path);
|
||||
QString getEncoderPath();
|
||||
QString setTempFolderPath(QString path);
|
||||
QString getTempFolderPath();
|
||||
QString setSaveFileName(QString path);
|
||||
QString getSaveFileName();
|
||||
bool isRecording();
|
||||
bool isStopped();
|
||||
bool isPaused();
|
||||
bool isEncoding();
|
||||
bool isWaiting();
|
||||
bool isFailed();
|
||||
void setWaiting();
|
||||
bool isBadEncoder();
|
||||
bool isBadOutput();
|
||||
bool isBadTmp();
|
||||
bool isSuccess();
|
||||
void setBadTmp();
|
||||
void setBadOutput();
|
||||
void setBadEncoder();
|
||||
bool isReadyToEncode();
|
||||
void resetRecording();
|
||||
void encodeVideo();
|
||||
void stopVideo();
|
||||
void saveVideo();
|
||||
bool generateMpegEncoderParameters();
|
||||
void displayRecordingStatus();
|
||||
|
||||
protected:
|
||||
void CreateGLQtContext ();
|
||||
virtual void CreateMainWindow (QGLWidget*);
|
||||
void manageContextMenuEvent(QContextMenuEvent *e);
|
||||
void G4MousePressEvent(QPoint);
|
||||
#if QT_VERSION < 0x040000
|
||||
void G4MouseMoveEvent(int, int, Qt::ButtonState);
|
||||
#else
|
||||
void G4MouseMoveEvent(int, int, Qt::MouseButtons);
|
||||
#endif
|
||||
virtual void CreateMainWindow (QGLWidget*,QString);
|
||||
void G4resizeGL(int, int);
|
||||
void G4manageContextMenuEvent(QContextMenuEvent *e);
|
||||
void G4MousePressEvent(QMouseEvent *event);
|
||||
void G4MouseReleaseEvent();
|
||||
void G4MouseDoubleClickEvent();
|
||||
void G4MouseMoveEvent(QMouseEvent *event);
|
||||
void G4wheelEvent (QWheelEvent * event);
|
||||
void G4keyPressEvent (QKeyEvent * event);
|
||||
void rotateQtScene(float, float);
|
||||
void rotateQtCamera(float, float);
|
||||
void moveScene(float, float, float,bool);
|
||||
void FinishView();
|
||||
|
||||
|
||||
protected:
|
||||
@@ -85,53 +123,126 @@ protected:
|
||||
G4int WinSize_y;
|
||||
QGLWidget* fWindow;
|
||||
QDialog* GLWindow;
|
||||
bool hasPendingEvents();
|
||||
void savePPMToTemp();
|
||||
int fRecordFrameNumber;
|
||||
float fRotationAngleX;
|
||||
float fRotationAngleY;
|
||||
float fRotationAngleZ;
|
||||
float fDeltaRotationAngleX;
|
||||
float fDeltaRotationAngleY;
|
||||
float fDeltaRotationAngleZ;
|
||||
|
||||
bool hasToRepaint;
|
||||
bool readyToPaint;
|
||||
bool zoomAction;
|
||||
QPoint beginZoom;
|
||||
QPoint endZoom;
|
||||
|
||||
private:
|
||||
enum mouseActions {STYLE1,STYLE2,STYLE3,STYLE4};
|
||||
enum RECORDING_STEP {WAIT,START,PAUSE,CONTINUE,STOP,READY_TO_ENCODE,ENCODING,FAILED,SUCCESS,BAD_ENCODER,BAD_OUTPUT,BAD_TMP,SAVE};
|
||||
|
||||
void createPopupMenu();
|
||||
void createRadioAction(QAction *,QAction *, const std::string&,unsigned int a=1);
|
||||
void rescaleImage(int, int);
|
||||
bool generateEPS(QString,int,QImage);
|
||||
bool generateVectorEPS (QString,int,int,QImage);
|
||||
bool generatePS_PDF(QString,int,QImage);
|
||||
void showMovieParametersDialog();
|
||||
void initMovieParameters();
|
||||
QString createTempFolder();
|
||||
QString removeTempFolder();
|
||||
void setRecordingStatus(RECORDING_STEP);
|
||||
void setRecordingInfos(QString);
|
||||
QString getProcessErrorMsg();
|
||||
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
QPopupMenu *fContextMenu;
|
||||
#else
|
||||
QMenu *fContextMenu;
|
||||
#endif
|
||||
bool fMouseAction; // 1: rotate 0:move
|
||||
QPoint lastPos;
|
||||
#if QT_VERSION < 0x040000
|
||||
QPopupMenu *fDrawingWireframe;
|
||||
QPopupMenu *fDrawingLineRemoval;
|
||||
QPopupMenu *fDrawingSurfaceRemoval;
|
||||
QPopupMenu *fDrawingLineSurfaceRemoval;
|
||||
#else
|
||||
|
||||
mouseActions fMouseAction; // 1: rotate 2:move 3:pick 4:shortcuts
|
||||
QPoint fLastPos1;
|
||||
QPoint fLastPos2;
|
||||
QPoint fLastPos3;
|
||||
/** delta of scene rotation. This delta is put in degree */
|
||||
G4double fDeltaRotation;
|
||||
/** delta of scene translation. This delta is put in % of the scene view */
|
||||
G4double fDeltaSceneTranslation;
|
||||
/** delta of depth move. This delta is put in % of the scene view */
|
||||
G4double fDeltaDepth;
|
||||
/** delta of zoom move. This delta is put in % of the scene view */
|
||||
G4double fDeltaZoom;
|
||||
/** delta of auto move/rotation. This delta is put in % of the move/rotation param */
|
||||
G4double fDeltaMove;
|
||||
/** To ensure key event are keep one by one */
|
||||
bool fHoldKeyEvent;
|
||||
/** To ensure move event are keep one by one */
|
||||
bool fHoldMoveEvent;
|
||||
/** To ensure rotate event are keep one by one */
|
||||
bool fHoldRotateEvent;
|
||||
bool fAutoMove;
|
||||
QString fEncoderPath;
|
||||
QString fTempFolderPath;
|
||||
QString fMovieTempFolderPath;
|
||||
QString fSaveFileName;
|
||||
QString fParameterFileName;
|
||||
QAction *fRotateAction;
|
||||
QAction *fMoveAction;
|
||||
QAction *fPickAction;
|
||||
QAction *fFullScreenOn;
|
||||
QAction *fFullScreenOff;
|
||||
QAction *fDrawingWireframe;
|
||||
QAction *fDrawingLineRemoval;
|
||||
QAction *fDrawingSurfaceRemoval;
|
||||
QAction *fDrawingLineSurfaceRemoval;
|
||||
#endif
|
||||
G4OpenGLQtMovieDialog* fMovieParametersDialog;
|
||||
RECORDING_STEP fRecordingStep;
|
||||
QProcess *fProcess;
|
||||
QTime *fLastEventTime;
|
||||
int fSpinningDelay;
|
||||
int fLaunchSpinDelay;
|
||||
|
||||
signals:
|
||||
void rotateTheta(int);
|
||||
void rotatePhi(int);
|
||||
void moveX(int);
|
||||
void moveY(int);
|
||||
void moveZ(int);
|
||||
|
||||
public slots :
|
||||
void startPauseVideo();
|
||||
|
||||
private slots :
|
||||
void actionMouseRotate();
|
||||
void actionMouseMove();
|
||||
void actionMousePick();
|
||||
void actionDrawingWireframe();
|
||||
void actionDrawingLineRemoval();
|
||||
void actionDrawingSurfaceRemoval();
|
||||
void actionDrawingLineSurfaceRemoval();
|
||||
void actionControlPanels();
|
||||
void actionExitG4();
|
||||
void actionCreateEPS();
|
||||
void actionSaveImage();
|
||||
void actionMovieParameters();
|
||||
|
||||
void showShortcuts();
|
||||
void toggleDrawingAction(int);
|
||||
void toggleMouseAction(bool);
|
||||
void toggleMouseAction(mouseActions);
|
||||
void toggleRepresentation(bool);
|
||||
void toggleProjection(bool);
|
||||
void toggleBackground(bool);
|
||||
void toggleTransparency(bool);
|
||||
void toggleAntialiasing(bool);
|
||||
void toggleHaloing(bool);
|
||||
void toggleAux(bool);
|
||||
void toggleFullScreen(bool);
|
||||
|
||||
void dialogClosed();
|
||||
void processEncodeFinished();
|
||||
void processLookForFinished();
|
||||
void processEncodeStdout();
|
||||
// Only use for Qt>4.0
|
||||
// void dialogClosed();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLSceneHandler.hh,v 1.23 2007/04/04 16:50:26 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4OpenGLSceneHandler.hh,v 1.24 2008/01/04 22:07:01 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 27th March 1996
|
||||
@@ -57,7 +57,7 @@ class G4OpenGLSceneHandler: public G4VSceneHandler {
|
||||
public:
|
||||
virtual void BeginPrimitives (const G4Transform3D& objectTransformation);
|
||||
virtual void EndPrimitives ();
|
||||
virtual void BeginPrimitives2D ();
|
||||
virtual void BeginPrimitives2D (const G4Transform3D& objectTransformation);
|
||||
virtual void EndPrimitives2D ();
|
||||
void AddPrimitive (const G4Polyline&);
|
||||
void AddPrimitive (const G4Polymarker&);
|
||||
@@ -94,9 +94,12 @@ protected:
|
||||
const G4Polyhedron* CreateSectionPolyhedron ();
|
||||
const G4Polyhedron* CreateCutawayPolyhedron ();
|
||||
|
||||
void ClearAndDestroyAtts(); // Destroys att holders and clears pick map.
|
||||
|
||||
GLuint fPickName;
|
||||
std::map<GLuint, G4AttHolder*> fPickMap; // For picking.
|
||||
void ClearAndDestroyAtts(); // Destroys att holders and clears pick map.
|
||||
|
||||
G4bool fProcessing2D;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLSceneHandler.icc,v 1.7 2006/06/29 21:17:58 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4OpenGLSceneHandler.icc,v 1.8 2008/01/30 10:54:13 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 20th January 1998
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLStoredQt.hh,v 1.1 2007/09/28 14:44:13 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// OpenGLStoredQt graphics system factory.
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLStoredQtViewer.hh,v 1.3 2007/11/09 15:03:21 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4OpenGLStoredQtViewer.hh,v 1.7 2008/11/06 13:43:44 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Class G4OpenGLStoredQtViewer : a class derived from
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <qgl.h> // include qglwidget
|
||||
|
||||
class QMouseEvent;
|
||||
class QWheelEvent;
|
||||
class QContextMenuEvent;
|
||||
|
||||
class G4OpenGLStoredSceneHandler;
|
||||
@@ -57,20 +58,23 @@ public:
|
||||
void Initialise ();
|
||||
void initializeGL ();
|
||||
void DrawView ();
|
||||
void FinishView ();
|
||||
void resizeGL(int width,int height);
|
||||
void paintGL();
|
||||
void updateQWidget();
|
||||
void ShowView ();
|
||||
|
||||
protected:
|
||||
void wheelEvent(QWheelEvent *event);
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseMoveEvent(QMouseEvent *event);
|
||||
void mouseDoubleClickEvent(QMouseEvent *event);
|
||||
void mouseReleaseEvent(QMouseEvent *event);
|
||||
void contextMenuEvent(QContextMenuEvent *e);
|
||||
void keyPressEvent (QKeyEvent * event);
|
||||
private:
|
||||
void ComputeView ();
|
||||
|
||||
private :
|
||||
bool hasToRepaint;
|
||||
bool readyToPaint;
|
||||
int nbPaint;
|
||||
// QImage glBufferImage;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLStoredSceneHandler.hh,v 1.24 2007/04/04 16:50:26 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4OpenGLStoredSceneHandler.hh,v 1.27 2008/04/28 16:19:40 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 10th February 1997
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
virtual ~G4OpenGLStoredSceneHandler ();
|
||||
void BeginPrimitives (const G4Transform3D& objectTransformation);
|
||||
void EndPrimitives ();
|
||||
void BeginPrimitives2D ();
|
||||
void BeginPrimitives2D (const G4Transform3D& objectTransformation);
|
||||
void EndPrimitives2D ();
|
||||
void BeginModeling ();
|
||||
void EndModeling ();
|
||||
@@ -86,8 +86,7 @@ protected:
|
||||
// PODL = Persistent Object Display List.
|
||||
GLint fTopPODL; // List which calls the other PODLs.
|
||||
struct PO {
|
||||
PO(G4int id, const G4Transform3D& tr = G4Transform3D()):
|
||||
fDisplayListId(id), fTransform(tr), fPickName(0) {}
|
||||
PO(G4int id, const G4Transform3D& tr = G4Transform3D());
|
||||
G4int fDisplayListId;
|
||||
G4Transform3D fTransform;
|
||||
GLuint fPickName;
|
||||
@@ -96,9 +95,7 @@ protected:
|
||||
|
||||
// TO = Transparent Object.
|
||||
struct TO {
|
||||
TO(G4int id, const G4Transform3D& tr = G4Transform3D()):
|
||||
fDisplayListId(id), fTransform(tr), fPickName(0),
|
||||
fStartTime(-G4OPENGL_DBL_MAX), fEndTime(G4OPENGL_DBL_MAX) {}
|
||||
TO(G4int id, const G4Transform3D& tr = G4Transform3D());
|
||||
G4int fDisplayListId;
|
||||
G4Transform3D fTransform;
|
||||
GLuint fPickName;
|
||||
@@ -110,9 +107,6 @@ protected:
|
||||
// Stop-gap solution of structure re-use.
|
||||
// A proper implementation would use geometry hierarchy.
|
||||
std::map <const G4VSolid*, G4int, std::less <const G4VSolid*> > fSolidMap;
|
||||
|
||||
private:
|
||||
G4bool fProcessing2D;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLStoredViewer.hh,v 1.9 2006/06/29 21:18:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 7th February 1997
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLStoredWin32.hh,v 1.7 2006/06/29 21:18:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// OpenGLStoredWin32 graphics system factory.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLStoredWin32Viewer.hh,v 1.7 2006/06/29 21:18:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Class G4OpenGLStoredWin32Viewer : a class derived from
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLStoredX.hh,v 1.7 2006/06/29 21:18:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 10th February 1997
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLStoredXViewer.hh,v 1.7 2006/07/03 16:38:13 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 7th February 1997
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLStoredXm.hh,v 1.6 2006/06/29 21:18:12 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 10th February 1997
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLStoredXmViewer.hh,v 1.7 2006/07/03 16:38:13 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 10th February 1997
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLTransform3D.hh,v 1.7 2006/06/29 21:18:16 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 24th October 1996
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLViewer.hh,v 1.21 2007/11/10 14:50:01 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4OpenGLViewer.hh,v 1.23 2008/06/20 13:55:06 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 27th March 1996
|
||||
@@ -66,12 +66,16 @@ protected:
|
||||
void Pick(GLdouble x, GLdouble y);
|
||||
virtual void CreateFontLists () {}
|
||||
virtual void print();
|
||||
void rotateScene (G4double dx, G4double dy,G4double delta);
|
||||
//////////////////////////////Vectored PostScript production functions///
|
||||
void printBuffer(GLint, GLfloat*);
|
||||
GLfloat* spewPrimitiveEPS (FILE*, GLfloat*);
|
||||
void spewSortedFeedback (FILE*, GLint, GLfloat*);
|
||||
void spewWireframeEPS (FILE*, GLint, GLfloat*, const char*);
|
||||
void print3DcolorVertex(GLint, GLint*, GLfloat*);
|
||||
GLdouble getSceneNearWidth();
|
||||
GLdouble getSceneFarWidth();
|
||||
GLdouble getSceneDepth();
|
||||
G4float pointSize;
|
||||
char print_string[50];
|
||||
G4bool print_colour;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLViewerMessenger.hh,v 1.5 2007/05/08 11:04:11 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
|
||||
#ifndef G4OPENGLVIEWERMESSENGER_HH
|
||||
#define G4OPENGLVIEWERMESSENGER_HH
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLWin32Viewer.hh,v 1.14 2007/11/10 14:50:01 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// G4OpenGLWin32Viewer : Class to provide WindowsNT specific
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXViewer.hh,v 1.28 2007/11/10 14:50:01 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 7th February 1997
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmBox.hh,v 1.7 2006/06/29 21:18:24 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
//Box container class
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmFourArrowButtons.hh,v 1.6 2006/06/29 21:18:26 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
//Four arrow buttons class. Inherits from G4OpenGLXmVWidgetComponent
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmFramedBox.hh,v 1.7 2006/06/29 21:18:28 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
//Framed box container class
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmPushButton.hh,v 1.7 2006/06/29 21:18:30 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
//Push button class. Inherits from G4OpenGLXmVWidgetComponent
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmRadioButton.hh,v 1.7 2006/06/29 21:18:32 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
//Radio button class. Inherits from G4OpenGLXmVWidgetComponent
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmResources.hh,v 1.5 2006/06/29 21:18:34 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Default resources file for GEANT4 OpenGL Motif windows.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmSeparator.hh,v 1.6 2006/06/29 21:18:36 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
//Separator class. Inherits from G4OpenGLXmVWidgetComponent
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmSliderBar.hh,v 1.7 2006/06/29 21:18:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
//Slider bar class. Inherits from G4OpenGLXmVWidgetComponent
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmTextField.hh,v 1.7 2006/06/29 21:18:40 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
//Text field class. Inherits from G4OpenGLXmVWidgetComponent
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmTopLevelShell.hh,v 1.6 2006/06/29 21:18:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
//Top level shell class
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmVWidgetComponent.hh,v 1.6 2006/06/29 21:18:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
//Base class for all Motif component widgets
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmVWidgetContainer.hh,v 1.6 2006/06/29 21:18:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
//Base class for all Motif container widgets
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmVWidgetObject.hh,v 1.6 2006/06/29 21:18:48 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
//Virtual base class for all Motif widgets.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmVWidgetShell.hh,v 1.6 2006/06/29 21:18:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
//Base class for all Motif window widgets (shells)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmViewer.hh,v 1.10 2006/06/29 21:18:52 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 10th February 1997
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLXmViewerMessenger.hh,v 1.4 2006/06/29 21:18:54 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
|
||||
#ifdef G4VIS_BUILD_OPENGLXM_DRIVER
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLBitMapStore.cc,v 1.4 2007/11/15 10:14:23 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// John Allison 6th January 2007
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLFontBaseStore.cc,v 1.3 2006/06/29 21:18:56 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
|
||||
#include "G4OpenGLFontBaseStore.hh"
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateQt.cc,v 1.2 2007/11/15 18:24:28 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4OpenGLImmediateQt.cc,v 1.4 2008/10/24 13:49:19 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// OpenGLImmediateQt graphics system factory.
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
G4OpenGLImmediateQt::G4OpenGLImmediateQt ():
|
||||
G4VGraphicsSystem ("OpenGLImmediateQt",
|
||||
"OGLIQT",
|
||||
"OGLIQt",
|
||||
G4VisFeaturesOfOpenGLIQt (),
|
||||
G4VGraphicsSystem::threeD)
|
||||
{
|
||||
@@ -57,7 +57,7 @@ G4VSceneHandler* G4OpenGLImmediateQt::CreateSceneHandler
|
||||
|
||||
G4VViewer* G4OpenGLImmediateQt::CreateViewer
|
||||
(G4VSceneHandler& scene, const G4String& name) {
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
#ifdef G4DEBUG
|
||||
printf("G4OpenGLImmediateQt::CreateViewer \n");
|
||||
#endif
|
||||
G4VViewer* pView =
|
||||
@@ -77,7 +77,7 @@ G4VViewer* G4OpenGLImmediateQt::CreateViewer
|
||||
G4cerr << "G4OpenGLImmediateQt::CreateViewer: null pointer on"
|
||||
" new G4OpenGLImmediateQtViewer." << G4endl;
|
||||
}
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
#ifdef G4DEBUG
|
||||
printf("G4OpenGLImmediateQt::CreateViewer END \n");
|
||||
#endif
|
||||
return pView;
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateQtViewer.cc,v 1.3 2007/11/15 18:24:28 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4OpenGLImmediateQtViewer.cc,v 1.7 2008/11/06 13:43:44 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Class G4OpenGLImmediateQtViewer : a class derived from G4OpenGLQtViewer and
|
||||
@@ -34,216 +34,243 @@
|
||||
#ifdef G4VIS_BUILD_OPENGLQT_DRIVER
|
||||
|
||||
#include "G4OpenGLImmediateQtViewer.hh"
|
||||
#include "G4VisManager.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
G4OpenGLImmediateQtViewer::G4OpenGLImmediateQtViewer
|
||||
(G4OpenGLImmediateSceneHandler& sceneHandler,
|
||||
const G4String& name):
|
||||
G4VViewer (sceneHandler, sceneHandler.IncrementViewCount (), name),
|
||||
G4OpenGLViewer (sceneHandler),
|
||||
G4OpenGLQtViewer (sceneHandler),
|
||||
G4OpenGLImmediateViewer (sceneHandler),
|
||||
QGLWidget() // FIXME : gerer le pb du parent !
|
||||
{
|
||||
nbPaint =0;
|
||||
G4VViewer (sceneHandler, sceneHandler.IncrementViewCount (), name),
|
||||
G4OpenGLViewer (sceneHandler),
|
||||
G4OpenGLQtViewer (sceneHandler),
|
||||
G4OpenGLImmediateViewer (sceneHandler)
|
||||
{
|
||||
|
||||
//set true to picking
|
||||
fVP.SetPicking(true);
|
||||
#if QT_VERSION < 0x040000
|
||||
setFocusPolicy(QWidget::StrongFocus); // enable keybord events
|
||||
#else
|
||||
setFocusPolicy(Qt::StrongFocus); // enable keybord events
|
||||
#endif
|
||||
hasToRepaint =false;
|
||||
|
||||
if (fViewId < 0) return; // In case error in base class instantiation.
|
||||
}
|
||||
|
||||
G4OpenGLImmediateQtViewer::~G4OpenGLImmediateQtViewer() {
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("GLWidget::~GLWidget \n");
|
||||
#endif
|
||||
makeCurrent();
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("GLWidget::~GLWidget END\n");
|
||||
#endif
|
||||
makeCurrent();
|
||||
}
|
||||
|
||||
void G4OpenGLImmediateQtViewer::Initialise() {
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("GLWidget::Initialise \n");
|
||||
#endif
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("readyToPaint = false \n");
|
||||
#endif
|
||||
readyToPaint = false;
|
||||
CreateGLQtContext ();
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::Initialise () 2\n");
|
||||
#ifdef G4DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::Initialise \n");
|
||||
#endif
|
||||
readyToPaint = false;
|
||||
CreateMainWindow (this,QString(fName));
|
||||
CreateFontLists ();
|
||||
|
||||
CreateMainWindow (this);
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::Initialise () 3\n");
|
||||
#endif
|
||||
|
||||
CreateFontLists (); // FIXME Does nothing!
|
||||
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("readyToPaint = true \n");
|
||||
#endif
|
||||
readyToPaint = true;
|
||||
|
||||
// First Draw
|
||||
SetView();
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf(" ClearView\n");
|
||||
#endif
|
||||
ClearView (); //ok, put the background correct
|
||||
ShowView();
|
||||
FinishView();
|
||||
}
|
||||
|
||||
void G4OpenGLImmediateQtViewer::initializeGL () {
|
||||
|
||||
InitializeGLView ();
|
||||
InitializeGLView ();
|
||||
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::InitialiseGL () 1\n");
|
||||
#endif
|
||||
|
||||
// If a double buffer context has been forced upon us, ignore the
|
||||
// back buffer for this OpenGLImmediate view.
|
||||
glDrawBuffer (GL_FRONT); // FIXME : Ne marche pas avec cette ligne, mais affiche le run correctement...
|
||||
// clear the buffers and window.
|
||||
ClearView ();
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
// printf("G4OpenGLImmediateQtViewer::InitialiseGL () 2\n");
|
||||
// If a double buffer context has been forced upon us, ignore the
|
||||
// back buffer for this OpenGLImmediate view.
|
||||
// glDrawBuffer (GL_FRONT); // FIXME : Ne marche pas avec cette ligne, mais affiche le run correctement...
|
||||
// clear the buffers and window.
|
||||
ClearView ();
|
||||
FinishView ();
|
||||
|
||||
glDepthFunc (GL_LEQUAL);
|
||||
glDepthMask (GL_TRUE);
|
||||
|
||||
if (fSceneHandler.GetScene() == 0) {
|
||||
hasToRepaint =false;
|
||||
} else {
|
||||
hasToRepaint =true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** To ensure compatibility with DrawView method
|
||||
*/
|
||||
void G4OpenGLImmediateQtViewer::DrawView() {
|
||||
#ifdef G4DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::DrawView VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV\n");
|
||||
#endif
|
||||
FinishView ();
|
||||
// That's no the same logic as Stored Viewer, I don't know why...
|
||||
// see G4OpenGLStoredQtViewer::DrawView for more informations
|
||||
|
||||
updateQWidget();
|
||||
#ifdef G4DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::DrawView ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLImmediateQtViewer::ComputeView () {
|
||||
|
||||
#ifdef G4DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::ComputeView %d %d VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV\n",WinSize_x, WinSize_y);
|
||||
#endif
|
||||
makeCurrent();
|
||||
// If a double buffer context has been forced upon us, ignore the
|
||||
// back buffer for this OpenGLImmediate view.
|
||||
// glDrawBuffer (GL_FRONT);
|
||||
|
||||
G4ViewParameters::DrawingStyle style = GetViewParameters().GetDrawingStyle();
|
||||
|
||||
//Make sure current viewer is attached and clean...
|
||||
//Qt version needed
|
||||
// glViewport (0, 0, WinSize_x, WinSize_y);
|
||||
|
||||
if(style!=G4ViewParameters::hlr &&
|
||||
haloing_enabled) {
|
||||
|
||||
HaloingFirstPass ();
|
||||
NeedKernelVisit ();
|
||||
ProcessView ();
|
||||
glFlush ();
|
||||
#ifdef G4DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::ComputeView First ProcessView ok\n");
|
||||
#endif
|
||||
HaloingSecondPass ();
|
||||
|
||||
}
|
||||
|
||||
NeedKernelVisit (); // Always need to visit G4 kernel.
|
||||
ProcessView ();
|
||||
|
||||
if (isRecording()) {
|
||||
savePPMToTemp();
|
||||
}
|
||||
|
||||
|
||||
|
||||
glDepthFunc (GL_LEQUAL);
|
||||
glDepthMask (GL_TRUE);
|
||||
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::InitialiseGL -------------------------------------------------------------------------------------\n");
|
||||
#ifdef G4DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::ComputeView %d %d ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n",WinSize_x, WinSize_y);
|
||||
#endif
|
||||
hasToRepaint = true;
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLImmediateQtViewer::DrawView () {
|
||||
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::DrawView %d %d VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV\n",WinSize_x, WinSize_y);
|
||||
#endif
|
||||
// If a double buffer context has been forced upon us, ignore the
|
||||
// back buffer for this OpenGLImmediate view.
|
||||
glDrawBuffer (GL_FRONT);
|
||||
|
||||
G4ViewParameters::DrawingStyle style = GetViewParameters().GetDrawingStyle();
|
||||
|
||||
//Make sure current viewer is attached and clean...
|
||||
//Qt version needed
|
||||
glViewport (0, 0, WinSize_x, WinSize_y);
|
||||
|
||||
if(style!=G4ViewParameters::hlr &&
|
||||
haloing_enabled) {
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::DrawView DANS LE IF\n");
|
||||
#endif
|
||||
|
||||
HaloingFirstPass ();
|
||||
NeedKernelVisit ();
|
||||
ProcessView ();
|
||||
glFlush ();
|
||||
|
||||
HaloingSecondPass ();
|
||||
|
||||
}
|
||||
|
||||
NeedKernelVisit (); // Always need to visit G4 kernel.
|
||||
ProcessView ();
|
||||
FinishView ();
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::DrawView %d %d ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n",WinSize_x, WinSize_y);
|
||||
#endif
|
||||
readyToPaint = false;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
void G4OpenGLImmediateQtViewer::FinishView (
|
||||
)
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
|
||||
void G4OpenGLImmediateQtViewer::FinishView()
|
||||
{
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::FinishView VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV\n");
|
||||
#ifdef G4DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::FinishView() BEGIN\n");
|
||||
#endif
|
||||
|
||||
glFlush ();
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::FinishView ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
|
||||
glFlush ();
|
||||
#ifdef G4DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::FinishView() END\n");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
- Lors du resize de la fenetre, on doit non pas redessiner le detecteur, mais aussi les evenements
|
||||
*/
|
||||
- Lors du resize de la fenetre, on doit non pas redessiner le detecteur, mais aussi les evenements
|
||||
*/
|
||||
void G4OpenGLImmediateQtViewer::resizeGL(
|
||||
int width
|
||||
,int height)
|
||||
int aWidth
|
||||
,int aHeight)
|
||||
{
|
||||
int side = width;
|
||||
if (width > height) {
|
||||
side = height;
|
||||
}
|
||||
glViewport((width - side) / 2, (height - side) / 2, side, side);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-0.5, +0.5, +0.5, -0.5, 4.0, 15.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::resizeGL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
|
||||
#endif
|
||||
G4resizeGL(aWidth,aHeight);
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLImmediateQtViewer::paintGL()
|
||||
{
|
||||
if (!readyToPaint) {
|
||||
readyToPaint= true;
|
||||
return;
|
||||
}
|
||||
// DO NOT RESIZE IF SIZE HAS NOT CHANGE
|
||||
if (((WinSize_x == (G4int)width())) &&(WinSize_y == (G4int) height())) {
|
||||
return;
|
||||
}
|
||||
nbPaint++;
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("\n\nG4OpenGLImmediateQtViewer::paintGL VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV %d ready %d\n",nbPaint,readyToPaint);
|
||||
{
|
||||
#ifdef G4DEBUG
|
||||
printf("\n\nG4OpenGLImmediateQtViewer::paintGL ??\n");
|
||||
#endif
|
||||
WinSize_x = (G4int) width();
|
||||
WinSize_y = (G4int) height();
|
||||
if (!readyToPaint) {
|
||||
readyToPaint= true;
|
||||
return;
|
||||
}
|
||||
// DO NOT RESIZE IF SIZE HAS NOT CHANGE
|
||||
if ( !hasToRepaint) {
|
||||
if (((WinSize_x == (G4int)width())) &&(WinSize_y == (G4int) height())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
#ifdef G4DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::paintGL VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ready %d\n",readyToPaint);
|
||||
#endif
|
||||
WinSize_x = (G4int) width();
|
||||
WinSize_y = (G4int) height();
|
||||
|
||||
glViewport (0, 0, width(), height());
|
||||
setupViewport(width(),height());
|
||||
|
||||
SetView();
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
// // printf("before ClearView\n");
|
||||
#endif
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf(" ClearView\n");
|
||||
#endif
|
||||
SetView();
|
||||
|
||||
ClearView (); //ok, put the background correct
|
||||
DrawView();
|
||||
readyToPaint = true; // could be set to false by DrawView
|
||||
ClearView (); //ok, put the background correct
|
||||
ComputeView();
|
||||
|
||||
hasToRepaint = false; // could be set to false by ComputeView
|
||||
|
||||
#ifdef GEANT4_QT_DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::paintGL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %d ready %d\n\n\n",nbPaint,readyToPaint);
|
||||
#ifdef G4DEBUG
|
||||
printf("G4OpenGLImmediateQtViewer::paintGL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ready %d\n\n\n",readyToPaint);
|
||||
#endif
|
||||
}
|
||||
|
||||
void G4OpenGLImmediateQtViewer::updateQWidget() {
|
||||
updateGL();
|
||||
}
|
||||
|
||||
void G4OpenGLImmediateQtViewer::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
G4MousePressEvent(event);
|
||||
}
|
||||
|
||||
void G4OpenGLImmediateQtViewer::keyPressEvent (QKeyEvent * event)
|
||||
{
|
||||
G4keyPressEvent(event);
|
||||
}
|
||||
|
||||
void G4OpenGLImmediateQtViewer::wheelEvent (QWheelEvent * event)
|
||||
{
|
||||
G4wheelEvent(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function was build in order to make a zoom on double clic event.
|
||||
* It was think to build a rubberband on the zoom area, but never work fine
|
||||
*/
|
||||
void G4OpenGLImmediateQtViewer::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
{
|
||||
G4MouseDoubleClickEvent();
|
||||
}
|
||||
|
||||
void G4OpenGLImmediateQtViewer::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
G4MouseReleaseEvent();
|
||||
}
|
||||
|
||||
void G4OpenGLImmediateQtViewer::mouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
G4MouseMoveEvent(event);
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLImmediateQtViewer::contextMenuEvent(QContextMenuEvent *e)
|
||||
{
|
||||
G4manageContextMenuEvent(e);
|
||||
}
|
||||
|
||||
void G4OpenGLImmediateQtViewer::updateQWidget() {
|
||||
hasToRepaint= true;
|
||||
updateGL();
|
||||
hasToRepaint= false;
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLImmediateQtViewer::ShowView (
|
||||
)
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
|
||||
{
|
||||
#if QT_VERSION < 0x040000
|
||||
setActiveWindow();
|
||||
#else
|
||||
activateWindow();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateSceneHandler.cc,v 1.27 2007/04/04 16:50:26 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4OpenGLImmediateSceneHandler.cc,v 1.30 2008/04/04 13:32:22 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 10th February 1997
|
||||
@@ -129,11 +129,14 @@ void G4OpenGLImmediateSceneHandler::AddPrimitive (const G4NURBS& nurbs)
|
||||
}
|
||||
|
||||
void G4OpenGLImmediateSceneHandler::BeginPrimitives
|
||||
(const G4Transform3D& objectTransformation) {
|
||||
(const G4Transform3D& objectTransformation)
|
||||
{
|
||||
G4OpenGLSceneHandler::BeginPrimitives (objectTransformation);
|
||||
glPushMatrix();
|
||||
|
||||
G4OpenGLTransform3D oglt (objectTransformation);
|
||||
|
||||
glPushMatrix();
|
||||
|
||||
/*************************** Check matrix.
|
||||
const GLdouble* m = oglt.GetGLMatrix ();
|
||||
G4cout << "G4OpenGLTransform3D matrix:";
|
||||
@@ -157,19 +160,22 @@ void G4OpenGLImmediateSceneHandler::EndPrimitives ()
|
||||
G4OpenGLSceneHandler::EndPrimitives ();
|
||||
}
|
||||
|
||||
void G4OpenGLImmediateSceneHandler::BeginPrimitives2D()
|
||||
void G4OpenGLImmediateSceneHandler::BeginPrimitives2D
|
||||
(const G4Transform3D& objectTransformation)
|
||||
{
|
||||
G4OpenGLSceneHandler::BeginPrimitives2D();
|
||||
G4OpenGLSceneHandler::BeginPrimitives2D(objectTransformation);
|
||||
|
||||
// Push current 3D world matrices and load identity to define screen
|
||||
// coordinates...
|
||||
glMatrixMode (GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glOrtho (-1., 1., -1., 1., -G4OPENGL_DBL_MAX, G4OPENGL_DBL_MAX);
|
||||
glOrtho (-1., 1., -1., 1., -G4OPENGL_FLT_BIG, G4OPENGL_FLT_BIG);
|
||||
glMatrixMode (GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
G4OpenGLTransform3D oglt (objectTransformation);
|
||||
glMultMatrixd (oglt.GetGLMatrix ());
|
||||
}
|
||||
|
||||
void G4OpenGLImmediateSceneHandler::EndPrimitives2D()
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateViewer.cc,v 1.8 2006/09/04 12:07:59 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 7th February 1997
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateWin32.cc,v 1.11 2006/08/14 12:07:19 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// OpenGLImmediateWin32 graphics system factory.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateWin32Viewer.cc,v 1.16 2006/07/03 16:38:13 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Class G4OpenGLImmediateWin32Viewer : a class derived from G4OpenGLWin32Viewer and
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateX.cc,v 1.13 2007/08/21 14:05:51 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 27th March 1996
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateXViewer.cc,v 1.16 2006/07/03 16:38:13 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 7th February 1997
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateXm.cc,v 1.13 2006/08/14 12:07:19 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 10th February 1997
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLImmediateXmViewer.cc,v 1.17 2006/07/03 16:38:13 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 10th February 1997
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLQtExportDialog.cc,v 1.4 2007/11/13 17:48:51 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4OpenGLQtExportDialog.cc,v 1.9 2008/10/24 14:17:10 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -44,14 +44,16 @@
|
||||
#include <qradiobutton.h>
|
||||
#include <qimage.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qbuttongroup.h>
|
||||
|
||||
G4OpenGLQtExportDialog::G4OpenGLQtExportDialog(
|
||||
QWidget* parent
|
||||
,QString nomFich
|
||||
,QString format
|
||||
,int aHeight
|
||||
,int aWidth
|
||||
)
|
||||
: QDialog( parent )
|
||||
: QDialog( parent ),
|
||||
isChangingSize(false)
|
||||
{
|
||||
#if QT_VERSION < 0x040000
|
||||
setCaption( tr( " Export options" ));
|
||||
@@ -69,33 +71,227 @@ G4OpenGLQtExportDialog::G4OpenGLQtExportDialog(
|
||||
BWButton = NULL;
|
||||
|
||||
// global layout
|
||||
#if QT_VERSION < 0x040000
|
||||
QVBoxLayout* globalVLayout = new QVBoxLayout(this);
|
||||
#else
|
||||
QVBoxLayout* globalVLayout = new QVBoxLayout();
|
||||
#endif
|
||||
|
||||
globalVLayout->setMargin(10);
|
||||
globalVLayout->setSpacing(10);
|
||||
|
||||
if (nomFich.endsWith(".jpg") ||
|
||||
nomFich.endsWith(".jepg")) {
|
||||
|
||||
|
||||
// FIXME : L. Garnier 4/12/07
|
||||
// Not implented. Should deal with alpha channel
|
||||
|
||||
// if((format == "tif") ||
|
||||
// (format == "tiff") ||
|
||||
// (format == "jpg") ||
|
||||
// (format == "jpeg") ||
|
||||
// (format == "png") ||
|
||||
// (format == "xpm")) {
|
||||
|
||||
// QGroupBox *transparencyGroupBox = new QGroupBox(tr("Transparency"),this);
|
||||
// QVBoxLayout *transparencyGroupBoxLayout = new QVBoxLayout(transparencyGroupBox);
|
||||
|
||||
// boxTransparency = new QCheckBox("Save transparency",transparencyGroupBox);
|
||||
// boxTransparency->setChecked( false );
|
||||
|
||||
// transparencyGroupBoxLayout->addWidget(boxTransparency);
|
||||
// #if QT_VERSION >= 0x040000
|
||||
// transparencyGroupBox->setLayout(transparencyGroupBoxLayout);
|
||||
// #endif
|
||||
// globalVLayout->addWidget(transparencyGroupBox);
|
||||
|
||||
// }
|
||||
|
||||
// FIXME : L. Garnier 4/12/07
|
||||
// This is not working for PS and PDF images, it does nothing.
|
||||
// Image is staying in color mode
|
||||
// if ((format == "ps") || (format == "pdf") || (format == "eps")) {
|
||||
|
||||
|
||||
// size box
|
||||
|
||||
QWidget * sizeWidget = new QWidget(this); // widget containing group button
|
||||
QVBoxLayout * sizeWidgetLayout = new QVBoxLayout(sizeWidget);
|
||||
sizeWidgetLayout->setMargin (10);
|
||||
|
||||
// original and modify radiobuttons
|
||||
#if QT_VERSION < 0x040000
|
||||
QButtonGroup * sizeButtonGroupBox = new QButtonGroup ( 2,Qt::Vertical, tr("Size"),this);
|
||||
sizeButtonGroupBox->setInsideMargin (15);
|
||||
|
||||
original = new QRadioButton("Original",sizeButtonGroupBox);
|
||||
modify = new QRadioButton("Modify",sizeButtonGroupBox);
|
||||
|
||||
sizeButtonGroupBox->insert(original);
|
||||
sizeButtonGroupBox->insert(modify);
|
||||
sizeButtonGroupBox->setExclusive(true);
|
||||
sizeWidgetLayout->add(sizeButtonGroupBox);
|
||||
|
||||
connect( sizeButtonGroupBox, SIGNAL( clicked(int) ), this, SLOT( changeSizeBox()) );
|
||||
#else
|
||||
|
||||
sizeGroupBox = new QGroupBox(tr("Size"));
|
||||
QVBoxLayout *sizeGroupBoxLayout = new QVBoxLayout(sizeGroupBox);
|
||||
QButtonGroup * sizeButtonGroupBox = new QButtonGroup();
|
||||
sizeGroupBoxLayout->setMargin (15);
|
||||
|
||||
original = new QRadioButton("Original");
|
||||
modify = new QRadioButton("Modify");
|
||||
|
||||
sizeButtonGroupBox->addButton(original);
|
||||
sizeButtonGroupBox->addButton(modify);
|
||||
sizeButtonGroupBox->setExclusive(true);
|
||||
|
||||
sizeGroupBoxLayout->addWidget(original);
|
||||
sizeGroupBoxLayout->addWidget(modify);
|
||||
|
||||
sizeGroupBox->setLayout(sizeGroupBoxLayout);
|
||||
sizeWidgetLayout->addWidget(sizeGroupBox);
|
||||
|
||||
connect( sizeButtonGroupBox, SIGNAL( buttonClicked(QAbstractButton*) ), this, SLOT( changeSizeBox()) );
|
||||
#endif
|
||||
original->setChecked( true );
|
||||
|
||||
|
||||
// height
|
||||
heightWidget = new QWidget(sizeWidget);
|
||||
|
||||
QHBoxLayout *heightLineLayout = new QHBoxLayout(heightWidget);
|
||||
|
||||
QString tmp;
|
||||
|
||||
heightLineLayout->addWidget(new QLabel("Height",heightWidget));
|
||||
height = new QLineEdit(tmp.setNum(originalHeight),heightWidget);
|
||||
height->setMaxLength(5);
|
||||
#if QT_VERSION < 0x040000
|
||||
heightLineLayout->add(height);
|
||||
#else
|
||||
heightLineLayout->addWidget(height);
|
||||
#endif
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
heightWidget->setLayout(heightLineLayout);
|
||||
#endif
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
sizeWidgetLayout->add(heightWidget);
|
||||
#else
|
||||
sizeWidgetLayout->addWidget(heightWidget);
|
||||
#endif
|
||||
connect( height, SIGNAL( textChanged ( const QString& ) ), this, SLOT( textHeightChanged(const QString &) ) );
|
||||
|
||||
|
||||
// width
|
||||
widthWidget = new QWidget(sizeWidget);
|
||||
|
||||
QHBoxLayout *widthLineLayout = new QHBoxLayout(widthWidget);
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
widthLineLayout->add(new QLabel("Width ",widthWidget));
|
||||
#else
|
||||
widthLineLayout->addWidget(new QLabel("Width ",widthWidget));
|
||||
#endif
|
||||
width = new QLineEdit(tmp.setNum(originalWidth),widthWidget);
|
||||
width->setMaxLength(5);
|
||||
#if QT_VERSION < 0x040000
|
||||
widthLineLayout->add(width);
|
||||
#else
|
||||
widthLineLayout->addWidget(width);
|
||||
#endif
|
||||
#if QT_VERSION >= 0x040000
|
||||
widthWidget->setLayout(widthLineLayout);
|
||||
#endif
|
||||
#if QT_VERSION < 0x040000
|
||||
sizeWidgetLayout->add(widthWidget);
|
||||
#else
|
||||
sizeWidgetLayout->addWidget(widthWidget);
|
||||
#endif
|
||||
connect( width, SIGNAL( textChanged ( const QString& ) ), this, SLOT( textWidthChanged(const QString &) ) );
|
||||
|
||||
|
||||
|
||||
// ratio check box
|
||||
|
||||
ratioCheckBox = new QCheckBox( "Keep ratio",sizeWidget);
|
||||
ratioCheckBox->setChecked( true );
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
sizeWidgetLayout->add(ratioCheckBox);
|
||||
#else
|
||||
sizeWidgetLayout->addWidget(ratioCheckBox);
|
||||
#endif
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
ratioCheckBox->setEnabled ( false );
|
||||
heightWidget->setEnabled ( false );
|
||||
widthWidget->setEnabled ( false );
|
||||
#else
|
||||
ratioCheckBox->hide();
|
||||
heightWidget->hide();
|
||||
widthWidget->hide();
|
||||
#endif
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
sizeWidget->setLayout(sizeWidgetLayout);
|
||||
#endif
|
||||
globalVLayout->addWidget(sizeWidget);
|
||||
|
||||
if (format == "eps") {
|
||||
|
||||
QGroupBox *EPSWidgetGroupBox = new QGroupBox(tr("EPS options"),this); // widget containing group button
|
||||
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
|
||||
EPSWidgetGroupBox->setInsideMargin (15);
|
||||
|
||||
// QButtonGroup * EPSColorButtonGroupBox = new QButtonGroup( 2,Qt::Vertical, tr("EPS options"),this);
|
||||
// EPSGroupBoxLayout = new QVBoxLayout(EPSColorButtonGroupBox);
|
||||
// colorButton = new QRadioButton("Color",EPSColorButtonGroupBox);
|
||||
// BWButton = new QRadioButton("Grayscale",EPSColorButtonGroupBox);
|
||||
// EPSColorButtonGroupBox->setInsideMargin (15);
|
||||
// EPSColorButtonGroupBox->insert(colorButton);
|
||||
// EPSColorButtonGroupBox->insert(BWButton);
|
||||
// EPSColorButtonGroupBox->setExclusive(true);
|
||||
// EPSWidgetGroupBox->add(EPSColorButtonGroupBox);
|
||||
|
||||
vectorEPSCheckBox = new QCheckBox( "Vector EPS File",EPSWidgetGroupBox);
|
||||
|
||||
#else
|
||||
QVBoxLayout * EPSGroupBoxLayout = new QVBoxLayout(EPSWidgetGroupBox);
|
||||
EPSGroupBoxLayout->setMargin (15);
|
||||
|
||||
// colorButton = new QRadioButton("Color",EPSWidgetGroupBox);
|
||||
// BWButton = new QRadioButton("Grayscale",EPSWidgetGroupBox);
|
||||
|
||||
// QButtonGroup * EPSColorButtonGroupBox = new QButtonGroup();
|
||||
// EPSColorButtonGroupBox->addButton(colorButton);
|
||||
// EPSColorButtonGroupBox->addButton(BWButton);
|
||||
// EPSColorButtonGroupBox->setExclusive(true);
|
||||
|
||||
// EPSGroupBoxLayout->addWidget(colorButton);
|
||||
// EPSGroupBoxLayout->addWidget(BWButton);
|
||||
|
||||
vectorEPSCheckBox = new QCheckBox( "Vector EPS File",EPSWidgetGroupBox);
|
||||
EPSGroupBoxLayout->addWidget(vectorEPSCheckBox);
|
||||
|
||||
EPSWidgetGroupBox->setLayout(EPSGroupBoxLayout);
|
||||
#endif
|
||||
// colorButton->setChecked( true );
|
||||
vectorEPSCheckBox->setChecked( true );
|
||||
|
||||
QGroupBox *imageGroupBox = new QGroupBox(tr("Image quality"));
|
||||
#if QT_VERSION < 0x040000
|
||||
QVBoxLayout *imageGroupBoxLayout = new QVBoxLayout(imageGroupBox);
|
||||
#else
|
||||
QVBoxLayout *imageGroupBoxLayout = new QVBoxLayout;
|
||||
#endif
|
||||
QWidget *sliderBox = new QWidget;
|
||||
globalVLayout->addWidget(EPSWidgetGroupBox);
|
||||
connect( vectorEPSCheckBox, SIGNAL( clicked() ), this, SLOT( changeVectorEPS()) );
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
QHBoxLayout *hSlider = new QHBoxLayout(sliderBox);
|
||||
#else
|
||||
QHBoxLayout *hSlider = new QHBoxLayout;
|
||||
#endif
|
||||
}
|
||||
|
||||
// qualityLabel = new QLabel( tr( "Image quality" ) );
|
||||
// imageGroupBoxLayout->addWidget(qualityLabel);
|
||||
qualitySlider= new QSlider(Qt::Horizontal,0);
|
||||
if ((format == "jpg") ||
|
||||
(format == "jpeg")) {
|
||||
|
||||
QGroupBox *imageGroupBox = new QGroupBox(tr("Image quality"),this);
|
||||
QHBoxLayout *hSliderLayout = new QHBoxLayout(imageGroupBox);
|
||||
hSliderLayout->setMargin (15);
|
||||
|
||||
qualitySlider= new QSlider(Qt::Horizontal,imageGroupBox);
|
||||
#if QT_VERSION < 0x040000
|
||||
qualitySlider->setMinValue(0);
|
||||
qualitySlider->setMaxValue(100);
|
||||
@@ -106,185 +302,38 @@ G4OpenGLQtExportDialog::G4OpenGLQtExportDialog(
|
||||
qualitySlider->setTickPosition(QSlider::TicksBelow);
|
||||
#endif
|
||||
qualitySlider->setValue(60);
|
||||
hSlider->addWidget(new QLabel("low",0));
|
||||
hSlider->addWidget(qualitySlider);
|
||||
hSlider->addWidget(new QLabel("Maximum",0));
|
||||
hSliderLayout->addWidget(new QLabel("Low ",imageGroupBox));
|
||||
hSliderLayout->addWidget(qualitySlider);
|
||||
hSliderLayout->addWidget(new QLabel(" Maximum",imageGroupBox));
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
sliderBox->setLayout(hSlider);
|
||||
imageGroupBox->setLayout(hSliderLayout);
|
||||
#endif
|
||||
imageGroupBoxLayout->addWidget(sliderBox);
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
imageGroupBox->setLayout(imageGroupBoxLayout);
|
||||
#endif
|
||||
globalVLayout->addWidget(imageGroupBox);
|
||||
}
|
||||
|
||||
if(nomFich.endsWith(".eps")) {
|
||||
QGroupBox *EPSGroupBox = new QGroupBox(tr("EPS options"));
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
QVBoxLayout *EPSGroupBoxLayout = new QVBoxLayout(EPSGroupBox);
|
||||
#else
|
||||
QVBoxLayout *EPSGroupBoxLayout = new QVBoxLayout;
|
||||
#endif
|
||||
|
||||
// transparencyEPS = new QCheckBox( "transparencyEPS" );
|
||||
// transparencyEPS->setText( "save background" );
|
||||
// transparencyEPS->setChecked( true );
|
||||
|
||||
colorButton = new QRadioButton("Color",0);
|
||||
BWButton = new QRadioButton("Grayscale",0);
|
||||
colorButton->setChecked( true );
|
||||
BWButton->setChecked( false );
|
||||
|
||||
|
||||
// EPSGroupBoxLayout->addWidget(transparencyEPS);
|
||||
EPSGroupBoxLayout->addWidget(colorButton);
|
||||
EPSGroupBoxLayout->addWidget(BWButton);
|
||||
#if QT_VERSION >= 0x040000
|
||||
EPSGroupBox->setLayout(EPSGroupBoxLayout);
|
||||
#endif
|
||||
globalVLayout->addWidget(EPSGroupBox);
|
||||
|
||||
}
|
||||
|
||||
if(nomFich.endsWith(".tif") ||
|
||||
nomFich.endsWith(".tiff") ||
|
||||
nomFich.endsWith(".jpg") ||
|
||||
nomFich.endsWith(".png") ||
|
||||
nomFich.endsWith(".xpm")) {
|
||||
|
||||
QGroupBox *transparencyGroupBox = new QGroupBox(tr("Transparency"));
|
||||
#if QT_VERSION < 0x040000
|
||||
QVBoxLayout *transparencyGroupBoxLayout = new QVBoxLayout(transparencyGroupBox);
|
||||
#else
|
||||
QVBoxLayout *transparencyGroupBoxLayout = new QVBoxLayout;
|
||||
#endif
|
||||
|
||||
boxTransparency = new QCheckBox("Save transparency",0);
|
||||
boxTransparency->setChecked( false );
|
||||
// boxTransparency->setEnabled(false);
|
||||
|
||||
transparencyGroupBoxLayout->addWidget(boxTransparency);
|
||||
#if QT_VERSION >= 0x040000
|
||||
transparencyGroupBox->setLayout(transparencyGroupBoxLayout);
|
||||
#endif
|
||||
globalVLayout->addWidget(transparencyGroupBox);
|
||||
|
||||
}
|
||||
|
||||
// size box
|
||||
QGroupBox *sizeGroupBox = new QGroupBox(tr("Size"));
|
||||
QWidget* modifyAndRatioWidget = new QWidget;
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
QHBoxLayout *modifyAndRatioLayout = new QHBoxLayout(modifyAndRatioWidget);
|
||||
QVBoxLayout *sizeGroupBoxLayout = new QVBoxLayout(sizeGroupBox);
|
||||
#else
|
||||
QHBoxLayout *modifyAndRatioLayout = new QHBoxLayout;
|
||||
QVBoxLayout *sizeGroupBoxLayout = new QVBoxLayout;
|
||||
#endif
|
||||
|
||||
// original button
|
||||
original = new QRadioButton("Original",0);
|
||||
original->setChecked( true );
|
||||
sizeGroupBoxLayout->addWidget(original);
|
||||
|
||||
// modify and ratio
|
||||
modify = new QRadioButton("Modify",0);
|
||||
modify->setChecked( false );
|
||||
|
||||
ratioCheckBox = new QCheckBox( "Keep ratio",0 );
|
||||
ratioCheckBox->setChecked( true );
|
||||
|
||||
modifyAndRatioLayout->addWidget(modify);
|
||||
modifyAndRatioLayout->addWidget(ratioCheckBox);
|
||||
#if QT_VERSION >= 0x040000
|
||||
modifyAndRatioWidget->setLayout(modifyAndRatioLayout);
|
||||
#endif
|
||||
sizeGroupBoxLayout->addWidget(modifyAndRatioWidget);
|
||||
if (modify->isChecked()) {
|
||||
ratioCheckBox->show();
|
||||
} else {
|
||||
ratioCheckBox->hide();
|
||||
}
|
||||
|
||||
connect( original, SIGNAL( clicked(bool) ), this, SLOT( changeSizeBox(true)) );
|
||||
connect( modify, SIGNAL( clicked(bool) ), this, SLOT( changeSizeBox(false) ) );
|
||||
|
||||
// height
|
||||
heightWidget = new QWidget;
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
QHBoxLayout *heightLineLayout = new QHBoxLayout(heightWidget);
|
||||
#else
|
||||
QHBoxLayout *heightLineLayout = new QHBoxLayout;
|
||||
#endif
|
||||
|
||||
QString tmp;
|
||||
|
||||
heightLineLayout->addWidget(new QLabel("Height",0));
|
||||
height = new QLineEdit(tmp.setNum(originalHeight),0);
|
||||
height->setMaxLength(5);
|
||||
heightLineLayout->addWidget(height);
|
||||
#if QT_VERSION >= 0x040000
|
||||
heightWidget->setLayout(heightLineLayout);
|
||||
#endif
|
||||
sizeGroupBoxLayout->addWidget(heightWidget);
|
||||
connect( height, SIGNAL( textChanged ( const QString& ) ), this, SLOT( textHeightChanged(const QString &) ) );
|
||||
|
||||
|
||||
// width
|
||||
widthWidget = new QWidget;
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
QHBoxLayout *widthLineLayout = new QHBoxLayout(widthWidget);
|
||||
#else
|
||||
QHBoxLayout *widthLineLayout = new QHBoxLayout;
|
||||
#endif
|
||||
|
||||
widthLineLayout->addWidget(new QLabel("Width ",0));
|
||||
width = new QLineEdit(tmp.setNum(originalWidth),0);
|
||||
width->setMaxLength(5);
|
||||
widthLineLayout->addWidget(width);
|
||||
#if QT_VERSION >= 0x040000
|
||||
widthWidget->setLayout(widthLineLayout);
|
||||
#endif
|
||||
sizeGroupBoxLayout->addWidget(widthWidget);
|
||||
connect( width, SIGNAL( textChanged ( const QString& ) ), this, SLOT( textWidthChanged(const QString &) ) );
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
sizeGroupBox->setLayout(sizeGroupBoxLayout);
|
||||
#endif
|
||||
globalVLayout->addWidget(sizeGroupBox);
|
||||
|
||||
heightWidget->hide();
|
||||
widthWidget->hide();
|
||||
|
||||
// button ok/cancel box
|
||||
|
||||
QGroupBox *buttonGroupBox = new QGroupBox();
|
||||
QWidget *buttonBox = new QWidget(this);
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
QHBoxLayout *buttonGroupBoxLayout = new QHBoxLayout(buttonGroupBox);
|
||||
#else
|
||||
QHBoxLayout *buttonGroupBoxLayout = new QHBoxLayout;
|
||||
#endif
|
||||
QHBoxLayout *buttonBoxLayout = new QHBoxLayout(buttonBox);
|
||||
|
||||
buttonOk = new QPushButton( tr( "&OK" ),0 );
|
||||
buttonOk = new QPushButton( tr( "&OK" ),buttonBox );
|
||||
buttonOk->setAutoDefault( TRUE );
|
||||
buttonOk->setDefault( TRUE );
|
||||
buttonGroupBoxLayout->addWidget(buttonOk);
|
||||
buttonBoxLayout->addWidget(buttonOk);
|
||||
|
||||
buttonCancel = new QPushButton( tr( "&Cancel" ),0 );
|
||||
buttonCancel = new QPushButton( tr( "&Cancel" ),buttonBox );
|
||||
buttonCancel->setAutoDefault( TRUE );
|
||||
buttonGroupBoxLayout->addWidget(buttonCancel);
|
||||
buttonBoxLayout->addWidget(buttonCancel);
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
buttonGroupBox->setLayout(buttonGroupBoxLayout);
|
||||
buttonBox->setLayout(buttonBoxLayout);
|
||||
#endif
|
||||
globalVLayout->addWidget(buttonGroupBox);
|
||||
globalVLayout->addWidget(buttonBox);
|
||||
|
||||
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
@@ -306,17 +355,17 @@ int G4OpenGLQtExportDialog::getSliderValue()
|
||||
|
||||
int G4OpenGLQtExportDialog::getHeight()
|
||||
{
|
||||
if (!height) return -1;
|
||||
if (!height) return originalHeight;
|
||||
return height->text().toInt();
|
||||
}
|
||||
|
||||
int G4OpenGLQtExportDialog::getWidth()
|
||||
{
|
||||
if (!width) return -1;
|
||||
if (!width) return originalWidth;
|
||||
return width->text().toInt();
|
||||
}
|
||||
|
||||
bool G4OpenGLQtExportDialog::getTransparency()
|
||||
int G4OpenGLQtExportDialog::getTransparency()
|
||||
{
|
||||
if (!boxTransparency) return -1;
|
||||
return boxTransparency->isChecked();
|
||||
@@ -324,6 +373,7 @@ bool G4OpenGLQtExportDialog::getTransparency()
|
||||
|
||||
int G4OpenGLQtExportDialog::getNbColor()
|
||||
{
|
||||
if (!colorButton) return -1;
|
||||
// Black and white
|
||||
if (!colorButton->isChecked())
|
||||
return 1;
|
||||
@@ -331,32 +381,89 @@ int G4OpenGLQtExportDialog::getNbColor()
|
||||
return 3;
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLQtExportDialog::changeSizeBox(bool aClick)
|
||||
bool G4OpenGLQtExportDialog::getVectorEPS()
|
||||
{
|
||||
if (aClick) {
|
||||
modify->toggle();
|
||||
if (!vectorEPSCheckBox) return 0;
|
||||
return vectorEPSCheckBox->isChecked();
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLQtExportDialog::changeVectorEPS()
|
||||
{
|
||||
if (!vectorEPSCheckBox) return;
|
||||
if (vectorEPSCheckBox->isChecked()) {
|
||||
#if QT_VERSION < 0x040000
|
||||
original->setEnabled ( true );
|
||||
modify->setEnabled ( true );
|
||||
#else
|
||||
sizeGroupBox->show();
|
||||
original->show();
|
||||
modify->show();
|
||||
#endif
|
||||
changeSizeBox();
|
||||
} else {
|
||||
original->toggle();
|
||||
}
|
||||
if ( original->isChecked()) {
|
||||
#if QT_VERSION < 0x040000
|
||||
original->setEnabled ( false );
|
||||
modify->setEnabled ( false );
|
||||
ratioCheckBox->setEnabled ( false );
|
||||
heightWidget->setEnabled ( false );
|
||||
widthWidget->setEnabled ( false );
|
||||
#else
|
||||
sizeGroupBox->hide();
|
||||
original->hide();
|
||||
modify->hide();
|
||||
ratioCheckBox->hide();
|
||||
heightWidget->hide();
|
||||
widthWidget->hide();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLQtExportDialog::changeSizeBox()
|
||||
{
|
||||
if (!original) return;
|
||||
if (!heightWidget) return;
|
||||
if (!widthWidget) return;
|
||||
if (!ratioCheckBox) return;
|
||||
|
||||
if ( original->isChecked()) {
|
||||
#if QT_VERSION < 0x040000
|
||||
ratioCheckBox->setEnabled ( false );
|
||||
heightWidget->setEnabled ( false );
|
||||
widthWidget->setEnabled ( false );
|
||||
#else
|
||||
ratioCheckBox->hide();
|
||||
heightWidget->hide();
|
||||
widthWidget->hide();
|
||||
#endif
|
||||
} else {
|
||||
#if QT_VERSION < 0x040000
|
||||
ratioCheckBox->setEnabled ( true );
|
||||
heightWidget->setEnabled ( true );
|
||||
widthWidget->setEnabled ( true );
|
||||
#else
|
||||
heightWidget->show();
|
||||
widthWidget->show();
|
||||
ratioCheckBox->show();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLQtExportDialog::textWidthChanged(
|
||||
const QString & s
|
||||
)
|
||||
{
|
||||
if (!ratioCheckBox) return;
|
||||
if (!width) return;
|
||||
if (isChangingSize == true) return; // exclusive slot
|
||||
|
||||
if (ratioCheckBox->isChecked()){
|
||||
isChangingSize = true;
|
||||
QString tmp;
|
||||
width->setText(tmp.setNum(s.toInt()*originalHeight/originalHeight));
|
||||
height->setText(tmp.setNum((int)(s.toInt()*(double)((double)originalHeight/(double)originalWidth))));
|
||||
isChangingSize = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,9 +471,15 @@ void G4OpenGLQtExportDialog:: textHeightChanged(
|
||||
const QString & s
|
||||
)
|
||||
{
|
||||
if (!ratioCheckBox) return;
|
||||
if (!width) return;
|
||||
if (isChangingSize == true) return; // exclusive slot
|
||||
|
||||
if (ratioCheckBox->isChecked()){
|
||||
isChangingSize = true;
|
||||
QString tmp;
|
||||
width->setText(tmp.setNum(s.toInt()*originalWidth/originalWidth));
|
||||
width->setText(tmp.setNum(s.toInt()*originalWidth/originalHeight));
|
||||
isChangingSize = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,206 +0,0 @@
|
||||
/****************************************************************************
|
||||
** G4OpenGLQtExportDialog meta object code from reading C++ file 'G4OpenGLQtExportDialog.hh'
|
||||
**
|
||||
** Created: Mon Nov 12 10:36:59 2007
|
||||
** by: The Qt MOC ($Id: G4OpenGLQtExportDialog_moc.cc,v 1.5 2007/11/14 11:49:00 lgarnier Exp $)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef G4VIS_BUILD_OPENGLQT_DRIVER
|
||||
|
||||
#undef QT_NO_COMPAT
|
||||
#include "../include/G4OpenGLQtExportDialog.hh"
|
||||
#include <qmetaobject.h>
|
||||
#include <qapplication.h>
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
|
||||
#include <private/qucomextra_p.h>
|
||||
#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
|
||||
#error "This file was generated using the moc from 3.3.5. It"
|
||||
#error "cannot be used with the include files from this version of Qt."
|
||||
#error "(The moc has changed too much.)"
|
||||
#endif
|
||||
|
||||
const char *G4OpenGLQtExportDialog::className() const
|
||||
{
|
||||
return "G4OpenGLQtExportDialog";
|
||||
}
|
||||
|
||||
QMetaObject *G4OpenGLQtExportDialog::metaObj = 0;
|
||||
static QMetaObjectCleanUp cleanUp_G4OpenGLQtExportDialog( "G4OpenGLQtExportDialog", &G4OpenGLQtExportDialog::staticMetaObject );
|
||||
|
||||
#ifndef QT_NO_TRANSLATION
|
||||
QString G4OpenGLQtExportDialog::tr( const char *s, const char *c )
|
||||
{
|
||||
if ( qApp )
|
||||
return qApp->translate( "G4OpenGLQtExportDialog", s, c, QApplication::DefaultCodec );
|
||||
else
|
||||
return QString::fromLatin1( s );
|
||||
}
|
||||
#ifndef QT_NO_TRANSLATION_UTF8
|
||||
QString G4OpenGLQtExportDialog::trUtf8( const char *s, const char *c )
|
||||
{
|
||||
if ( qApp )
|
||||
return qApp->translate( "G4OpenGLQtExportDialog", s, c, QApplication::UnicodeUTF8 );
|
||||
else
|
||||
return QString::fromUtf8( s );
|
||||
}
|
||||
#endif // QT_NO_TRANSLATION_UTF8
|
||||
|
||||
#endif // QT_NO_TRANSLATION
|
||||
|
||||
QMetaObject* G4OpenGLQtExportDialog::staticMetaObject()
|
||||
{
|
||||
if ( metaObj )
|
||||
return metaObj;
|
||||
QMetaObject* parentObject = QDialog::staticMetaObject();
|
||||
static const QUParameter param_slot_0[] = {
|
||||
{ 0, &static_QUType_bool, 0, QUParameter::In }
|
||||
};
|
||||
static const QUMethod slot_0 = {"changeSizeBox", 1, param_slot_0 };
|
||||
static const QUParameter param_slot_1[] = {
|
||||
{ 0, &static_QUType_QString, 0, QUParameter::In }
|
||||
};
|
||||
static const QUMethod slot_1 = {"textWidthChanged", 1, param_slot_1 };
|
||||
static const QUParameter param_slot_2[] = {
|
||||
{ 0, &static_QUType_QString, 0, QUParameter::In }
|
||||
};
|
||||
static const QUMethod slot_2 = {"textHeightChanged", 1, param_slot_2 };
|
||||
static const QMetaData slot_tbl[] = {
|
||||
{ "changeSizeBox(bool)", &slot_0, QMetaData::Public },
|
||||
{ "textWidthChanged(const QString&)", &slot_1, QMetaData::Public },
|
||||
{ "textHeightChanged(const QString&)", &slot_2, QMetaData::Public }
|
||||
};
|
||||
metaObj = QMetaObject::new_metaobject(
|
||||
"G4OpenGLQtExportDialog", parentObject,
|
||||
slot_tbl, 3,
|
||||
0, 0,
|
||||
#ifndef QT_NO_PROPERTIES
|
||||
0, 0,
|
||||
0, 0,
|
||||
#endif // QT_NO_PROPERTIES
|
||||
0, 0 );
|
||||
cleanUp_G4OpenGLQtExportDialog.setMetaObject( metaObj );
|
||||
return metaObj;
|
||||
}
|
||||
|
||||
void* G4OpenGLQtExportDialog::qt_cast( const char* clname )
|
||||
{
|
||||
if ( !qstrcmp( clname, "G4OpenGLQtExportDialog" ) )
|
||||
return this;
|
||||
return QDialog::qt_cast( clname );
|
||||
}
|
||||
|
||||
bool G4OpenGLQtExportDialog::qt_invoke( int _id, QUObject* _o )
|
||||
{
|
||||
switch ( _id - staticMetaObject()->slotOffset() ) {
|
||||
case 0: changeSizeBox((bool)static_QUType_bool.get(_o+1)); break;
|
||||
case 1: textWidthChanged((const QString&)static_QUType_QString.get(_o+1)); break;
|
||||
case 2: textHeightChanged((const QString&)static_QUType_QString.get(_o+1)); break;
|
||||
default:
|
||||
return QDialog::qt_invoke( _id, _o );
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool G4OpenGLQtExportDialog::qt_emit( int _id, QUObject* _o )
|
||||
{
|
||||
return QDialog::qt_emit(_id,_o);
|
||||
}
|
||||
#ifndef QT_NO_PROPERTIES
|
||||
|
||||
bool G4OpenGLQtExportDialog::qt_property( int id, int f, QVariant* v)
|
||||
{
|
||||
return QDialog::qt_property( id, f, v);
|
||||
}
|
||||
|
||||
bool G4OpenGLQtExportDialog::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
|
||||
#endif // QT_NO_PROPERTIES
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
** Meta object code from reading C++ file 'G4OpenGLQtExportDialog.hh'
|
||||
**
|
||||
** Created: Fri Sep 28 12:35:41 2007
|
||||
** by: The Qt Meta Object Compiler version 59 (Qt 4.2.2)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
*****************************************************************************/
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
|
||||
#ifdef G4VIS_BUILD_OPENGLQT_DRIVER
|
||||
|
||||
#include "../include/G4OpenGLQtExportDialog.hh"
|
||||
#if !defined(Q_MOC_OUTPUT_REVISION)
|
||||
#error "The header file 'G4OpenGLQtExportDialog.hh' doesn't include <QObject>."
|
||||
#elif Q_MOC_OUTPUT_REVISION != 59
|
||||
#error "This file was generated using the moc from 4.2.2. It"
|
||||
#error "cannot be used with the include files from this version of Qt."
|
||||
#error "(The moc has changed too much.)"
|
||||
#endif
|
||||
|
||||
static const uint qt_meta_data_G4OpenGLQtExportDialog[] = {
|
||||
|
||||
// content:
|
||||
1, // revision
|
||||
0, // classname
|
||||
0, 0, // classinfo
|
||||
3, 10, // methods
|
||||
0, 0, // properties
|
||||
0, 0, // enums/sets
|
||||
|
||||
// slots: signature, parameters, type, tag, flags
|
||||
23, 43, 43, 43, 0x0a,
|
||||
44, 43, 43, 43, 0x0a,
|
||||
70, 43, 43, 43, 0x0a,
|
||||
|
||||
0 // eod
|
||||
};
|
||||
|
||||
static const char qt_meta_stringdata_G4OpenGLQtExportDialog[] = {
|
||||
"G4OpenGLQtExportDialog\0changeSizeBox(bool)\0"
|
||||
"\0textWidthChanged(QString)\0"
|
||||
"textHeightChanged(QString)\0"
|
||||
};
|
||||
|
||||
const QMetaObject G4OpenGLQtExportDialog::staticMetaObject = {
|
||||
{ &QDialog::staticMetaObject, qt_meta_stringdata_G4OpenGLQtExportDialog,
|
||||
qt_meta_data_G4OpenGLQtExportDialog, 0 }
|
||||
};
|
||||
|
||||
const QMetaObject *G4OpenGLQtExportDialog::metaObject() const
|
||||
{
|
||||
return &staticMetaObject;
|
||||
}
|
||||
|
||||
void *G4OpenGLQtExportDialog::qt_metacast(const char *_clname)
|
||||
{
|
||||
if (!_clname) return 0;
|
||||
if (!strcmp(_clname, qt_meta_stringdata_G4OpenGLQtExportDialog))
|
||||
return static_cast<void*>(const_cast<G4OpenGLQtExportDialog*>(this));
|
||||
return QDialog::qt_metacast(_clname);
|
||||
}
|
||||
|
||||
int G4OpenGLQtExportDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
_id = QDialog::qt_metacall(_c, _id, _a);
|
||||
if (_id < 0)
|
||||
return _id;
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
switch (_id) {
|
||||
case 0: changeSizeBox((*reinterpret_cast< bool(*)>(_a[1]))); break;
|
||||
case 1: textWidthChanged((*reinterpret_cast< const QString(*)>(_a[1]))); break;
|
||||
case 2: textHeightChanged((*reinterpret_cast< const QString(*)>(_a[1]))); break;
|
||||
}
|
||||
_id -= 3;
|
||||
}
|
||||
return _id;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,594 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenGLQtMovieDialog.cc,v 1.8 2008/10/24 13:49:19 lgarnier Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
|
||||
#ifdef G4VIS_BUILD_OPENGLQT_DRIVER
|
||||
|
||||
#include "G4OpenGLQtMovieDialog.hh"
|
||||
#include "G4OpenGLQtViewer.hh"
|
||||
|
||||
#include <qpushbutton.h>
|
||||
#include <qpalette.h>
|
||||
#include <qlabel.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qlayout.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qfiledialog.h>
|
||||
#include <qprocess.h>
|
||||
|
||||
|
||||
// +---------------------------------------+
|
||||
// + Path for encoder +
|
||||
// + _______ +
|
||||
// + | select| ____________________ +
|
||||
// + ------- +
|
||||
// + Temp path +
|
||||
// + _______ +
|
||||
// + | select| ____________________ +
|
||||
// + ------- +
|
||||
// + +
|
||||
// + max number of frames ________ +
|
||||
// + .... +
|
||||
// + +
|
||||
// + Label : X frames Saves/Encoding +
|
||||
// + Cancel Encode +
|
||||
// +---------------------------------------+
|
||||
|
||||
G4OpenGLQtMovieDialog::G4OpenGLQtMovieDialog(
|
||||
G4OpenGLQtViewer* parentViewer,
|
||||
QWidget* parentWidget
|
||||
)
|
||||
: QDialog( parentWidget ),
|
||||
fParentViewer(parentViewer)
|
||||
{
|
||||
#if QT_VERSION > 0x030200
|
||||
setModal(false);
|
||||
#endif
|
||||
#if QT_VERSION < 0x040000
|
||||
setCaption( tr( " Movie parameters" ));
|
||||
#else
|
||||
setWindowTitle( tr( " Movie parameters" ));
|
||||
#endif
|
||||
|
||||
|
||||
// global layout
|
||||
QVBoxLayout* globalVLayout = new QVBoxLayout(this);
|
||||
globalVLayout->setMargin(10);
|
||||
globalVLayout->setSpacing(10);
|
||||
|
||||
// Encoder group box
|
||||
QGroupBox *encoderGroupBox = new QGroupBox(tr("Encoder path"),this);
|
||||
QVBoxLayout *encoderVGroupBoxLayout = new QVBoxLayout(encoderGroupBox);
|
||||
|
||||
// Encoder Path
|
||||
QWidget *encoderHBox = new QWidget(encoderGroupBox);
|
||||
QHBoxLayout *encoderHBoxLayout = new QHBoxLayout(encoderHBox);
|
||||
fEncoderPath = new QLineEdit("",encoderHBox);
|
||||
|
||||
QPushButton *encoderButton = new QPushButton(tr("..."),encoderHBox);
|
||||
encoderButton->setMaximumWidth (30);
|
||||
|
||||
fEncoderStatus = new QLabel(encoderGroupBox);
|
||||
|
||||
#if QT_VERSION > 0x040000
|
||||
fEncoderStatus->setWordWrap(true);
|
||||
encoderVGroupBoxLayout->setMargin(15);
|
||||
#else
|
||||
fEncoderStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak );
|
||||
encoderGroupBox->setInsideMargin(15);
|
||||
#endif
|
||||
|
||||
fEncoderStatus->setText("");
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
encoderHBoxLayout->add(fEncoderPath);
|
||||
encoderHBoxLayout->add(encoderButton);
|
||||
encoderVGroupBoxLayout->add(encoderHBox);
|
||||
encoderVGroupBoxLayout->add(fEncoderStatus);
|
||||
|
||||
globalVLayout->add(encoderGroupBox);
|
||||
#else
|
||||
encoderHBoxLayout->addWidget(fEncoderPath);
|
||||
encoderHBoxLayout->addWidget(encoderButton);
|
||||
encoderVGroupBoxLayout->addWidget(encoderHBox);
|
||||
encoderVGroupBoxLayout->addWidget(fEncoderStatus);
|
||||
|
||||
encoderGroupBox->setLayout(encoderVGroupBoxLayout);
|
||||
globalVLayout->addWidget(encoderGroupBox);
|
||||
#endif
|
||||
|
||||
connect( encoderButton, SIGNAL( clicked( ) ), this, SLOT(selectEncoderPathAction() ) );
|
||||
|
||||
|
||||
// temp folder group box
|
||||
QGroupBox *tempFolderGroupBox = new QGroupBox(tr("Temporary folder path"),this);
|
||||
QVBoxLayout *tempFolderVGroupBoxLayout = new QVBoxLayout(tempFolderGroupBox);
|
||||
|
||||
// temp folder Path
|
||||
QWidget *tempFolderHBox = new QWidget(tempFolderGroupBox);
|
||||
QHBoxLayout *tempFolderHBoxLayout = new QHBoxLayout(tempFolderHBox);
|
||||
|
||||
fTempFolderPath = new QLineEdit("",tempFolderHBox);
|
||||
|
||||
QPushButton *tempButton = new QPushButton(tr("..."),tempFolderHBox);
|
||||
tempButton->setMaximumWidth (30);
|
||||
|
||||
fTempFolderStatus = new QLabel(tempFolderGroupBox);
|
||||
#if QT_VERSION > 0x040000
|
||||
fTempFolderStatus->setWordWrap(true);
|
||||
tempFolderVGroupBoxLayout->setMargin(15);
|
||||
#else
|
||||
fTempFolderStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak );
|
||||
tempFolderGroupBox->setInsideMargin(15);
|
||||
#endif
|
||||
fTempFolderStatus->setText("");
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
tempFolderHBoxLayout->add(fTempFolderPath);
|
||||
tempFolderHBoxLayout->add(tempButton);
|
||||
tempFolderVGroupBoxLayout->add(tempFolderHBox);
|
||||
tempFolderVGroupBoxLayout->add(fTempFolderStatus);
|
||||
|
||||
globalVLayout->add(tempFolderGroupBox);
|
||||
#else
|
||||
tempFolderHBoxLayout->addWidget(fTempFolderPath);
|
||||
tempFolderHBoxLayout->addWidget(tempButton);
|
||||
tempFolderVGroupBoxLayout->addWidget(tempFolderHBox);
|
||||
tempFolderVGroupBoxLayout->addWidget(fTempFolderStatus);
|
||||
|
||||
tempFolderGroupBox->setLayout(tempFolderVGroupBoxLayout);
|
||||
globalVLayout->addWidget(tempFolderGroupBox);
|
||||
#endif
|
||||
|
||||
connect( tempButton, SIGNAL( clicked( ) ), this, SLOT(selectTempPathAction() ) );
|
||||
|
||||
|
||||
|
||||
|
||||
// save file group box
|
||||
QGroupBox *saveFileGroupBox = new QGroupBox(tr("Save as"),this);
|
||||
QVBoxLayout *saveFileVGroupBoxLayout = new QVBoxLayout(saveFileGroupBox);
|
||||
|
||||
// save file
|
||||
QWidget *saveFileHBox = new QWidget(saveFileGroupBox);
|
||||
QHBoxLayout *saveFileHBoxLayout = new QHBoxLayout(saveFileHBox);
|
||||
|
||||
fSaveFileName = new QLineEdit("G4Movie.mpeg",saveFileHBox);
|
||||
|
||||
QPushButton *saveButton = new QPushButton(tr("..."),saveFileHBox);
|
||||
saveButton->setMaximumWidth (30);
|
||||
|
||||
fSaveFileStatus = new QLabel(saveFileGroupBox);
|
||||
#if QT_VERSION > 0x040000
|
||||
fSaveFileStatus->setWordWrap(true);
|
||||
saveFileVGroupBoxLayout->setMargin(15);
|
||||
#else
|
||||
fSaveFileStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak );
|
||||
saveFileGroupBox->setInsideMargin(15);
|
||||
#endif
|
||||
fSaveFileStatus->setText("");
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
saveFileHBoxLayout->add(fSaveFileName);
|
||||
saveFileHBoxLayout->add(saveButton);
|
||||
saveFileVGroupBoxLayout->add(saveFileHBox);
|
||||
saveFileVGroupBoxLayout->add(fSaveFileStatus);
|
||||
|
||||
globalVLayout->add(saveFileGroupBox);
|
||||
#else
|
||||
saveFileHBoxLayout->addWidget(fSaveFileName);
|
||||
saveFileHBoxLayout->addWidget(saveButton);
|
||||
saveFileVGroupBoxLayout->addWidget(saveFileHBox);
|
||||
saveFileVGroupBoxLayout->addWidget(fSaveFileStatus);
|
||||
|
||||
saveFileGroupBox->setLayout(saveFileVGroupBoxLayout);
|
||||
globalVLayout->addWidget(saveFileGroupBox);
|
||||
#endif
|
||||
|
||||
connect( saveButton, SIGNAL( clicked( ) ), this, SLOT(selectSaveFileNameAction() ) );
|
||||
|
||||
|
||||
|
||||
// label
|
||||
|
||||
QLabel *infoLabel = new QLabel(" Press SPACE to Start/Pause video recording \n Press RETURN to Stop video recording",this);
|
||||
|
||||
// global status
|
||||
QGroupBox *statusGroupBox = new QGroupBox(tr("Status"),this);
|
||||
QVBoxLayout *statusVGroupBoxLayout = new QVBoxLayout(statusGroupBox);
|
||||
|
||||
fRecordingStatus = new QLabel(statusGroupBox);
|
||||
#if QT_VERSION > 0x040000
|
||||
statusVGroupBoxLayout->setMargin(15);
|
||||
fRecordingStatus->setWordWrap(true);
|
||||
#else
|
||||
statusGroupBox->setInsideMargin(15);
|
||||
fRecordingStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak );
|
||||
#endif
|
||||
QPalette palette( fRecordingStatus->palette() );
|
||||
#if QT_VERSION > 0x040000
|
||||
palette.setColor( QPalette::Text, Qt::green);
|
||||
#else
|
||||
palette.setColor( QColorGroup::Text, Qt::green);
|
||||
#endif
|
||||
fRecordingStatus->setPalette(palette);
|
||||
|
||||
fRecordingInfos = new QLabel(statusGroupBox);
|
||||
#if QT_VERSION > 0x040000
|
||||
fRecordingInfos->setWordWrap(true);
|
||||
#else
|
||||
fRecordingInfos->setAlignment ( Qt::AlignAuto |Qt::WordBreak );
|
||||
#endif
|
||||
setRecordingInfos("");
|
||||
|
||||
#if QT_VERSION < 0x040000
|
||||
statusVGroupBoxLayout->add(fRecordingStatus);
|
||||
statusVGroupBoxLayout->add(fRecordingInfos);
|
||||
|
||||
globalVLayout->add(infoLabel);
|
||||
globalVLayout->add(statusGroupBox);
|
||||
#else
|
||||
statusVGroupBoxLayout->addWidget(fRecordingStatus);
|
||||
statusVGroupBoxLayout->addWidget(fRecordingInfos);
|
||||
|
||||
statusGroupBox->setLayout(statusVGroupBoxLayout);
|
||||
globalVLayout->addWidget(infoLabel);
|
||||
globalVLayout->addWidget(statusGroupBox);
|
||||
#endif
|
||||
|
||||
// buttons
|
||||
QWidget *buttonBox = new QWidget(this);
|
||||
|
||||
QHBoxLayout *buttonBoxLayout = new QHBoxLayout(buttonBox);
|
||||
|
||||
QPushButton *buttonReset = new QPushButton( tr( "&Reset" ),buttonBox );
|
||||
buttonReset->setAutoDefault( TRUE );
|
||||
buttonBoxLayout->addWidget(buttonReset);
|
||||
|
||||
fButtonStartPause = new QPushButton( tr( " &Start " ),buttonBox );
|
||||
fButtonStartPause->setEnabled(true);
|
||||
fButtonStartPause->setAutoDefault( TRUE );
|
||||
buttonBoxLayout->addWidget(fButtonStartPause);
|
||||
|
||||
fButtonStopFinishClose = new QPushButton( tr( "&Stop" ),buttonBox );
|
||||
fButtonStopFinishClose->setEnabled(false);
|
||||
fButtonStopFinishClose->setAutoDefault( TRUE );
|
||||
buttonBoxLayout->addWidget(fButtonStopFinishClose);
|
||||
|
||||
fButtonSave = new QPushButton( tr( "&Save" ),buttonBox );
|
||||
fButtonSave->setEnabled(false);
|
||||
fButtonSave->setAutoDefault( TRUE );
|
||||
buttonBoxLayout->addWidget(fButtonSave);
|
||||
|
||||
QPushButton *buttonCancel = new QPushButton( tr( "&Cancel" ),buttonBox );
|
||||
buttonCancel->setAutoDefault( TRUE );
|
||||
buttonBoxLayout->addWidget(buttonCancel);
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
buttonBox->setLayout(buttonBoxLayout);
|
||||
#endif
|
||||
globalVLayout->addWidget(buttonBox);
|
||||
|
||||
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
setLayout(globalVLayout);
|
||||
#endif
|
||||
|
||||
// signals and slots connections
|
||||
connect( fButtonStartPause, SIGNAL( clicked() ), fParentViewer, SLOT( startPauseVideo() ) );
|
||||
connect( buttonReset, SIGNAL( clicked() ), this, SLOT( resetRecording() ) );
|
||||
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
|
||||
connect( fButtonStopFinishClose, SIGNAL( clicked() ), this, SLOT( stopFinishClose() ) );
|
||||
connect( fButtonSave, SIGNAL( clicked() ), this, SLOT( save() ) );
|
||||
|
||||
// fill
|
||||
setRecordingStatus("");
|
||||
fEncoderPath->setText(fParentViewer->getEncoderPath());
|
||||
fTempFolderPath->setText(fParentViewer->getTempFolderPath());
|
||||
|
||||
// connect line edit signals
|
||||
connect (fEncoderPath,SIGNAL(textChanged ( const QString&)),this,SLOT(checkEncoderSwParameters()));
|
||||
connect (fTempFolderPath,SIGNAL(textChanged ( const QString&)),this,SLOT(checkTempFolderParameters()));
|
||||
connect (fSaveFileName,SIGNAL(textChanged ( const QString&)),this,SLOT(checkSaveFileNameParameters()));
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
connect (fEncoderPath,SIGNAL(editingFinished ()),this,SLOT(checkEncoderSwParameters()));
|
||||
connect (fTempFolderPath,SIGNAL(editingFinished ()),this,SLOT(checkTempFolderParameters()));
|
||||
connect (fSaveFileName,SIGNAL(editingFinished ()),this,SLOT(checkSaveFileNameParameters()));
|
||||
#else
|
||||
connect (fEncoderPath,SIGNAL(lostFocus ()),this,SLOT(checkEncoderSwParameters()));
|
||||
connect (fTempFolderPath,SIGNAL(lostFocus ()),this,SLOT(checkTempFolderParameters()));
|
||||
connect (fSaveFileName,SIGNAL(lostFocus ()),this,SLOT(checkSaveFileNameParameters()));
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
G4OpenGLQtMovieDialog::~G4OpenGLQtMovieDialog()
|
||||
{
|
||||
}
|
||||
|
||||
void G4OpenGLQtMovieDialog::selectEncoderPathAction()
|
||||
{
|
||||
#if QT_VERSION < 0x040000
|
||||
QString nomFich = QFileDialog::getOpenFileName ( ".",
|
||||
NULL,
|
||||
this,
|
||||
"Select your encoder",
|
||||
tr("Select your encoder ..."));
|
||||
#else
|
||||
QString nomFich = QFileDialog::getOpenFileName ( this,
|
||||
"Select your encoder",
|
||||
tr("Select your encoder ..."));
|
||||
|
||||
#endif
|
||||
|
||||
if (nomFich == "") {
|
||||
return;
|
||||
}
|
||||
fEncoderPath->setText(nomFich);
|
||||
checkEncoderSwParameters();
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLQtMovieDialog::selectTempPathAction()
|
||||
{
|
||||
#if QT_VERSION < 0x040000
|
||||
QString nomFich = QFileDialog::getExistingDirectory (NULL,
|
||||
this,
|
||||
"Select temporary folder",
|
||||
tr("Select temporary folder ..."));
|
||||
#else
|
||||
QString nomFich = QFileDialog::getExistingDirectory ( this,
|
||||
"Select temporary folder",
|
||||
tr("Select temporary folder ..."));
|
||||
|
||||
#endif
|
||||
if (nomFich == "") {
|
||||
return;
|
||||
}
|
||||
fTempFolderPath->setText(nomFich);
|
||||
checkTempFolderParameters();
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLQtMovieDialog::selectSaveFileNameAction()
|
||||
{
|
||||
#if QT_VERSION < 0x040000
|
||||
QString nomFich = QFileDialog::getSaveFileName ( ".",
|
||||
NULL,
|
||||
this,
|
||||
"Select saved file",
|
||||
tr("Select saved file ..."));
|
||||
#else
|
||||
QString nomFich = QFileDialog::getSaveFileName ( this,
|
||||
"Select saved file",
|
||||
tr("Select saved file ..."));
|
||||
|
||||
#endif
|
||||
if (nomFich == "") {
|
||||
return;
|
||||
}
|
||||
fSaveFileName->setText(nomFich);
|
||||
checkSaveFileNameParameters();
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLQtMovieDialog::stopFinishClose() {
|
||||
fParentViewer->stopVideo();
|
||||
}
|
||||
|
||||
void G4OpenGLQtMovieDialog::save() {
|
||||
if (((fParentViewer->isPaused()) || fParentViewer->isRecording() || fParentViewer->isStopped())) {
|
||||
fParentViewer->saveVideo();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If one of parameter is incorrect, put it in red and don't valid it
|
||||
* If valid, save it
|
||||
*/
|
||||
bool G4OpenGLQtMovieDialog::checkEncoderSwParameters() {
|
||||
|
||||
bool status = true;
|
||||
QPalette palette( fEncoderPath->palette() );
|
||||
|
||||
QString temp = fParentViewer->setEncoderPath(fEncoderPath->text());
|
||||
setRecordingInfos("");
|
||||
fEncoderStatus->setText(temp);
|
||||
if (temp != "") {
|
||||
#if QT_VERSION > 0x040000
|
||||
palette.setColor( QPalette::Base, Qt::red);
|
||||
#else
|
||||
palette.setColor( QColorGroup::Base, Qt::red);
|
||||
#endif
|
||||
if (fParentViewer->isReadyToEncode()) {
|
||||
setRecordingInfos("No valid encode defined, screen capture had been saved in the temp folder in ppm format.\nPlease define a encoder and clic on Apply button");
|
||||
}
|
||||
status = false;
|
||||
} else {
|
||||
#if QT_VERSION > 0x040000
|
||||
palette.setColor( QPalette::Base, Qt::white);
|
||||
#else
|
||||
palette.setColor( QColorGroup::Base, Qt::white);
|
||||
#endif
|
||||
fEncoderPath->setText(fParentViewer->getEncoderPath());
|
||||
}
|
||||
fEncoderPath->setPalette(palette);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If one of parameter is incorrect, put it in red and don't valid it
|
||||
* If valid, save it
|
||||
*/
|
||||
bool G4OpenGLQtMovieDialog::checkTempFolderParameters() {
|
||||
|
||||
bool status = true;
|
||||
QPalette palette( fTempFolderPath->palette() );
|
||||
|
||||
QString temp = fParentViewer->setTempFolderPath(fTempFolderPath->text());
|
||||
fTempFolderStatus->setText(temp);
|
||||
if (temp != "") {
|
||||
#if QT_VERSION > 0x040000
|
||||
palette.setColor( QPalette::Base, Qt::red);
|
||||
#else
|
||||
palette.setColor( QColorGroup::Base, Qt::red);
|
||||
#endif
|
||||
status = false;
|
||||
} else {
|
||||
#if QT_VERSION > 0x040000
|
||||
palette.setColor( QPalette::Base, Qt::white);
|
||||
#else
|
||||
palette.setColor( QColorGroup::Base, Qt::white);
|
||||
#endif
|
||||
fTempFolderPath->setText(fParentViewer->getTempFolderPath());
|
||||
}
|
||||
fTempFolderPath->setPalette(palette);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If one of parameter is incorrect, put it in red and don't valid it
|
||||
* If valid, save it
|
||||
*/
|
||||
bool G4OpenGLQtMovieDialog::checkSaveFileNameParameters() {
|
||||
|
||||
bool status = true;
|
||||
QPalette palette( fSaveFileName->palette() );
|
||||
|
||||
QString temp = fParentViewer->setSaveFileName(fSaveFileName->text());
|
||||
fSaveFileStatus->setText(temp);
|
||||
if (temp != "") {
|
||||
#if QT_VERSION > 0x040000
|
||||
palette.setColor( QPalette::Base, Qt::red);
|
||||
#else
|
||||
palette.setColor( QColorGroup::Base, Qt::red);
|
||||
#endif
|
||||
status = false;
|
||||
} else {
|
||||
#if QT_VERSION > 0x040000
|
||||
palette.setColor( QPalette::Base, Qt::white);
|
||||
#else
|
||||
palette.setColor( QColorGroup::Base, Qt::white);
|
||||
#endif
|
||||
fSaveFileName->setText(fParentViewer->getSaveFileName());
|
||||
}
|
||||
fSaveFileName->setPalette(palette);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLQtMovieDialog::resetRecording() {
|
||||
fParentViewer->resetRecording();
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLQtMovieDialog::setRecordingStatus(QString txt) {
|
||||
fRecordingStatus->setText(txt);
|
||||
if (fParentViewer->isWaiting()) {
|
||||
fButtonStartPause->setText(" &Start ");
|
||||
fButtonStartPause->setEnabled(true);
|
||||
fButtonStopFinishClose->setEnabled(false);
|
||||
fButtonSave->setEnabled(false);
|
||||
|
||||
} else if (fParentViewer->isPaused()) {
|
||||
|
||||
fButtonStartPause->setText(" &Continue ");
|
||||
fButtonStartPause->setEnabled(true);
|
||||
fButtonStopFinishClose->setEnabled(true);
|
||||
fButtonSave->setEnabled(false);
|
||||
|
||||
} else if (fParentViewer->isRecording()) {
|
||||
|
||||
fButtonStartPause->setText(" &Pause ");
|
||||
fButtonStartPause->setEnabled(true);
|
||||
fButtonStopFinishClose->setEnabled(true);
|
||||
fButtonSave->setEnabled(false);
|
||||
|
||||
} else if (fParentViewer->isBadOutput()) {
|
||||
|
||||
fButtonStartPause->setText(" &Start ");
|
||||
fButtonStartPause->setEnabled(true);
|
||||
fButtonStopFinishClose->setEnabled(false);
|
||||
fButtonSave->setEnabled(false);
|
||||
|
||||
} else if (fParentViewer->isBadTmp()) {
|
||||
|
||||
fButtonStartPause->setText(" &Start ");
|
||||
fButtonStartPause->setEnabled(false);
|
||||
fButtonStopFinishClose->setEnabled(false);
|
||||
fButtonSave->setEnabled(false);
|
||||
|
||||
} else if (fParentViewer->isBadEncoder()) {
|
||||
|
||||
fButtonStartPause->setText(" &Start ");
|
||||
fButtonStartPause->setEnabled(true);
|
||||
fButtonStopFinishClose->setEnabled(false);
|
||||
fButtonSave->setEnabled(false);
|
||||
|
||||
} else if (fParentViewer->isSuccess()) {
|
||||
|
||||
fButtonStartPause->setText(" &Start ");
|
||||
fButtonStartPause->setEnabled(false);
|
||||
fButtonStopFinishClose->setEnabled(false);
|
||||
fButtonSave->setEnabled(false);
|
||||
|
||||
} else if (fParentViewer->isFailed()) {
|
||||
|
||||
fButtonStartPause->setText(" &Start ");
|
||||
fButtonStartPause->setEnabled(false);
|
||||
fButtonStopFinishClose->setEnabled(false);
|
||||
fButtonSave->setEnabled(false);
|
||||
|
||||
} else if (fParentViewer->isStopped()) {
|
||||
|
||||
fButtonStartPause->setText(" &Start ");
|
||||
fButtonStartPause->setEnabled(false);
|
||||
fButtonStopFinishClose->setEnabled(false);
|
||||
fButtonSave->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLQtMovieDialog::setRecordingInfos(QString txt) {
|
||||
fRecordingInfos->setText(txt);
|
||||
}
|
||||
|
||||
|
||||
void G4OpenGLQtMovieDialog::enabledApplyButton() {
|
||||
fButtonStartPause->setEnabled(true);
|
||||
}
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user