Import Geant4 0.0.0 source tree
@@ -0,0 +1,237 @@
|
||||
Written by: Simon Prior
|
||||
Date: 10/07/97
|
||||
Platform: HP-UX (10.20)
|
||||
|
||||
G4UIxvt driver class
|
||||
---------------------
|
||||
|
||||
This file will document all about the driver classes G4UIxvt.cc and .hh, what
|
||||
ideas I had and any discoveries made etc. It will be informative for future
|
||||
developers of the XVT Geant GUI when looking at work I have done and for
|
||||
reference.
|
||||
|
||||
I will look in detail at the code I wrote in these classes to explain what it
|
||||
does.
|
||||
|
||||
---------------------
|
||||
|
||||
XVT driver class header
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
I basically took the TCL and Terminal implementations and extended/changed
|
||||
their behaviour to fit in with my requirements for XVT.
|
||||
|
||||
First thing to note in this file is the #defines which define XvtToGeant and
|
||||
GeantToXvt. These are names I will use in my code for the named pipes which I
|
||||
set up for communication between the XVT executable and the Geant4 executable.
|
||||
|
||||
The next #define simply defines the file mode (i.e. appropriate UNIX
|
||||
permissions) to open the named pipes with.
|
||||
|
||||
After this come several #includes which include various functions I will use in
|
||||
the code.
|
||||
|
||||
After this I define 2 new types called 'G4parameterData' and 'G4commandData'.
|
||||
These are structures to hold information about commands.
|
||||
|
||||
The idea is that at the start of the program I will have an array of these
|
||||
structures, parse the command tree for command information and fill this array
|
||||
with the information obtained. Later on this information can be sent to XVT
|
||||
when it is required.
|
||||
|
||||
After this are the usual method declarations and data member definitions etc.
|
||||
- These are commented.
|
||||
|
||||
******************************************************************************
|
||||
*************************** IMPORTANT ***************************************
|
||||
*** ***
|
||||
*** The declaration of 'G4commandData commandArray[200];' in the header ***
|
||||
*** file basically declares how many commands can be stored in the array ***
|
||||
*** and then used to create the command palette. ***
|
||||
*** IF during future use the program coredumps when obtaining the commands ***
|
||||
*** it is most likely that there are greater that 200 commands ***
|
||||
*** - especially as commands are being added all the time. All you need ***
|
||||
*** to do is increase this value and everything will work fine again. ***
|
||||
*** ***
|
||||
******************************************************************************
|
||||
|
||||
---------------------
|
||||
|
||||
XVT driver class implementation
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
the constructor:
|
||||
----------------
|
||||
|
||||
The usual class variable initialisation happens here.
|
||||
|
||||
I set a variable called 'number' which is the number of bytes read in one go
|
||||
from the named pipe to a value of 100.
|
||||
|
||||
I set the array indexing variables (currentPosition and lastPosition) to 0 and
|
||||
100 respectively.
|
||||
|
||||
notify:
|
||||
-------
|
||||
|
||||
This method simply notifies the user of Geant4 State changes (sends info to GUI
|
||||
which displays it).
|
||||
|
||||
breakRequested:
|
||||
---------------
|
||||
|
||||
This method handles notification the the user of break points and actually
|
||||
setting them up.
|
||||
|
||||
set_verbose:
|
||||
------------
|
||||
|
||||
This sets the verbose flag of the GUI's state handling.
|
||||
|
||||
PLEASE NOTE: The above 3 methods were created by Makoto Asai and as I am not an
|
||||
expert in them any questions should be directed towards him.
|
||||
|
||||
|
||||
sessionStart:
|
||||
-------------
|
||||
|
||||
In this method I first call openConnections() which opens the named pipes from
|
||||
the Geant end with the appropriate permissions (see description below).
|
||||
|
||||
I then call the 'fillArrayEntries' method with the command tree - this parses
|
||||
the command tree to get all the commands and put them in the commandArray
|
||||
(this is an array of G4commandData structures).
|
||||
|
||||
After this the main program control is entered. It waits for user commands and
|
||||
dispatches them to Geant.
|
||||
|
||||
Note: The order of execution of these statements is very important as some of
|
||||
the methods require other things to already have been executed. This is
|
||||
particularly important when Filling the commandArray.
|
||||
|
||||
additionalSession:
|
||||
------------------
|
||||
|
||||
This method basically handles the stage when the a breakpoint has been reached
|
||||
and the user must type 'continue' to continue from it.
|
||||
|
||||
NOTE: This (additionalSession) is another one of Makoto's methods.
|
||||
|
||||
|
||||
sessionTerminate:
|
||||
-----------------
|
||||
|
||||
Basically write the end of program text to the named pipe for XVT to display
|
||||
to the user. >> After state machine update this method is no longer called.
|
||||
|
||||
openConnections:
|
||||
----------------
|
||||
|
||||
This method opens the named pipes from the Geant end. It opens the GeantToXvt
|
||||
pipe with write permission and opens the XvtToGeant with read permission.
|
||||
|
||||
checkXvtToGeantPipe:
|
||||
--------------------
|
||||
|
||||
This method uses an I/O control function (from ioctl.h) to test whether the
|
||||
named pipe can be read without blocking.
|
||||
|
||||
readXvtToGeant:
|
||||
---------------
|
||||
|
||||
When called this method reads the XvtToGeant pipe and returns the string to the
|
||||
caller. It has no checks/safeguards so checkXvtToGeantPipe should be called
|
||||
first to make sure the operation won't block.
|
||||
|
||||
writeGeantToXvt:
|
||||
----------------
|
||||
|
||||
This write the string passed to the XVT via the named pipe.
|
||||
|
||||
errorHandler:
|
||||
-------------
|
||||
|
||||
This just write an error message to the user via cout.
|
||||
|
||||
getCommand:
|
||||
-----------
|
||||
|
||||
This is very similar to the TCL and terminal implementations - It waits for the
|
||||
user to enter a command (via the XVT GUI and by reading the pipe) then once it
|
||||
has obtained the string decides what to do with it.
|
||||
|
||||
There are a few alterations in this method that I made for my XVT
|
||||
implementation. Firstly the loop which obtains the command from the user is
|
||||
different. Then there is a new command to branch to called 'getCommands'. -
|
||||
see code.
|
||||
|
||||
I have also stripped out the directory navigation commands that are in the
|
||||
terminal implementation like 'ls', 'cd' etc as they are not needed for the
|
||||
XVT implementation.
|
||||
|
||||
codeGen:
|
||||
--------
|
||||
|
||||
This is the same apart from where TCL and terminal did a cout - I do a
|
||||
writeGeantToXvt see code for more details.
|
||||
|
||||
briefListCommands:
|
||||
------------------
|
||||
|
||||
This calls codeGen to list the commands in the command tree.
|
||||
|
||||
listCurrentDirectory:
|
||||
---------------------
|
||||
|
||||
This does a complete listing of the current directory i.e. all the available
|
||||
commands, sub-commands and their parameters/guidance etc. Please note that
|
||||
this is not needed or ever executed - It is there incase similar code is
|
||||
required in the future as this shows quite extensively how to access all parts
|
||||
of the commandTree via the UIManager pointer and public methods.
|
||||
|
||||
sendArrayEntriesToXvt:
|
||||
----------------------
|
||||
|
||||
When called, this method goes sequentially through the commandArray and sends
|
||||
each element down the GeantToXvt pipe to XVT to process.
|
||||
|
||||
fillArrayEntries:
|
||||
-----------------
|
||||
|
||||
This traverses the command tree in the same manner that codeGen does
|
||||
(recursively) and puts the commands in an array in the G4commandData structures
|
||||
defined in the header file.
|
||||
|
||||
The idea is that later this information is sent to XVT via the pipe using
|
||||
sendArrayEntriesToXvt().
|
||||
|
||||
This method takes care of coding the command array entries with a particular
|
||||
'tag' - 0, 1 or 2 which indicates whether the command is a directory(0), a
|
||||
Geant4 executable command (1) or a subdirectory (2).
|
||||
|
||||
This is extremely important when building the command palette at the XVT end of
|
||||
the pipe. - It is used to generate the heirarchy.
|
||||
|
||||
listCommandArray:
|
||||
-----------------
|
||||
|
||||
This is merely a debugging method that parses the command array printing out
|
||||
all the details. It is foreseen that this will be deleted in the future when
|
||||
things have been proved bug free.
|
||||
|
||||
==============================================================================
|
||||
FOOTNOTE:
|
||||
|
||||
Basically this driver class handles everything between XVT and the core of
|
||||
Geant.
|
||||
|
||||
The main idea is that when Geant is started by XVT the driver class does all
|
||||
the appropriate initialisation and command retrieval from Geant. When ready it
|
||||
enters the main part of the code which basically receives commands from XVT and
|
||||
executes them.
|
||||
|
||||
It is also responsible for sending the commands down the pipe to XVT when
|
||||
requested so that XVT can build the command palettes etc.
|
||||
|
||||
==============================================================================
|
||||
S.Prior - August '97
|
||||
@@ -0,0 +1,34 @@
|
||||
# $Id: GNUmakefile,v 2.1 1998/07/13 15:15:31 urbi Exp $
|
||||
# ----------------------------------------------------------------
|
||||
# Generic GNUmakefile
|
||||
# Set environment variable G4TARGET.
|
||||
# ----------------------------------------------------------------
|
||||
# TESTTARGET is created according to G4SYSTEM. G.Cosmo, 11/6/96.
|
||||
|
||||
MAKEFLAGS= --no-print-directory
|
||||
|
||||
ifndef G4TARGET
|
||||
G4TARGET := $(TESTTARGET)
|
||||
endif
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../..
|
||||
endif
|
||||
|
||||
G4EXEC_BUILD = true
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
include $(G4INSTALL)/config/G4VIS_USE.gmk
|
||||
|
||||
# Override some variables for binmake.gmk.
|
||||
#
|
||||
# INCFLAGS :=
|
||||
# LDLIBS :=
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
|
||||
.PHONY: clean_all_tildas
|
||||
|
||||
clean_all_tildas:
|
||||
find $(G4BASE)/ -name '*~' -exec rm -i {} \;
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: GUI.h,v 2.1 1998/07/12 02:39:01 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
* GUI.h
|
||||
*/
|
||||
|
||||
#ifndef DSP_TEMPLATE_RELEASE
|
||||
#define DSP_TEMPLATE_RELEASE 04500
|
||||
#endif
|
||||
|
||||
#include "factory.h"
|
||||
#ifndef DSP_RELEASE
|
||||
#include FactoryDefines_i
|
||||
#endif
|
||||
//
|
||||
// Uncomment the following #include directive to define
|
||||
// Power++ 4.5 retired class include file symbols
|
||||
// (e.g., CIcon_i).
|
||||
// Note that makefiles must also be updated to reference
|
||||
// the retired class include directory -
|
||||
// %{XVT_DSP_DIR}/src/pwr/retired
|
||||
// and retired class libraries (platform dependent) e.g.-
|
||||
// xvtxmpwrrt -or- xvtwmrtd, and
|
||||
// xvtxmtbl -or- xvtwmtbl
|
||||
//
|
||||
//#include "PwrRtrd.h"
|
||||
//
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
GUI.url: Example Universal Resource Language File for XVT-Power++
|
||||
applications. You may add any application specific resources.
|
||||
*/
|
||||
|
||||
#ifndef PAFACTORY_QBASE_NAME
|
||||
#define PAFACTORY_QBASE_NAME "GUI"
|
||||
#define PAFACTORY_BASE_NAME GUI
|
||||
#endif
|
||||
|
||||
#define APPNAME PAFACTORY_BASE_NAME
|
||||
#define QAPPNAME PAFACTORY_QBASE_NAME
|
||||
|
||||
#define XVT_PREFERRED_MEM_SIZE 4 * 1024 * 1024
|
||||
#define XVT_MINIMUM_MEM_SIZE 1 * 1024 * 1024
|
||||
|
||||
#include "url.h"
|
||||
#include "PwrURL.h"
|
||||
|
||||
#if XVTWS == MACWS
|
||||
#include "faccmd.h"
|
||||
#include "factory.url"
|
||||
#else
|
||||
#include "factory/faccmd.h"
|
||||
#include "factory/factory.url"
|
||||
#endif
|
||||
|
||||
/*
|
||||
Definition of NULLicon
|
||||
*/
|
||||
|
||||
#if XVTWS == WINWS || XVTWS == NTWS
|
||||
|
||||
#transparent $$$
|
||||
20001 ICON DISCARDABLE null.ico
|
||||
$$$
|
||||
|
||||
#endif /* WINWS & NTWS */
|
||||
|
||||
#if XVTWS == PMWS
|
||||
|
||||
#transparent $$$
|
||||
BITMAP 20001 null.bmp
|
||||
ICON 20001 null.ico
|
||||
$$$
|
||||
|
||||
#endif /* PMWS */
|
||||
|
||||
#if XVTWS == MACWS
|
||||
|
||||
#transparent $$$
|
||||
resource 'ICON' (20001) {
|
||||
$"0000 0000 001E 0000 001E 0000 001E 0000" /* ................ */
|
||||
$"001E 0000 001E 0000 001E 0000 0008 0000" /* ................ */
|
||||
$"003F 0000 003F 0000 003F 0000 003F 0000" /* .?...?...?...?.. */
|
||||
$"007F 8000 0069 8000 00E1 C000 00C8 C000" /* ....i..áÀ..ÈÀ. */
|
||||
$"01C8 E000 0FFF FC00 0FFF FC00 0308 3000" /* .Èà..ÿü..ÿü...0. */
|
||||
$"0708 3800 0600 1800 0E00 1C00 0C00 0C00" /* ..8............. */
|
||||
$"1C00 0E00 5800 0680 F800 07C0 7000 0380" /* ....X..ø..Àp.. */
|
||||
$"3000 0300 1000 0200 1000 0200 0000 0000" /* 0............... */
|
||||
};
|
||||
$$$
|
||||
|
||||
#endif /* MACWS */
|
||||
|
||||
#if XVTWS == MTFWS
|
||||
|
||||
#transparent $$$
|
||||
|
||||
value black: color('black', foreground);
|
||||
value blue: color('blue', foreground);
|
||||
value green: color('green2', foreground);
|
||||
value pink: color('magenta2', foreground);
|
||||
value fill: color('lightblue', foreground);
|
||||
|
||||
value gammaColorTable: color_table(
|
||||
black='X',
|
||||
blue='B',
|
||||
green='G',
|
||||
pink='P',
|
||||
fill='.',
|
||||
background color=' ');
|
||||
|
||||
value icon_20001: exported
|
||||
icon(color_table=gammaColorTable,
|
||||
' X ',
|
||||
' X.X ',
|
||||
' X...X B ',
|
||||
' X.....X B B ',
|
||||
' X......XX B B ',
|
||||
' X......X..X BBBBB B ',
|
||||
' X..X...X....X B BBB B',
|
||||
' X..XX..X......B B BB B ',
|
||||
' X..XX..X......B B BB ',
|
||||
' X..XX..X......B B B ',
|
||||
' X..XX..X......B B ',
|
||||
' X..XX..X......B B ',
|
||||
' X..XX..X......B B B.X ',
|
||||
' X......X......BB B B...X ',
|
||||
' X......X......B BB B B.....X ',
|
||||
'X......X......B BBB B.......X ',
|
||||
' X....X........B BBBBB.........X',
|
||||
' X..X..........B B.........X ',
|
||||
' XX............B B.........X ',
|
||||
' X..GGGGGGGG...B.........X ',
|
||||
' X.GG GG............X ',
|
||||
' XG G G G...........X ',
|
||||
' G GG G.....PPPPPPPPPP ',
|
||||
' G GG G....P P ',
|
||||
' G G G G...P PP P P P',
|
||||
' GG GG...P P P P P P',
|
||||
' GGGGGGGG...P P P PPP P',
|
||||
' X.....P PP P P P',
|
||||
' X.....P P ',
|
||||
' X...X PPPPPPPPPP ',
|
||||
' X.X ',
|
||||
' X ');
|
||||
$$$
|
||||
|
||||
#endif /* MTFWS */
|
||||
@@ -0,0 +1,68 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: XResMgr.cxx,v 2.1 1998/07/12 02:39:01 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/********************************************************************
|
||||
|
||||
Copyright (c) 1995-96 XVT Software, Inc.
|
||||
|
||||
File Name: ResMgr.cxx
|
||||
|
||||
Usage:
|
||||
|
||||
If you plan to use Motif-specific icons or cursors in your application,
|
||||
you must edit this file and add the appropriate definitions. Using
|
||||
XVT-Architect's Drafting Board module, you can lay out CIcon objects
|
||||
in a project's windows. However, the resources corresponding to CIcon
|
||||
objects cannot be specified via XVT's Universal Resource Language
|
||||
(URL). You must instead define them in this file with a small amount
|
||||
of C code.
|
||||
|
||||
For more information on the purpose and contents of this file, see
|
||||
the "Cursors and Drawn Icons" section in the XVT Platform-Specific
|
||||
Book for Motif.
|
||||
|
||||
********************************************************************/
|
||||
|
||||
#include "XVTPwr.h"
|
||||
#include "xvt_xres.h"
|
||||
#include Global_i // for NULLicon
|
||||
|
||||
#define pwr_width 32
|
||||
#define pwr_height 30
|
||||
static unsigned char pwr_bits[] =
|
||||
{
|
||||
0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80,
|
||||
0xf9, 0x03, 0x07, 0x87, 0x09, 0x04, 0x05, 0x85, 0x09, 0x08, 0x05, 0x85,
|
||||
0x09, 0xe8, 0xfd, 0xbd, 0x09, 0x28, 0x20, 0xa0, 0x09, 0xe8, 0xfd, 0xbd,
|
||||
0x09, 0x08, 0x05, 0x85, 0x09, 0x08, 0x05, 0x85, 0x09, 0x08, 0x07, 0x87,
|
||||
0x09, 0x04, 0x00, 0x80, 0xf9, 0x03, 0x00, 0x80, 0x09, 0x00, 0x00, 0x80,
|
||||
0x09, 0x4e, 0xf4, 0x9e, 0x09, 0x51, 0x14, 0xa2, 0x09, 0x51, 0x14, 0xa2,
|
||||
0x09, 0x51, 0x14, 0xa2, 0x09, 0x51, 0x14, 0xa2, 0x09, 0x51, 0x74, 0x9e,
|
||||
0x09, 0x51, 0x15, 0x8a, 0x09, 0x51, 0x15, 0x92, 0x09, 0x51, 0x15, 0x92,
|
||||
0x09, 0x91, 0x12, 0xa2, 0x09, 0x8e, 0xf2, 0xa2, 0x01, 0x00, 0x00, 0x80,
|
||||
0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff
|
||||
};
|
||||
|
||||
// Define an icon or cursor resource type variable:
|
||||
static ICON_RESOURCE PwrIcon;
|
||||
|
||||
// Place resouce into XVT's resource information table:
|
||||
RESOURCE_INFO rtable[] =
|
||||
{
|
||||
{ "ICON", NULLicon, (char *)&PwrIcon },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
// Build the resource:
|
||||
RESOURCE_INFO* xvt_xres_create_table()
|
||||
{
|
||||
xvt_xres_build_icon( &PwrIcon, NULLheight, NULLwidth, (DATA_PTR)pwr_bits );
|
||||
return rtable;
|
||||
}
|
||||
|
After Width: | Height: | Size: 378 B |
|
After Width: | Height: | Size: 350 B |
|
After Width: | Height: | Size: 158 B |
|
After Width: | Height: | Size: 466 B |
|
After Width: | Height: | Size: 354 B |
|
After Width: | Height: | Size: 466 B |
|
After Width: | Height: | Size: 466 B |
|
After Width: | Height: | Size: 578 B |
|
After Width: | Height: | Size: 198 B |
|
After Width: | Height: | Size: 202 B |
|
After Width: | Height: | Size: 202 B |
|
After Width: | Height: | Size: 198 B |
|
After Width: | Height: | Size: 194 B |
|
After Width: | Height: | Size: 202 B |
|
After Width: | Height: | Size: 194 B |
|
After Width: | Height: | Size: 194 B |
|
After Width: | Height: | Size: 194 B |
|
After Width: | Height: | Size: 202 B |
|
After Width: | Height: | Size: 194 B |
|
After Width: | Height: | Size: 194 B |
|
After Width: | Height: | Size: 202 B |
|
After Width: | Height: | Size: 466 B |
|
After Width: | Height: | Size: 466 B |
|
After Width: | Height: | Size: 254 B |
@@ -0,0 +1,60 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: cstartup.cxx,v 2.1 1998/07/12 02:39:02 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*********************************************************************
|
||||
*
|
||||
Copyright (c) 1996
|
||||
|
||||
File Name: CStartup.cxx
|
||||
|
||||
Implements main()
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
#include "XVTPwr.h"
|
||||
#include "AppDef.h"
|
||||
|
||||
#include GUI_i
|
||||
#include G4XvtGUI_i
|
||||
|
||||
#ifdef DSP_RELEASE
|
||||
#include FactoryCommands_i
|
||||
#endif
|
||||
|
||||
#ifndef PAFACTORY_QBASE_NAME
|
||||
#define PAFACTORY_QBASE_NAME "GUI"
|
||||
#endif
|
||||
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
// Instantiate an application object, then invoke its Go()
|
||||
// method to begin life as a GUI application. On some platforms
|
||||
// Go() will never return control to main(), so do not place
|
||||
// any meaningful code after Go().
|
||||
//
|
||||
// Add any GUI initialization code to the application class
|
||||
// constructor, rather than doing it here.
|
||||
|
||||
G4XvtGUI theApplication;
|
||||
|
||||
theApplication.Go(
|
||||
argc,
|
||||
argv,
|
||||
PAFACTORY_APP_MENU,
|
||||
PAFACTORY_APP_ABOUT_BOX,
|
||||
PAFACTORY_QBASE_NAME,
|
||||
PAFACTORY_APP_NAME,
|
||||
PAFACTORY_APP_TITLE );
|
||||
|
||||
// In case Go() returns and/or to avoid compiler warnings
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: AppDef.h,v 2.1 1998/07/12 02:39:08 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// AppDef.h
|
||||
//
|
||||
|
||||
#ifndef GUI_AppDef_H
|
||||
#define GUI_AppDef_H
|
||||
|
||||
#include "facdef.h"
|
||||
|
||||
#define GUI_i "GUI.h"
|
||||
#define G4XvtGUI_i "g4xvtgui.h"
|
||||
#define G4XvtDoc_i "g4xvtdoc.h"
|
||||
#define G4XvtWin_i "g4xvtwin.h"
|
||||
#endif /* AppDef_H */
|
||||
@@ -0,0 +1,44 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: _ctskdoc.h,v 2.1 1998/07/12 02:39:08 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#ifndef _ctskdoc_factory_h
|
||||
#define _ctskdoc_factory_h
|
||||
|
||||
#include "facdec.h"
|
||||
|
||||
|
||||
// Factory IDs:
|
||||
|
||||
#ifndef CTaskDoc1003
|
||||
#define CTaskDoc1003 1003
|
||||
#endif
|
||||
|
||||
// Object Data Members:
|
||||
|
||||
|
||||
class CTaskDoc1003Data : public CDataMembers
|
||||
{
|
||||
PWRClassInfo
|
||||
virtual void Initialize(PAFactory* theFactory);
|
||||
|
||||
public:
|
||||
|
||||
CTaskWin* itsCTaskWin1004;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: _ctskwin.h,v 2.1 1998/07/12 02:39:09 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#ifndef _ctskwin_factory_h
|
||||
#define _ctskwin_factory_h
|
||||
|
||||
#include "facdec.h"
|
||||
|
||||
|
||||
// Factory IDs:
|
||||
|
||||
#ifndef CTaskWin1004
|
||||
#define CTaskWin1004 1004
|
||||
#endif
|
||||
|
||||
// Object Data Members:
|
||||
|
||||
|
||||
class CTaskWin1004Data : public CDataMembers
|
||||
{
|
||||
PWRClassInfo
|
||||
virtual void Initialize(PAFactory* theFactory);
|
||||
|
||||
public:
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: _g4xvtdc.h,v 2.1 1998/07/12 02:39:09 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#ifndef _g4xvtdc_factory_h
|
||||
#define _g4xvtdc_factory_h
|
||||
|
||||
#include "facdec.h"
|
||||
|
||||
|
||||
// Factory IDs:
|
||||
|
||||
#ifndef G4Doc
|
||||
#define G4Doc 1009
|
||||
#endif
|
||||
|
||||
// Object Data Members:
|
||||
|
||||
|
||||
class G4DocData : public CDataMembers
|
||||
{
|
||||
PWRClassInfo
|
||||
virtual void Initialize(PAFactory* theFactory);
|
||||
|
||||
public:
|
||||
|
||||
G4XvtWin* itsG4Win;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: _g4xvtgu.h,v 2.1 1998/07/12 02:39:10 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#ifndef _g4xvtgu_factory_h
|
||||
#define _g4xvtgu_factory_h
|
||||
|
||||
#include "facdec.h"
|
||||
|
||||
|
||||
// Factory IDs:
|
||||
|
||||
#ifndef G4XvtGUI1002
|
||||
#define G4XvtGUI1002 1002
|
||||
#endif
|
||||
|
||||
// Object Data Members:
|
||||
|
||||
|
||||
class G4XvtGUI1002Data : public CDataMembers
|
||||
{
|
||||
PWRClassInfo
|
||||
virtual void Initialize(PAFactory* theFactory);
|
||||
|
||||
public:
|
||||
|
||||
CTaskDoc* itsCTaskDoc1003;
|
||||
G4XvtDoc* itsG4Doc;
|
||||
};
|
||||
|
||||
#define PAFACTORY_APP_ABOUT_BOX 0
|
||||
#define PAFACTORY_APP_BASE_NAME "PwrApp"
|
||||
#define PAFACTORY_APP_NAME "XVT - Geant 4"
|
||||
#define PAFACTORY_APP_MENU MENU_BAR_RID
|
||||
#define PAFACTORY_APP_TITLE "PwrApp"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: _g4xvtwn.h,v 2.1 1998/07/12 02:39:10 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#ifndef _g4xvtwn_factory_h
|
||||
#define _g4xvtwn_factory_h
|
||||
|
||||
#include "facdec.h"
|
||||
|
||||
|
||||
// Factory IDs:
|
||||
|
||||
#ifndef G4Win
|
||||
#define G4Win 1010
|
||||
#endif
|
||||
#ifndef progStatus
|
||||
#define progStatus 1017
|
||||
#endif
|
||||
#ifndef LogBar
|
||||
#define LogBar 1062
|
||||
#endif
|
||||
#ifndef CMenuButton1063
|
||||
#define CMenuButton1063 1063
|
||||
#endif
|
||||
#ifndef CMenuButton1064
|
||||
#define CMenuButton1064 1064
|
||||
#endif
|
||||
#ifndef CMenuButton1065
|
||||
#define CMenuButton1065 1065
|
||||
#endif
|
||||
#ifndef CMenuButton1076
|
||||
#define CMenuButton1076 1076
|
||||
#endif
|
||||
#ifndef CMenuButton1077
|
||||
#define CMenuButton1077 1077
|
||||
#endif
|
||||
#ifndef CMenuButton1078
|
||||
#define CMenuButton1078 1078
|
||||
#endif
|
||||
#ifndef CMenuButton1079
|
||||
#define CMenuButton1079 1079
|
||||
#endif
|
||||
#ifndef CMenuButton1080
|
||||
#define CMenuButton1080 1080
|
||||
#endif
|
||||
#ifndef getComButton
|
||||
#define getComButton 1083
|
||||
#endif
|
||||
#ifndef commandBox
|
||||
#define commandBox 1087
|
||||
#endif
|
||||
#ifndef execButton
|
||||
#define execButton 1088
|
||||
#endif
|
||||
#ifndef textExecButton
|
||||
#define textExecButton 1096
|
||||
#endif
|
||||
#ifndef helpButton
|
||||
#define helpButton 1097
|
||||
#endif
|
||||
#ifndef mainTextArea
|
||||
#define mainTextArea 1068
|
||||
#endif
|
||||
#ifndef CommandLog
|
||||
#define CommandLog 1073
|
||||
#endif
|
||||
#ifndef DropArea
|
||||
#define DropArea 1093
|
||||
#endif
|
||||
|
||||
// Object Data Members:
|
||||
|
||||
|
||||
class G4WinData : public CDataMembers
|
||||
{
|
||||
PWRClassInfo
|
||||
virtual void Initialize(PAFactory* theFactory);
|
||||
|
||||
public:
|
||||
|
||||
CStatusBar* itsprogStatus;
|
||||
CToolBar* itsLogBar;
|
||||
CMenuButton* itsCMenuButton1063;
|
||||
CMenuButton* itsCMenuButton1064;
|
||||
CMenuButton* itsCMenuButton1065;
|
||||
CMenuButton* itsCMenuButton1076;
|
||||
CMenuButton* itsCMenuButton1077;
|
||||
CMenuButton* itsCMenuButton1078;
|
||||
CMenuButton* itsCMenuButton1079;
|
||||
CMenuButton* itsCMenuButton1080;
|
||||
CMenuButton* itsgetComButton;
|
||||
NLineText* itscommandBox;
|
||||
CMenuButton* itsexecButton;
|
||||
CMenuButton* itstextExecButton;
|
||||
CMenuButton* itshelpButton;
|
||||
NScrollText* itsmainTextArea;
|
||||
NScrollText* itsCommandLog;
|
||||
CScroller* itsDropArea;
|
||||
};
|
||||
|
||||
|
||||
class LogBarData : public CDataMembers
|
||||
{
|
||||
PWRClassInfo
|
||||
virtual void Initialize(PAFactory* theFactory);
|
||||
|
||||
public:
|
||||
|
||||
CMenuButton* itsCMenuButton1063;
|
||||
CMenuButton* itsCMenuButton1064;
|
||||
CMenuButton* itsCMenuButton1065;
|
||||
CMenuButton* itsCMenuButton1076;
|
||||
CMenuButton* itsCMenuButton1077;
|
||||
CMenuButton* itsCMenuButton1078;
|
||||
CMenuButton* itsCMenuButton1079;
|
||||
CMenuButton* itsCMenuButton1080;
|
||||
CMenuButton* itsgetComButton;
|
||||
NLineText* itscommandBox;
|
||||
CMenuButton* itsexecButton;
|
||||
CMenuButton* itstextExecButton;
|
||||
CMenuButton* itshelpButton;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: classes.cxx,v 2.1 1998/07/12 02:39:10 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#include "XVTPwr.h"
|
||||
#include "AppDef.h"
|
||||
#include PAFactory_i
|
||||
|
||||
#define _PA_REF(x) x=x
|
||||
|
||||
#include G4XvtGUI_f
|
||||
|
||||
PWRRegisterClass1( G4XvtGUI1002Data, G4XvtGUI1002, "G4XvtGUI1002Data", CDataMembers)
|
||||
|
||||
void G4XvtGUI1002Data::Initialize(PAFactory* theFactory)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
itsCTaskDoc1003 = (CTaskDoc*) theFactory->GetInstance(1003);
|
||||
itsG4Doc = (G4XvtDoc*) theFactory->GetInstance(1009);
|
||||
}
|
||||
|
||||
#include CTaskDoc_f
|
||||
|
||||
PWRRegisterClass1( CTaskDoc1003Data, CTaskDoc1003, "CTaskDoc1003Data", CDataMembers)
|
||||
|
||||
void CTaskDoc1003Data::Initialize(PAFactory* theFactory)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
itsCTaskWin1004 = (CTaskWin*) theFactory->GetInstance(1004);
|
||||
}
|
||||
|
||||
#include CTaskWin_f
|
||||
|
||||
PWRRegisterClass1( CTaskWin1004Data, CTaskWin1004, "CTaskWin1004Data", CDataMembers)
|
||||
|
||||
void CTaskWin1004Data::Initialize(PAFactory* theFactory)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
}
|
||||
|
||||
#include G4XvtDoc_f
|
||||
|
||||
PWRRegisterClass1( G4DocData, G4Doc, "G4DocData", CDataMembers)
|
||||
|
||||
void G4DocData::Initialize(PAFactory* theFactory)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
itsG4Win = (G4XvtWin*) theFactory->GetInstance(1010);
|
||||
}
|
||||
|
||||
#include G4XvtWin_f
|
||||
|
||||
PWRRegisterClass1( G4WinData, G4Win, "G4WinData", CDataMembers)
|
||||
|
||||
void G4WinData::Initialize(PAFactory* theFactory)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
itsprogStatus = (CStatusBar*) theFactory->GetInstance(1017);
|
||||
itsLogBar = (CToolBar*) theFactory->GetInstance(1062);
|
||||
itsCMenuButton1063 = (CMenuButton*) theFactory->GetInstance(1063);
|
||||
itsCMenuButton1064 = (CMenuButton*) theFactory->GetInstance(1064);
|
||||
itsCMenuButton1065 = (CMenuButton*) theFactory->GetInstance(1065);
|
||||
itsCMenuButton1076 = (CMenuButton*) theFactory->GetInstance(1076);
|
||||
itsCMenuButton1077 = (CMenuButton*) theFactory->GetInstance(1077);
|
||||
itsCMenuButton1078 = (CMenuButton*) theFactory->GetInstance(1078);
|
||||
itsCMenuButton1079 = (CMenuButton*) theFactory->GetInstance(1079);
|
||||
itsCMenuButton1080 = (CMenuButton*) theFactory->GetInstance(1080);
|
||||
itsgetComButton = (CMenuButton*) theFactory->GetInstance(1083);
|
||||
itscommandBox = (NLineText*) theFactory->GetInstance(1087);
|
||||
itsexecButton = (CMenuButton*) theFactory->GetInstance(1088);
|
||||
itstextExecButton = (CMenuButton*) theFactory->GetInstance(1096);
|
||||
itshelpButton = (CMenuButton*) theFactory->GetInstance(1097);
|
||||
itsmainTextArea = (NScrollText*) theFactory->GetInstance(1068);
|
||||
itsCommandLog = (NScrollText*) theFactory->GetInstance(1073);
|
||||
itsDropArea = (CScroller*) theFactory->GetInstance(1093);
|
||||
}
|
||||
|
||||
|
||||
PWRRegisterClass1( LogBarData, LogBar, "LogBarData", CDataMembers)
|
||||
|
||||
void LogBarData::Initialize(PAFactory* theFactory)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
itsCMenuButton1063 = (CMenuButton*) theFactory->GetInstance(1063);
|
||||
itsCMenuButton1064 = (CMenuButton*) theFactory->GetInstance(1064);
|
||||
itsCMenuButton1065 = (CMenuButton*) theFactory->GetInstance(1065);
|
||||
itsCMenuButton1076 = (CMenuButton*) theFactory->GetInstance(1076);
|
||||
itsCMenuButton1077 = (CMenuButton*) theFactory->GetInstance(1077);
|
||||
itsCMenuButton1078 = (CMenuButton*) theFactory->GetInstance(1078);
|
||||
itsCMenuButton1079 = (CMenuButton*) theFactory->GetInstance(1079);
|
||||
itsCMenuButton1080 = (CMenuButton*) theFactory->GetInstance(1080);
|
||||
itsgetComButton = (CMenuButton*) theFactory->GetInstance(1083);
|
||||
itscommandBox = (NLineText*) theFactory->GetInstance(1087);
|
||||
itsexecButton = (CMenuButton*) theFactory->GetInstance(1088);
|
||||
itstextExecButton = (CMenuButton*) theFactory->GetInstance(1096);
|
||||
itshelpButton = (CMenuButton*) theFactory->GetInstance(1097);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: classes.h,v 2.1 1998/07/12 02:39:11 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
// Include all class definitions:
|
||||
#include "XVTPwr.h"
|
||||
#include CEnvironment_i
|
||||
#include CButton_i
|
||||
#include CText_i
|
||||
#include CPicture_i
|
||||
#include CMenuButton_i
|
||||
#include CScroller_i
|
||||
#include CToolBar_i
|
||||
#include CWindow_i
|
||||
#include NTextEdit_i
|
||||
#include NScrollText_i
|
||||
#include CStatusBar_i
|
||||
#include NLineText_i
|
||||
#include "rw/regexp.h"
|
||||
|
||||
#include G4XvtGUI_i
|
||||
#include CTaskDoc_i
|
||||
#include CTaskWin_i
|
||||
#include G4XvtDoc_i
|
||||
#include G4XvtWin_i
|
||||
@@ -0,0 +1,30 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: defines.h,v 2.1 1998/07/12 02:39:11 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#ifndef GUI_FactoryDefines_h
|
||||
#define GUI_FactoryDefines_h
|
||||
|
||||
#include "facdef.h"
|
||||
#include "facstr.h"
|
||||
#include "faccmd.h"
|
||||
|
||||
#include G4XvtGUI_f
|
||||
#include CTaskDoc_f
|
||||
#include CTaskWin_f
|
||||
#include G4XvtDoc_f
|
||||
#include G4XvtWin_f
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,35 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: faccb.h,v 2.1 1998/07/12 02:39:12 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
// Static Factory Initializer
|
||||
|
||||
#if (XVT_CC == XVT_CC_SYMCPLUS || defined XVT_PREDEF_PLACEMENT_NEW)
|
||||
#include "new.h"
|
||||
#else
|
||||
inline void* operator new(size_t, void* m) { return m; }
|
||||
#endif
|
||||
|
||||
class CGUIFactoryInit
|
||||
{
|
||||
public:
|
||||
CGUIFactoryInit() {
|
||||
if (!CGUIFactory::itIsInitialized)
|
||||
new (&GUIFactory) CGUIFactory;
|
||||
}
|
||||
};
|
||||
|
||||
static CGUIFactoryInit _FACTORYInit;
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: faccb0.cxx,v 2.1 1998/07/12 02:39:12 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#include "factory.h"
|
||||
#include "XVTPwr.h"
|
||||
#include "AppDef.h"
|
||||
#include PwrGen_i
|
||||
#include "facdec.h"
|
||||
#include "classes.h"
|
||||
#include "defines.h"
|
||||
#include "faccb.h"
|
||||
#define _PA_REF(x) x=x
|
||||
|
||||
void _Init_GUI_faccb0() { }
|
||||
|
||||
void* C_G4Win_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CDocument* anEnclosure = PtrCast( CDocument, theData );
|
||||
G4XvtWin* anInstance = new G4XvtWin(anEnclosure, CRect((UNITS)50, (UNITS)50, (UNITS)1017, (UNITS)782), NULLString, WSF_SIZE|WSF_CLOSE|WSF_ICONIZABLE|0, W_DOC, G4WinMB+DEFAULT_BASE
|
||||
#if (DSP_TEMPLATE_RELEASE > 03220)
|
||||
, TASK_WIN);
|
||||
#else
|
||||
);
|
||||
#endif
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_G4Win_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
G4XvtWin* anInstance = PtrCast(G4XvtWin, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
{
|
||||
CFont aFont;
|
||||
aFont.Deserialize("01\\system\\0\\12\\");
|
||||
CEnvironment anEnv(0xc0c0c0, 0x7000000, 0xc0c0c0, PAT_SOLID , 0x7000000, PAT_SOLID,1, aFont, M_COPY, P_SOLID, FALSE);
|
||||
|
||||
anInstance->SetEnvironment(anEnv);
|
||||
}
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, STRING1, NULLcmd, NULLcmd, TRUE, TRUE, FALSE, TOPSTICKY|LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
{
|
||||
CView* aView = (CView*) theFactory->GetInstance(1062);
|
||||
if (aView) anInstance->SetKeyFocus(aView);
|
||||
}
|
||||
|
||||
anInstance->SetBackgroundDrawing(FALSE);
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _G4WinDEFAULT(&GUIFactory, G4Win, 20024, 2, C_G4Win_GUI_DEFAULT, I_G4Win_GUI_DEFAULT, G4Doc, 0, 1, 1, 0);
|
||||
|
||||
void* C_CMenuButton1065_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
CMenuButton *anInstance = new CMenuButton( anEnclosure, CRect((UNITS)54, (UNITS)3, (UNITS)77, (UNITS)26), M_FILE_PRINT );
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_CMenuButton1065_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CMenuButton* anInstance = PtrCast(CMenuButton, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, TRUE, FALSE, TOPSTICKY|LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->SetTogglable( FALSE );
|
||||
CImage anImage(1002);
|
||||
CPicture* aPicture = new CPicture( anInstance, CPoint((UNITS)0, (UNITS)0), anImage );
|
||||
_PA_REF(aPicture);
|
||||
anInstance->SetCommands( NULLcmd, NULLcmd, PRINT_INcmd, PRINT_OUTcmd );
|
||||
anInstance->SizeToFit();
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _CMenuButton1065DEFAULT(&GUIFactory, CMenuButton1065, 20126, 3, C_CMenuButton1065_GUI_DEFAULT, I_CMenuButton1065_GUI_DEFAULT, LogBar, 0, 1, 13, 2);
|
||||
|
||||
void* C_CMenuButton1080_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
CMenuButton *anInstance = new CMenuButton( anEnclosure, CRect((UNITS)174, (UNITS)3, (UNITS)197, (UNITS)26), QUITcmd );
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_CMenuButton1080_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CMenuButton* anInstance = PtrCast(CMenuButton, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, TRUE, FALSE, TOPSTICKY|LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->SetTogglable( FALSE );
|
||||
CImage anImage(1007);
|
||||
CPicture* aPicture = new CPicture( anInstance, CPoint((UNITS)0, (UNITS)0), anImage );
|
||||
_PA_REF(aPicture);
|
||||
anInstance->SetCommands( NULLcmd, NULLcmd, QUIT_INcmd, QUIT_OUTcmd );
|
||||
anInstance->SizeToFit();
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _CMenuButton1080DEFAULT(&GUIFactory, CMenuButton1080, 20126, 3, C_CMenuButton1080_GUI_DEFAULT, I_CMenuButton1080_GUI_DEFAULT, LogBar, 0, 1, 13, 7);
|
||||
|
||||
void* C_helpButton_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
CMenuButton *anInstance = new CMenuButton( anEnclosure, CRect((UNITS)711, (UNITS)3, (UNITS)734, (UNITS)26), HELPcmd );
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_helpButton_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CMenuButton* anInstance = PtrCast(CMenuButton, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, FALSE, FALSE, TOPSTICKY|LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->SetTogglable( FALSE );
|
||||
CImage anImage(1011);
|
||||
CPicture* aPicture = new CPicture( anInstance, CPoint((UNITS)0, (UNITS)0), anImage );
|
||||
_PA_REF(aPicture);
|
||||
anInstance->SetCommands( NULLcmd, NULLcmd, HELP_INcmd, HELP_OUTcmd );
|
||||
anInstance->SizeToFit();
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _helpButtonDEFAULT(&GUIFactory, helpButton, 20126, 3, C_helpButton_GUI_DEFAULT, I_helpButton_GUI_DEFAULT, LogBar, 0, 1, 13, 12);
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: faccb1.cxx,v 2.1 1998/07/12 02:39:12 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#include "factory.h"
|
||||
#include "XVTPwr.h"
|
||||
#include "AppDef.h"
|
||||
#include PwrGen_i
|
||||
#include "facdec.h"
|
||||
#include "classes.h"
|
||||
#include "defines.h"
|
||||
#include "faccb.h"
|
||||
#define _PA_REF(x) x=x
|
||||
|
||||
void _Init_GUI_faccb1() { }
|
||||
|
||||
void* C_G4XvtGUI1002_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CApplication* anInstance = NULL;
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_G4XvtGUI1002_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
G4XvtGUI* anInstance = PtrCast(G4XvtGUI, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _G4XvtGUI1002DEFAULT(&GUIFactory, G4XvtGUI1002, 20000, 4, C_G4XvtGUI1002_GUI_DEFAULT, I_G4XvtGUI1002_GUI_DEFAULT, 0, 0, 1, 1, 0);
|
||||
|
||||
void* C_progStatus_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
CStatusBar *anInstance = new CStatusBar( anEnclosure );
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_progStatus_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CStatusBar* anInstance = PtrCast(CStatusBar, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, TRUE, FALSE, RIGHTSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->IStatusBar(2, 2, 5, 3, 0);
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _progStatusDEFAULT(&GUIFactory, progStatus, 20124, 3, C_progStatus_GUI_DEFAULT, I_progStatus_GUI_DEFAULT, G4Win, 0, 1, 5, 0);
|
||||
|
||||
void* C_CMenuButton1076_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
CMenuButton *anInstance = new CMenuButton( anEnclosure, CRect((UNITS)82, (UNITS)3, (UNITS)105, (UNITS)26), STARTcmd );
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_CMenuButton1076_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CMenuButton* anInstance = PtrCast(CMenuButton, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, TRUE, FALSE, TOPSTICKY|LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->SetTogglable( FALSE );
|
||||
CImage anImage(1003);
|
||||
CPicture* aPicture = new CPicture( anInstance, CPoint((UNITS)0, (UNITS)0), anImage );
|
||||
_PA_REF(aPicture);
|
||||
anInstance->SetCommands( NULLcmd, NULLcmd, START_INcmd, START_OUTcmd );
|
||||
anInstance->SizeToFit();
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _CMenuButton1076DEFAULT(&GUIFactory, CMenuButton1076, 20126, 3, C_CMenuButton1076_GUI_DEFAULT, I_CMenuButton1076_GUI_DEFAULT, LogBar, 0, 1, 13, 3);
|
||||
|
||||
void* C_getComButton_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
CMenuButton *anInstance = new CMenuButton( anEnclosure, CRect((UNITS)202, (UNITS)3, (UNITS)225, (UNITS)26), M_Retrieve_Commands );
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_getComButton_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CMenuButton* anInstance = PtrCast(CMenuButton, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, TRUE, FALSE, TOPSTICKY|LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->SetTogglable( FALSE );
|
||||
CImage anImage(1008);
|
||||
CPicture* aPicture = new CPicture( anInstance, CPoint((UNITS)0, (UNITS)0), anImage );
|
||||
_PA_REF(aPicture);
|
||||
anInstance->SetCommands( NULLcmd, NULLcmd, GET_COMMANDS_INcmd, GET_COMMANDS_OUTcmd );
|
||||
anInstance->SizeToFit();
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _getComButtonDEFAULT(&GUIFactory, getComButton, 20126, 3, C_getComButton_GUI_DEFAULT, I_getComButton_GUI_DEFAULT, LogBar, 0, 1, 13, 8);
|
||||
|
||||
void* C_mainTextArea_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
NScrollText* anInstance = new NScrollText(anEnclosure, CRect((UNITS)0, (UNITS)30, (UNITS)484, (UNITS)255), TRUE, TRUE);
|
||||
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_mainTextArea_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
NScrollText* anInstance = PtrCast(NScrollText, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
{
|
||||
CFont aFont;
|
||||
aFont.Deserialize("01\\system\\0\\12\\");
|
||||
CEnvironment anEnv(0xbffffff, 0x7000000, 0xbffffff, PAT_SOLID , 0x7000000, PAT_SOLID,1, aFont, M_COPY, P_SOLID, FALSE);
|
||||
|
||||
anInstance->SetEnvironment(anEnv);
|
||||
}
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, TRUE, FALSE, TOPSTICKY|RIGHTSTICKY|LEFTSTICKY|BOTTOMSTICKY, FALSE, FALSE);
|
||||
|
||||
unsigned anAttribute = TX_BORDER|TX_WRAP|0;
|
||||
if ((anInstance->GetCWindow()->GetAttributes() & WSF_NO_MENUBAR) != 0)
|
||||
anAttribute |= TX_NOMENU;
|
||||
anInstance->INativeTextEdit(anAttribute, (UNITS)1000 ,1000, STRING2, FALSE,anInstance->IsVisible(), anInstance->GetGlue());
|
||||
anInstance->SetTabSize(4);
|
||||
|
||||
|
||||
anInstance->SetVIncrements((UNITS)1 , (UNITS)10);
|
||||
anInstance->SetHIncrements((UNITS)10 , (UNITS)50);
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _mainTextAreaDEFAULT(&GUIFactory, mainTextArea, 20041, 3, C_mainTextArea_GUI_DEFAULT, I_mainTextArea_GUI_DEFAULT, G4Win, 0, 1, 5, 2);
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: faccb2.cxx,v 2.1 1998/07/12 02:39:13 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#include "factory.h"
|
||||
#include "XVTPwr.h"
|
||||
#include "AppDef.h"
|
||||
#include PwrGen_i
|
||||
#include "facdec.h"
|
||||
#include "classes.h"
|
||||
#include "defines.h"
|
||||
#include "faccb.h"
|
||||
#define _PA_REF(x) x=x
|
||||
|
||||
void _Init_GUI_faccb2() { }
|
||||
|
||||
void* C_CTaskDoc1003_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CTaskDoc* anInstance = NULL;
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_CTaskDoc1003_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CTaskDoc* anInstance = PtrCast(CTaskDoc, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _CTaskDoc1003DEFAULT(&GUIFactory, CTaskDoc1003, 20043, 1, C_CTaskDoc1003_GUI_DEFAULT, I_CTaskDoc1003_GUI_DEFAULT, G4XvtGUI1002, 0, 1, 2, 0);
|
||||
|
||||
void* C_LogBar_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
CToolBar *anInstance = new CToolBar( anEnclosure, CToolBar::AL_TOP );
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_LogBar_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CToolBar* anInstance = PtrCast(CToolBar, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcCMenuButton1095md, NULLcmd, TRUE, TRUE, TRUE, LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->IToolBar(2, 5);
|
||||
anInstance->InsertSeparator( 0 );
|
||||
anInstance->InsertSeparator( 2 );
|
||||
anInstance->InsertSeparator( 3 );
|
||||
anInstance->InsertSeparator( 8 );
|
||||
anInstance->InsertSeparator( 9 );
|
||||
anInstance->InsertSeparator( 10 );
|
||||
anInstance->InsertSeparator( 12 );
|
||||
anInstance->DoSize( anInstance->GetFrame() );
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _LogBarDEFAULT(&GUIFactory, LogBar, 20123, 3, C_LogBar_GUI_DEFAULT, I_LogBar_GUI_DEFAULT, G4Win, 0, 1, 5, 1);
|
||||
|
||||
void* C_CMenuButton1077_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
CMenuButton *anInstance = new CMenuButton( anEnclosure, CRect((UNITS)105, (UNITS)3, (UNITS)128, (UNITS)26), STOPcmd );
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_CMenuButton1077_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CMenuButton* anInstance = PtrCast(CMenuButton, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, TRUE, FALSE, TOPSTICKY|LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->SetTogglable( FALSE );
|
||||
CImage anImage(1004);
|
||||
CPicture* aPicture = new CPicture( anInstance, CPoint((UNITS)0, (UNITS)0), anImage );
|
||||
_PA_REF(aPicture);
|
||||
anInstance->SetCommands( NULLcmd, NULLcmd, STOP_INcmd, STOP_OUTcmd );
|
||||
anInstance->SizeToFit();
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _CMenuButton1077DEFAULT(&GUIFactory, CMenuButton1077, 20126, 3, C_CMenuButton1077_GUI_DEFAULT, I_CMenuButton1077_GUI_DEFAULT, LogBar, 0, 1, 13, 4);
|
||||
|
||||
void* C_commandBox_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
NLineText* anInstance = new NLineText(anEnclosure, CPoint((UNITS)230, (UNITS)3), (UNITS)425);
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_commandBox_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
NLineText* anInstance = PtrCast(NLineText, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
{
|
||||
CFont aFont;
|
||||
aFont.Deserialize("01\\system\\0\\12\\");
|
||||
CEnvironment anEnv(0xaaaa, 0xffffff, 0xbffffff, PAT_SOLID , 0x7000000, PAT_SOLID,1, aFont, M_COPY, P_SOLID, FALSE);
|
||||
|
||||
anInstance->SetEnvironment(anEnv);
|
||||
}
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, TRUE, FALSE, TOPSTICKY|LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
unsigned anAttribute = TX_AUTOHSCROLL|TX_AUTOVSCROLL|TX_BORDER|TX_WRAP|0;
|
||||
if ((anInstance->GetCWindow()->GetAttributes() & WSF_NO_MENUBAR) != 0)
|
||||
anAttribute |= TX_NOMENU;
|
||||
anInstance->INativeTextEdit(anAttribute, (UNITS)1000 ,1000, STRING5, FALSE,anInstance->IsVisible(), anInstance->GetGlue());
|
||||
anInstance->SetTabSize(4);
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _commandBoxDEFAULT(&GUIFactory, commandBox, 20040, 3, C_commandBox_GUI_DEFAULT, I_commandBox_GUI_DEFAULT, LogBar, 0, 1, 13, 9);
|
||||
|
||||
void* C_CommandLog_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
NScrollText* anInstance = new NScrollText(anEnclosure, CRect((UNITS)485, (UNITS)30, (UNITS)966, (UNITS)255), TRUE, TRUE);
|
||||
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_CommandLog_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
NScrollText* anInstance = PtrCast(NScrollText, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
{
|
||||
CFont aFont;
|
||||
aFont.Deserialize("01\\system\\0\\12\\");
|
||||
CEnvironment anEnv(0xffffff, 0x7000000, 0xffffff, PAT_SOLID , 0x7000000, PAT_SOLID,1, aFont, M_COPY, P_SOLID, FALSE);
|
||||
|
||||
anInstance->SetEnvironment(anEnv);
|
||||
}
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, TRUE, FALSE, TOPSTICKY|RIGHTSTICKY|LEFTSTICKY|BOTTOMSTICKY, FALSE, FALSE);
|
||||
|
||||
unsigned anAttribute = TX_BORDER|TX_WRAP|0;
|
||||
if ((anInstance->GetCWindow()->GetAttributes() & WSF_NO_MENUBAR) != 0)
|
||||
anAttribute |= TX_NOMENU;
|
||||
anInstance->INativeTextEdit(anAttribute, (UNITS)1000 ,1000, STRING4, FALSE,anInstance->IsVisible(), anInstance->GetGlue());
|
||||
anInstance->SetTabSize(4);
|
||||
|
||||
|
||||
anInstance->SetVIncrements((UNITS)1 , (UNITS)10);
|
||||
anInstance->SetHIncrements((UNITS)10 , (UNITS)50);
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _CommandLogDEFAULT(&GUIFactory, CommandLog, 20041, 3, C_CommandLog_GUI_DEFAULT, I_CommandLog_GUI_DEFAULT, G4Win, 0, 1, 5, 3);
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: faccb3.cxx,v 2.1 1998/07/12 02:39:13 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#include "factory.h"
|
||||
#include "XVTPwr.h"
|
||||
#include "AppDef.h"
|
||||
#include PwrGen_i
|
||||
#include "facdec.h"
|
||||
#include "classes.h"
|
||||
#include "defines.h"
|
||||
#include "faccb.h"
|
||||
#define _PA_REF(x) x=x
|
||||
|
||||
void _Init_GUI_faccb3() { }
|
||||
|
||||
void* C_CTaskWin1004_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CTaskWin* anInstance = NULL;
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_CTaskWin1004_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CTaskWin* anInstance = PtrCast(CTaskWin, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, TRUE, FALSE, TOPSTICKY|LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->SetBackgroundDrawing(FALSE);
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _CTaskWin1004DEFAULT(&GUIFactory, CTaskWin1004, 20044, 2, C_CTaskWin1004_GUI_DEFAULT, I_CTaskWin1004_GUI_DEFAULT, CTaskDoc1003, 0, 1, 1, 0);
|
||||
|
||||
void* C_CMenuButton1063_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
CMenuButton *anInstance = new CMenuButton( anEnclosure, CRect((UNITS)3, (UNITS)3, (UNITS)26, (UNITS)26), M_FILE_SAVE );
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_CMenuButton1063_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CMenuButton* anInstance = PtrCast(CMenuButton, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, TRUE, FALSE, TOPSTICKY|LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->SetTogglable( FALSE );
|
||||
CImage anImage(1000);
|
||||
CPicture* aPicture = new CPicture( anInstance, CPoint((UNITS)0, (UNITS)0), anImage );
|
||||
_PA_REF(aPicture);
|
||||
anInstance->SetCommands( NULLcmd, NULLcmd, SAVE_LOG_INcmd, SAVE_LOG_OUTcmd );
|
||||
anInstance->SizeToFit();
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _CMenuButton1063DEFAULT(&GUIFactory, CMenuButton1063, 20126, 3, C_CMenuButton1063_GUI_DEFAULT, I_CMenuButton1063_GUI_DEFAULT, LogBar, 0, 1, 13, 0);
|
||||
|
||||
void* C_CMenuButton1078_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
CMenuButton *anInstance = new CMenuButton( anEnclosure, CRect((UNITS)128, (UNITS)3, (UNITS)151, (UNITS)26), PAUSEcmd );
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_CMenuButton1078_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CMenuButton* anInstance = PtrCast(CMenuButton, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, TRUE, FALSE, TOPSTICKY|LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->SetTogglable( FALSE );
|
||||
CImage anImage(1005);
|
||||
CPicture* aPicture = new CPicture( anInstance, CPoint((UNITS)0, (UNITS)0), anImage );
|
||||
_PA_REF(aPicture);
|
||||
anInstance->SetCommands( NULLcmd, NULLcmd, PAUSE_INcmd, PAUSE_OUTcmd );
|
||||
anInstance->SizeToFit();
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _CMenuButton1078DEFAULT(&GUIFactory, CMenuButton1078, 20126, 3, C_CMenuButton1078_GUI_DEFAULT, I_CMenuButton1078_GUI_DEFAULT, LogBar, 0, 1, 13, 5);
|
||||
|
||||
void* C_execButton_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
CMenuButton *anInstance = new CMenuButton( anEnclosure, CRect((UNITS)660, (UNITS)3, (UNITS)683, (UNITS)26), EXECUTEcmd );
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_execButton_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CMenuButton* anInstance = PtrCast(CMenuButton, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, FALSE, FALSE, TOPSTICKY|LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->SetTogglable( FALSE );
|
||||
CImage anImage(1009);
|
||||
CPicture* aPicture = new CPicture( anInstance, CPoint((UNITS)0, (UNITS)0), anImage );
|
||||
_PA_REF(aPicture);
|
||||
anInstance->SetCommands( NULLcmd, NULLcmd, EXECUTE_INcmd, EXECUTE_OUTcmd );
|
||||
anInstance->SizeToFit();
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _execButtonDEFAULT(&GUIFactory, execButton, 20126, 3, C_execButton_GUI_DEFAULT, I_execButton_GUI_DEFAULT, LogBar, 0, 1, 13, 10);
|
||||
|
||||
void* C_DropArea_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
CScroller* anInstance = new CScroller(anEnclosure, CRect((UNITS)0, (UNITS)255, (UNITS)966, (UNITS)710));
|
||||
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_DropArea_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CScroller* anInstance = PtrCast(CScroller, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, TRUE, FALSE, TOPSTICKY|RIGHTSTICKY|LEFTSTICKY|BOTTOMSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->SetScrollingOrigin( CPoint((UNITS)0, (UNITS)0));
|
||||
anInstance->SetVirtualFrame((UNITS)0, (UNITS)0);
|
||||
|
||||
anInstance->IScroller(FALSE,FALSE,TRUE, (UNITS)8, (UNITS)80,anInstance->IsVisible(), anInstance->GetGlue());
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _DropAreaDEFAULT(&GUIFactory, DropArea, 20017, 3, C_DropArea_GUI_DEFAULT, I_DropArea_GUI_DEFAULT, G4Win, 0, 1, 5, 4);
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: faccb4.cxx,v 2.1 1998/07/12 02:39:13 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#include "factory.h"
|
||||
#include "XVTPwr.h"
|
||||
#include "AppDef.h"
|
||||
#include PwrGen_i
|
||||
#include "facdec.h"
|
||||
#include "classes.h"
|
||||
#include "defines.h"
|
||||
#include "faccb.h"
|
||||
#define _PA_REF(x) x=x
|
||||
|
||||
void _Init_GUI_faccb4() { }
|
||||
|
||||
void* C_G4Doc_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CApplication* anEnclosure = PtrCast( CApplication, theData );
|
||||
G4XvtDoc* anInstance = new G4XvtDoc(anEnclosure, 1009);
|
||||
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_G4Doc_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
G4XvtDoc* anInstance = PtrCast(G4XvtDoc, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _G4DocDEFAULT(&GUIFactory, G4Doc, 20004, 1, C_G4Doc_GUI_DEFAULT, I_G4Doc_GUI_DEFAULT, G4XvtGUI1002, 0, 1, 2, 1);
|
||||
|
||||
void* C_CMenuButton1064_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
CMenuButton *anInstance = new CMenuButton( anEnclosure, CRect((UNITS)26, (UNITS)3, (UNITS)49, (UNITS)26), M_FILE_SAVE_AS );
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_CMenuButton1064_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CMenuButton* anInstance = PtrCast(CMenuButton, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, TRUE, FALSE, TOPSTICKY|LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->SetTogglable( FALSE );
|
||||
CImage anImage(1001);
|
||||
CPicture* aPicture = new CPicture( anInstance, CPoint((UNITS)0, (UNITS)0), anImage );
|
||||
_PA_REF(aPicture);
|
||||
anInstance->SetCommands( NULLcmd, NULLcmd, SAVE_AS_INcmd, SAVE_AS_OUTcmd );
|
||||
anInstance->SizeToFit();
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _CMenuButton1064DEFAULT(&GUIFactory, CMenuButton1064, 20126, 3, C_CMenuButton1064_GUI_DEFAULT, I_CMenuButton1064_GUI_DEFAULT, LogBar, 0, 1, 13, 1);
|
||||
|
||||
void* C_CMenuButton1079_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
CMenuButton *anInstance = new CMenuButton( anEnclosure, CRect((UNITS)151, (UNITS)3, (UNITS)174, (UNITS)26), RESUMEcmd );
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_CMenuButton1079_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CMenuButton* anInstance = PtrCast(CMenuButton, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, TRUE, FALSE, TOPSTICKY|LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->SetTogglable( FALSE );
|
||||
CImage anImage(1006);
|
||||
CPicture* aPicture = new CPicture( anInstance, CPoint((UNITS)0, (UNITS)0), anImage );
|
||||
_PA_REF(aPicture);
|
||||
anInstance->SetCommands( NULLcmd, NULLcmd, RESUME_INcmd, RESUME_OUTcmd );
|
||||
anInstance->SizeToFit();
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _CMenuButton1079DEFAULT(&GUIFactory, CMenuButton1079, 20126, 3, C_CMenuButton1079_GUI_DEFAULT, I_CMenuButton1079_GUI_DEFAULT, LogBar, 0, 1, 13, 6);
|
||||
|
||||
void* C_textExecButton_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
CSubview* anEnclosure = PtrCast( CSubview, theData );
|
||||
CMenuButton *anInstance = new CMenuButton( anEnclosure, CRect((UNITS)683, (UNITS)3, (UNITS)706, (UNITS)26), COMcmd );
|
||||
return anInstance;
|
||||
}
|
||||
|
||||
void I_textExecButton_GUI_DEFAULT(const PAFactory* theFactory, CObjectRWC* theData, CDataMembers* theDataMembers)
|
||||
{
|
||||
_PA_REF(theFactory);
|
||||
_PA_REF(theData);
|
||||
_PA_REF(theDataMembers);
|
||||
CMenuButton* anInstance = PtrCast(CMenuButton, theData);
|
||||
if (!anInstance) return;
|
||||
|
||||
|
||||
IPAFactoryView(anInstance, "", NULLcmd, NULLcmd, TRUE, FALSE, FALSE, TOPSTICKY|LEFTSTICKY, FALSE, FALSE);
|
||||
|
||||
|
||||
anInstance->SetTogglable( FALSE );
|
||||
CImage anImage(1010);
|
||||
CPicture* aPicture = new CPicture( anInstance, CPoint((UNITS)0, (UNITS)0), anImage );
|
||||
_PA_REF(aPicture);
|
||||
anInstance->SetCommands( NULLcmd, NULLcmd, COM_INcmd, COM_OUTcmd );
|
||||
anInstance->SizeToFit();
|
||||
|
||||
|
||||
}
|
||||
|
||||
CFactoryElement _textExecButtonDEFAULT(&GUIFactory, textExecButton, 20126, 3, C_textExecButton_GUI_DEFAULT, I_textExecButton_GUI_DEFAULT, LogBar, 0, 1, 13, 11);
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: faccmd.h,v 2.1 1998/07/12 02:39:14 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#ifndef GUI_FactoryCommands_h
|
||||
#define GUI_FactoryCommands_h
|
||||
|
||||
// Command ID Bases:
|
||||
/*
|
||||
Default base
|
||||
*/
|
||||
#ifndef PA_NULLBase
|
||||
#define PA_NULLBase 0
|
||||
#endif
|
||||
#ifndef G4Control_Commands
|
||||
#define G4Control_Commands 1000
|
||||
#endif
|
||||
|
||||
// Command IDs:
|
||||
#ifndef NULLcCMenuButton1095md
|
||||
#define NULLcCMenuButton1095md (PA_NULLBase + 20)
|
||||
#endif
|
||||
#ifndef COM_INcmd
|
||||
#define COM_INcmd (G4Control_Commands + 34)
|
||||
#endif
|
||||
#ifndef COM_OUTcmd
|
||||
#define COM_OUTcmd (G4Control_Commands + 35)
|
||||
#endif
|
||||
#ifndef STOP_INcmd
|
||||
#define STOP_INcmd (G4Control_Commands + 5)
|
||||
#endif
|
||||
#ifndef START_OUTcmd
|
||||
#define START_OUTcmd (G4Control_Commands + 3)
|
||||
#endif
|
||||
#ifndef RESUMEcmd
|
||||
#define RESUMEcmd (G4Control_Commands + 10)
|
||||
#endif
|
||||
#ifndef RESUME_INcmd
|
||||
#define RESUME_INcmd (G4Control_Commands + 11)
|
||||
#endif
|
||||
#ifndef M_Pause_Geant
|
||||
#define M_Pause_Geant (PA_NULLBase + 13)
|
||||
#endif
|
||||
#ifndef QUIT_INcmd
|
||||
#define QUIT_INcmd (G4Control_Commands + 14)
|
||||
#endif
|
||||
#ifndef M_Retrieve_Commands
|
||||
#define M_Retrieve_Commands (PA_NULLBase + 7)
|
||||
#endif
|
||||
#ifndef M_Palettes
|
||||
#define M_Palettes (PA_NULLBase + 16)
|
||||
#endif
|
||||
#ifndef M_Commands
|
||||
#define M_Commands (PA_NULLBase + 17)
|
||||
#endif
|
||||
#ifndef COMcmd
|
||||
#define COMcmd (G4Control_Commands + 31)
|
||||
#endif
|
||||
#ifndef PAUSE_OUTcmd
|
||||
#define PAUSE_OUTcmd (G4Control_Commands + 9)
|
||||
#endif
|
||||
#ifndef PAUSEcmd
|
||||
#define PAUSEcmd (G4Control_Commands + 7)
|
||||
#endif
|
||||
#ifndef HELP_OUTcmd
|
||||
#define HELP_OUTcmd (G4Control_Commands + 23)
|
||||
#endif
|
||||
#ifndef PRINT_OUTcmd
|
||||
#define PRINT_OUTcmd (G4Control_Commands + 21)
|
||||
#endif
|
||||
#ifndef SAVE_AS_INcmd
|
||||
#define SAVE_AS_INcmd (G4Control_Commands + 18)
|
||||
#endif
|
||||
#ifndef SAVE_AS_OUTcmd
|
||||
#define SAVE_AS_OUTcmd (G4Control_Commands + 19)
|
||||
#endif
|
||||
#ifndef OutputWinMB
|
||||
#define OutputWinMB (PA_NULLBase + 3)
|
||||
#endif
|
||||
#ifndef SAVE_LOG_INcmd
|
||||
#define SAVE_LOG_INcmd (G4Control_Commands + 16)
|
||||
#endif
|
||||
#ifndef M_Start_Geant
|
||||
#define M_Start_Geant (PA_NULLBase + 11)
|
||||
#endif
|
||||
#ifndef GET_COMMANDS_OUTcmd
|
||||
#define GET_COMMANDS_OUTcmd (G4Control_Commands + 30)
|
||||
#endif
|
||||
#ifndef RESUME_OUTcmd
|
||||
#define RESUME_OUTcmd (G4Control_Commands + 12)
|
||||
#endif
|
||||
#ifndef M_Setup
|
||||
#define M_Setup (PA_NULLBase + 6)
|
||||
#endif
|
||||
#ifndef EXECUTEcmd
|
||||
#define EXECUTEcmd (G4Control_Commands + 26)
|
||||
#endif
|
||||
#ifndef HELP_MENU_1015
|
||||
#define HELP_MENU_1015 (PA_NULLBase + 18)
|
||||
#endif
|
||||
#ifndef HELP_MENU_1044
|
||||
#define HELP_MENU_1044 (PA_NULLBase + 5)
|
||||
#endif
|
||||
#ifndef STOP_OUTcmd
|
||||
#define STOP_OUTcmd (G4Control_Commands + 6)
|
||||
#endif
|
||||
#ifndef START_INcmd
|
||||
#define START_INcmd (G4Control_Commands + 2)
|
||||
#endif
|
||||
#ifndef GET_COMMANDScmd
|
||||
#define GET_COMMANDScmd (G4Control_Commands + 28)
|
||||
#endif
|
||||
#ifndef FILE_MENU_1015
|
||||
#define FILE_MENU_1015 (PA_NULLBase + 2)
|
||||
#endif
|
||||
#ifndef FILE_MENU_1044
|
||||
#define FILE_MENU_1044 (PA_NULLBase + 4)
|
||||
#endif
|
||||
#ifndef G4WinMB
|
||||
#define G4WinMB (PA_NULLBase + 1)
|
||||
#endif
|
||||
#ifndef QUIT_OUTcmd
|
||||
#define QUIT_OUTcmd (G4Control_Commands + 15)
|
||||
#endif
|
||||
#ifndef M_Stop_Geant
|
||||
#define M_Stop_Geant (PA_NULLBase + 12)
|
||||
#endif
|
||||
#ifndef M_Quit_Geant
|
||||
#define M_Quit_Geant (PA_NULLBase + 15)
|
||||
#endif
|
||||
#ifndef PAUSE_INcmd
|
||||
#define PAUSE_INcmd (G4Control_Commands + 8)
|
||||
#endif
|
||||
#ifndef HELPcmd
|
||||
#define HELPcmd (G4Control_Commands + 27)
|
||||
#endif
|
||||
#ifndef STARTcmd
|
||||
#define STARTcmd (G4Control_Commands + 1)
|
||||
#endif
|
||||
#ifndef STOPcmd
|
||||
#define STOPcmd (G4Control_Commands + 4)
|
||||
#endif
|
||||
#ifndef QUITcmd
|
||||
#define QUITcmd (G4Control_Commands + 13)
|
||||
#endif
|
||||
#ifndef HELP_INcmd
|
||||
#define HELP_INcmd (G4Control_Commands + 22)
|
||||
#endif
|
||||
#ifndef PRINT_INcmd
|
||||
#define PRINT_INcmd (G4Control_Commands + 20)
|
||||
#endif
|
||||
#ifndef SAVE_LOG_OUTcmd
|
||||
#define SAVE_LOG_OUTcmd (G4Control_Commands + 17)
|
||||
#endif
|
||||
#ifndef EXECUTE_INcmd
|
||||
#define EXECUTE_INcmd (G4Control_Commands + 24)
|
||||
#endif
|
||||
#ifndef EXECUTE_OUTcmd
|
||||
#define EXECUTE_OUTcmd (G4Control_Commands + 25)
|
||||
#endif
|
||||
#ifndef M_Control
|
||||
#define M_Control (PA_NULLBase + 10)
|
||||
#endif
|
||||
#ifndef GET_COMMANDS_INcmd
|
||||
#define GET_COMMANDS_INcmd (G4Control_Commands + 29)
|
||||
#endif
|
||||
#ifndef M_Enter_Parameters_for_selected_command
|
||||
#define M_Enter_Parameters_for_selected_command (PA_NULLBase + 8)
|
||||
#endif
|
||||
#ifndef M_On_command
|
||||
#define M_On_command (PA_NULLBase + 19)
|
||||
#endif
|
||||
#ifndef M_Resume_Geant
|
||||
#define M_Resume_Geant (PA_NULLBase + 14)
|
||||
#endif
|
||||
#ifndef M_Execute_Selected_Command
|
||||
#define M_Execute_Selected_Command (PA_NULLBase + 9)
|
||||
#endif
|
||||
|
||||
#ifndef PAFACTORY_BASE_NAME
|
||||
#define PAFACTORY_BASE_NAMEGUI
|
||||
#endif
|
||||
#ifndef PAFACTORY_QBASE_NAME
|
||||
#define PAFACTORY_QBASE_NAME "GUI"
|
||||
#endif
|
||||
|
||||
// Layer ID Bases
|
||||
#ifndef DEFAULT_BASE
|
||||
#define DEFAULT_BASE 0
|
||||
#endif
|
||||
|
||||
// Accelerator Tags:
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,40 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: facdec.h,v 2.1 1998/07/12 02:39:14 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#ifndef GUI_FacDec_h
|
||||
#define GUI_FacDec_h
|
||||
|
||||
// Forward Declarations
|
||||
|
||||
#define CUserView PWR_CRectangle
|
||||
#define CUserSubview PWR_CRectangle
|
||||
#define CUserView_i CRectangle_i
|
||||
#define CUserSubview_i CRectangle_i
|
||||
|
||||
class CMenuButton;
|
||||
class CScroller;
|
||||
class CMenuBar;
|
||||
class CToolBar;
|
||||
class G4XvtGUI;
|
||||
class CTaskDoc;
|
||||
class CTaskWin;
|
||||
class NScrollText;
|
||||
class G4XvtDoc;
|
||||
class G4XvtWin;
|
||||
class CStatusBar;
|
||||
class NLineText;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,40 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: facdef.h,v 2.1 1998/07/12 02:39:15 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#ifndef GUI_FacDef_h
|
||||
#define GUI_FacDef_h
|
||||
|
||||
// Factory class includes:
|
||||
#define G4XvtGUI_f "_g4xvtgu.h"
|
||||
#define CTaskDoc_f "_ctskdoc.h"
|
||||
#define CTaskWin_f "_ctskwin.h"
|
||||
#define G4XvtDoc_f "_g4xvtdc.h"
|
||||
#define G4XvtWin_f "_g4xvtwn.h"
|
||||
#define FactoryCommands_i "faccmd.h"
|
||||
#define FactoryStrings_i "facstr.h"
|
||||
#define FactoryDefines_i "defines.h"
|
||||
#define CGUIFactory_i "factory.h"
|
||||
#ifndef PA_FACTORY_INSTANCE
|
||||
#define PA_FACTORY_INSTANCE GUIFactory
|
||||
#endif
|
||||
|
||||
#ifndef DSP_RELEASE
|
||||
#define DSP_RELEASE 450
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,39 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: facstr.h,v 2.1 1998/07/12 02:39:15 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#ifndef GUI_FactoryStrings_h
|
||||
#define GUI_FactoryStrings_h
|
||||
|
||||
// String IDs:
|
||||
|
||||
#ifndef GUIStringIDBase
|
||||
#define GUIStringIDBase 0
|
||||
#endif
|
||||
|
||||
|
||||
// Defines for DEFAULT layer
|
||||
#define STRING5 ""
|
||||
#define STRING3 ""
|
||||
#define STRING6 ""
|
||||
#define STRING7 ""
|
||||
#define STRING8 ""
|
||||
#define STRING9 ""
|
||||
#define STRING2 ""
|
||||
#define STRING4 ""
|
||||
#define STRING1 (1016+GUIStringIDBase)
|
||||
|
||||
|
||||
#endif
|
||||
|
After Width: | Height: | Size: 632 B |
@@ -0,0 +1,65 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: factory.cxx,v 2.1 1998/07/12 02:39:15 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#include "factory.h"
|
||||
#include "faccmd.h"
|
||||
|
||||
|
||||
CGUIFactory GUIFactory;
|
||||
|
||||
int CGUIFactory::itIsInitialized = 0;
|
||||
|
||||
extern void _Init_GUI_faccb0();
|
||||
extern void _Init_GUI_faccb1();
|
||||
extern void _Init_GUI_faccb2();
|
||||
extern void _Init_GUI_faccb3();
|
||||
extern void _Init_GUI_faccb4();
|
||||
|
||||
CGUIFactory::CGUIFactory(void)
|
||||
: PAFactory(itIsInitialized)
|
||||
{
|
||||
itIsInitialized = 1;
|
||||
_Init_GUI_faccb0();
|
||||
_Init_GUI_faccb1();
|
||||
_Init_GUI_faccb2();
|
||||
_Init_GUI_faccb3();
|
||||
_Init_GUI_faccb4();
|
||||
}
|
||||
|
||||
CGUIFactory& CGUIFactory::operator[](CGUIFactory::LayerID theLayer)
|
||||
{
|
||||
PAFactory::operator[]((long) theLayer);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void CGUIFactory::SetDefaultLayer(CGUIFactory::LayerID theLayer)
|
||||
{
|
||||
PAFactory::SetDefaultLayer((long) theLayer);
|
||||
}
|
||||
|
||||
CGUIFactory::LayerID CGUIFactory::GetDefaultLayer(void) const
|
||||
{
|
||||
return (CGUIFactory::LayerID) PAFactory::GetDefaultLayer();
|
||||
}
|
||||
|
||||
long CGUIFactory::GetLayerBase(CGUIFactory::LayerID theLayerID)
|
||||
{
|
||||
switch(theLayerID) {
|
||||
case DEFAULT: return DEFAULT_BASE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: factory.h,v 2.1 1998/07/12 02:39:16 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#ifndef GUIFactory_h
|
||||
#define GUIFactory_h
|
||||
|
||||
#include "XVTPwr.h"
|
||||
#include "AppDef.h"
|
||||
#include PAFactory_i
|
||||
|
||||
// Project factory class definition:
|
||||
|
||||
class CGUIFactory : public PAFactory
|
||||
{
|
||||
public:
|
||||
|
||||
enum LayerID {
|
||||
DEFAULT=0
|
||||
};
|
||||
|
||||
CGUIFactory(void);
|
||||
|
||||
CGUIFactory& operator[](LayerID theLayer);
|
||||
void SetDefaultLayer(LayerID theLayer);
|
||||
LayerID GetDefaultLayer(void) const;
|
||||
long GetLayerBase(LayerID theLayer);
|
||||
|
||||
protected:
|
||||
|
||||
friend class CGUIFactoryInit;
|
||||
|
||||
static int itIsInitialized;
|
||||
|
||||
};
|
||||
|
||||
extern CGUIFactory GUIFactory;
|
||||
#endif
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#ifndef URL_RECT
|
||||
#define URL_RECT(a,b,c,d) a, b, c, d
|
||||
#endif
|
||||
#include "faccmd.h"
|
||||
#include "images.url"
|
||||
#include "strings.url"
|
||||
|
||||
|
||||
|
||||
/* Definition of menubar G4WinMB for DEFAULT layer */
|
||||
|
||||
menubar G4WinMB+DEFAULT_BASE
|
||||
menu G4WinMB+DEFAULT_BASE
|
||||
submenu FILE_MENU_1015+DEFAULT_BASE "File"
|
||||
submenu M_Setup+DEFAULT_BASE "Commands"
|
||||
submenu M_Control+DEFAULT_BASE "Control"
|
||||
submenu M_Palettes+DEFAULT_BASE "Palettes"
|
||||
submenu HELP_MENU_1015+DEFAULT_BASE "Help"
|
||||
|
||||
menu FILE_MENU_1015+DEFAULT_BASE
|
||||
item M_FILE_SAVE "Save Log"
|
||||
item M_FILE_SAVE_AS "Save Log As..."
|
||||
item M_FILE_PRINT "Print Log..."
|
||||
separator
|
||||
item M_FILE_QUIT "Exit"
|
||||
|
||||
menu M_Setup+DEFAULT_BASE
|
||||
item M_Retrieve_Commands "Retrieve Commands"
|
||||
separator
|
||||
item M_Enter_Parameters_for_selected_command "Enter Parameters for selected command"
|
||||
item M_Execute_Selected_Command "Execute Selected Command"
|
||||
|
||||
menu M_Control+DEFAULT_BASE
|
||||
item M_Start_Geant "Start Geant"
|
||||
item M_Stop_Geant "Stop Geant"
|
||||
separator
|
||||
item M_Pause_Geant "Pause Geant"
|
||||
item M_Resume_Geant "Resume_Geant"
|
||||
separator
|
||||
item M_Quit_Geant "Quit Geant"
|
||||
|
||||
menu M_Palettes+DEFAULT_BASE
|
||||
item M_Commands "Commands"
|
||||
|
||||
menu HELP_MENU_1015+DEFAULT_BASE
|
||||
item M_HELP_ONWINDOW "This Window"
|
||||
separator
|
||||
item M_On_command "On command"
|
||||
separator
|
||||
item M_HELP_VERSION "About..."
|
||||
|
||||
/* Definition of menubar OutputWinMB for DEFAULT layer */
|
||||
|
||||
menubar OutputWinMB+DEFAULT_BASE
|
||||
menu OutputWinMB+DEFAULT_BASE
|
||||
submenu FILE_MENU_1044+DEFAULT_BASE "File"
|
||||
submenu HELP_MENU_1044+DEFAULT_BASE "Help"
|
||||
|
||||
menu FILE_MENU_1044+DEFAULT_BASE
|
||||
item M_FILE_SAVE "Save Log"
|
||||
item M_FILE_SAVE_AS "Save Log As"
|
||||
separator
|
||||
item M_FILE_PRINT "Print Log"
|
||||
|
||||
menu HELP_MENU_1044+DEFAULT_BASE
|
||||
item M_HELP_ONWINDOW "This Window"
|
||||
separator
|
||||
item M_HELP_VERSION "About"
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
IMAGE 1000 "/afs/cern.ch/user/s/sprior/geant4_current_code/geant4alpha/prototype/interfaces/xvt_standalone_test/HP_GUI/bitmaps/small/smallsave.bmp"
|
||||
IMAGE 1001 "/afs/cern.ch/user/s/sprior/geant4_current_code/geant4alpha/prototype/interfaces/xvt_standalone_test/HP_GUI/bitmaps/small/smallsaveas.bmp"
|
||||
IMAGE 1002 "/afs/cern.ch/user/s/sprior/geant4_current_code/geant4alpha/prototype/interfaces/xvt_standalone_test/HP_GUI/bitmaps/small/smallprint.bmp"
|
||||
IMAGE 1003 "/afs/cern.ch/user/s/sprior/geant4_current_code/geant4alpha/prototype/interfaces/xvt_standalone_test/HP_GUI/bitmaps/small/smallstart3d.bmp"
|
||||
IMAGE 1004 "/afs/cern.ch/user/s/sprior/geant4_current_code/geant4alpha/prototype/interfaces/xvt_standalone_test/HP_GUI/bitmaps/small/smallstop3d.bmp"
|
||||
IMAGE 1005 "/afs/cern.ch/user/s/sprior/geant4_current_code/geant4alpha/prototype/interfaces/xvt_standalone_test/HP_GUI/bitmaps/small/smallpause3d.bmp"
|
||||
IMAGE 1006 "/afs/cern.ch/user/s/sprior/geant4_current_code/geant4alpha/prototype/interfaces/xvt_standalone_test/HP_GUI/bitmaps/small/smallresume3d.bmp"
|
||||
IMAGE 1007 "/afs/cern.ch/user/s/sprior/geant4_current_code/geant4alpha/prototype/interfaces/xvt_standalone_test/HP_GUI/bitmaps/small/smallquit3d.bmp"
|
||||
IMAGE 1008 "/afs/cern.ch/user/s/sprior/geant4_current_code/geant4alpha/prototype/interfaces/xvt_standalone_test/HP_GUI/bitmaps/small/gtox.bmp"
|
||||
IMAGE 1009 "/afs/cern.ch/user/s/sprior/geant4_current_code/geant4alpha/prototype/interfaces/xvt_standalone_test/HP_GUI/bitmaps/small/xtog.bmp"
|
||||
IMAGE 1010 "/afs/cern.ch/user/s/sprior/geant4_current_code/geant4alpha/prototype/interfaces/xvt_standalone_test/HP_GUI/bitmaps/small/command.bmp"
|
||||
IMAGE 1011 "/afs/cern.ch/user/s/sprior/geant4_current_code/geant4alpha/prototype/interfaces/xvt_standalone_test/HP_GUI/bitmaps/small/helpcom.bmp"
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
This is version 4.5 of XVT-Architect.
|
||||
This file was automatically generated by XVT-Architect,
|
||||
Do not modify its contents.
|
||||
*/
|
||||
|
||||
#include "facstr.h"
|
||||
|
||||
|
||||
// Strings for DEFAULT layer
|
||||
string (1016+GUIStringIDBase) "Control Window"
|
||||
|
||||
@@ -0,0 +1,211 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: g4xvtdoc.cxx,v 2.1 1998/07/12 02:39:03 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*********************************************************************
|
||||
*
|
||||
Copyright (c) 1996
|
||||
|
||||
File Name: G4XvtDoc.cxx
|
||||
|
||||
Implements a document class to manage data
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
#include "XVTPwr.h"
|
||||
#include "AppDef.h"
|
||||
|
||||
#include GUI_i
|
||||
#include G4XvtDoc_i
|
||||
|
||||
#include G4XvtWin_i
|
||||
|
||||
#include NScrollText_i
|
||||
#include CStatusBar_i
|
||||
|
||||
// Define the Run-Time Type Identification for this class
|
||||
// PWRRegisterClass1(G4XvtDoc, G4XvtDocID, "G4XvtDoc", CDocument)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Document class constructor
|
||||
//
|
||||
// Create and Initialize the internal data objects for this class
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
G4XvtDoc::G4XvtDoc( CApplication * theApplication, PWRID theDocumentId )
|
||||
: CDocument( theApplication, theDocumentId )
|
||||
{
|
||||
// If the internal data object is derived from CModel, you may also
|
||||
// want to instantiate a CController for the data, and take advantage
|
||||
// of the automatic data propagation
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Document class destructor
|
||||
//
|
||||
// Delete the internal data objects for this class
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
G4XvtDoc::~G4XvtDoc( void )
|
||||
{
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BuildWindow
|
||||
//
|
||||
// Create the default view(s) of this data
|
||||
//
|
||||
// This method is automatically called by the base class methods
|
||||
// when new document objects are created or opened.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void G4XvtDoc::BuildWindow( void )
|
||||
{
|
||||
// Create all window objects associated with this document
|
||||
// that have the AutoCreate option specified in XVT-Architect.
|
||||
|
||||
GUIFactory.DoCreateWindows( this, G4Doc, FALSE, &itsData );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DoCommand
|
||||
//
|
||||
// Handle commands here that have to do with accessing data, or that create,
|
||||
// destroy or otherwise manage the window objects of the application.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void G4XvtDoc::DoCommand( long theCommand, void * theData )
|
||||
{
|
||||
switch( theCommand )
|
||||
{
|
||||
case NULLcmd:
|
||||
// stop propagation of "undefined" commands
|
||||
break;
|
||||
|
||||
default:
|
||||
CDocument::DoCommand( theCommand, theData );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DoMenuCommand
|
||||
//
|
||||
// Handle menu items here that have to do with accessing data, or that create,
|
||||
// destroy or otherwise manage the window objects of the application.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void G4XvtDoc::DoMenuCommand(
|
||||
MENU_TAG theMenuItem,
|
||||
BOOLEAN isShiftKey,
|
||||
BOOLEAN isControlKey )
|
||||
{
|
||||
switch( theMenuItem )
|
||||
{
|
||||
case NULLcmd:
|
||||
// stop propagation of "undefined" commands
|
||||
break;
|
||||
|
||||
default:
|
||||
CDocument::DoMenuCommand( theMenuItem, isShiftKey, isControlKey );
|
||||
break;
|
||||
}
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Save
|
||||
//
|
||||
// Called by DoSave(). Do the actual work of saving the data.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
BOOLEAN G4XvtDoc::Save( void )
|
||||
{
|
||||
SetSave( FALSE );
|
||||
return( !NeedsSaving( ) );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Open
|
||||
//
|
||||
// Called by DoOpen(). Do the actual work of restoring the object from
|
||||
// a data source.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
BOOLEAN G4XvtDoc::Open( void )
|
||||
{
|
||||
// Add code here to set internal data members of the class based
|
||||
// on information read from some data source
|
||||
|
||||
SetSave( FALSE );
|
||||
return( !NeedsSaving( ) );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DoSave
|
||||
//
|
||||
// This method is automatically called when the File Save menu option is
|
||||
// selected. Write out the contents of this document object to the path
|
||||
// specified in the internal FILE_SPEC data member.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
BOOLEAN G4XvtDoc::DoSave( void )
|
||||
{
|
||||
if( itsXVTFilePointer && itsXVTFilePointer -> name[0] )
|
||||
return( Save( ) );
|
||||
else
|
||||
return( DoSaveAs( ) );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DoOpen
|
||||
//
|
||||
// This method is automatically called when the File Save menu option is
|
||||
// selected. Initialize the contents of this document object from the file
|
||||
// path in the internal FILE_SPEC data member. Put up the File Open dialog
|
||||
// if no file name has been assigned yet.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
BOOLEAN G4XvtDoc::DoOpen( void )
|
||||
{
|
||||
if( !itsXVTFilePointer )
|
||||
{
|
||||
itsXVTFilePointer = new FILE_SPEC;
|
||||
itsXVTFilePointer -> type[0] = 0;
|
||||
itsXVTFilePointer -> name[0] = 0;
|
||||
xvt_fsys_get_default_dir( &itsXVTFilePointer -> dir );
|
||||
}
|
||||
|
||||
switch( xvt_dm_post_file_open( itsXVTFilePointer,
|
||||
"Enter a new file to open:" ) )
|
||||
{
|
||||
case FL_OK:
|
||||
if( Open( ) )
|
||||
{
|
||||
BuildWindow( );
|
||||
return( TRUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
case FL_BAD:
|
||||
case FL_CANCEL:
|
||||
default:
|
||||
return( FALSE );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: g4xvtdoc.h,v 2.1 1998/07/12 02:39:03 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/********************************************************************
|
||||
*
|
||||
Copyright (c) 1996
|
||||
|
||||
File Name: G4XvtDoc.h
|
||||
Author:
|
||||
Date:
|
||||
|
||||
Class: G4XvtDoc
|
||||
Inheritance: CDocument->G4XvtDoc
|
||||
Helper(s):
|
||||
|
||||
Purpose: This is an example of how to override the minimal set of
|
||||
methods of CDocument. It initializes data maintained by
|
||||
the class, creates a window in which to display the data,
|
||||
implements methods for handling requests to access the
|
||||
data, and provides a basic skeleton for persistence.
|
||||
|
||||
Usage: Override or add methods as necessary.
|
||||
|
||||
Modifications:
|
||||
*
|
||||
********************************************************************/
|
||||
|
||||
#ifndef G4XvtDoc_H
|
||||
#define G4XvtDoc_H
|
||||
|
||||
#include "XVTPwr.h"
|
||||
#include "AppDef.h"
|
||||
|
||||
#include GUI_i
|
||||
#include CDocument_i
|
||||
|
||||
#ifdef DSP_RELEASE
|
||||
#include G4XvtDoc_f
|
||||
#endif
|
||||
|
||||
//#include CTypeInfo_i
|
||||
|
||||
class G4XvtDoc : public CDocument
|
||||
{
|
||||
public:
|
||||
G4XvtDoc( CApplication * theApplication = G -> GetApplication( ),
|
||||
PWRID theDocumentId = G -> GetId( ) );
|
||||
virtual ~G4XvtDoc( void );
|
||||
|
||||
virtual void BuildWindow( void );
|
||||
virtual void DoCommand( long theCommand, void * theData = NULL );
|
||||
virtual void DoMenuCommand( MENU_TAG theMenuItem,
|
||||
BOOLEAN isShiftKey, BOOLEAN isControlKey );
|
||||
|
||||
virtual BOOLEAN DoSave( void );
|
||||
virtual BOOLEAN DoOpen( void );
|
||||
|
||||
virtual BOOLEAN Save( void );
|
||||
virtual BOOLEAN Open( void );
|
||||
|
||||
protected:
|
||||
// By default, copy and assignment are disallowed
|
||||
|
||||
G4XvtDoc( const G4XvtDoc& theDocument ) : CDocument( theDocument ) { }
|
||||
G4XvtDoc& operator=( const G4XvtDoc& theDocument ) { return( *this ); }
|
||||
|
||||
private:
|
||||
G4DocData itsData;
|
||||
|
||||
WINDOW theWin;
|
||||
|
||||
// PWRClassInfo
|
||||
};
|
||||
|
||||
#endif // G4XvtDoc_H
|
||||
@@ -0,0 +1,265 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: g4xvtgui.cxx,v 2.1 1998/07/12 02:39:04 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*********************************************************************
|
||||
*
|
||||
Copyright (c) 1996
|
||||
|
||||
File Name: G4XvtGUI.cxx
|
||||
|
||||
Implements the application class
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
#include "XVTPwr.h"
|
||||
#include "AppDef.h"
|
||||
|
||||
#include GUI_i
|
||||
#include G4XvtGUI_i
|
||||
#include CGlobalClassLib_i
|
||||
#include CTaskWin_i
|
||||
#include CDocument_i
|
||||
#include CMenuBar_i
|
||||
#include "rw/ordcltn.h"
|
||||
|
||||
#ifdef DSP_RELEASE
|
||||
#include CTaskWin_f
|
||||
#endif
|
||||
|
||||
// Define the Run-Time Type Identification for this class
|
||||
// PWRRegisterClass1(G4XvtGUI, G4XvtGUIID, "G4XvtGUI", CApplication)
|
||||
|
||||
// --- Include attachment files --- //
|
||||
#include CToolBarAttachment_i
|
||||
#include CAttachmentFrame_i
|
||||
// #include CUserWin_f
|
||||
#include G4XvtWin_f
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Application class constructor
|
||||
//
|
||||
// Defines the initial state of the application object.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
G4XvtGUI::G4XvtGUI( CApplication::ApplicationByteAware theAppByte ) : CApplication( theAppByte )
|
||||
{
|
||||
// Set any System Attribute Table values that
|
||||
// need to be set before GUI initialization
|
||||
|
||||
#ifdef DSP_RELEASE
|
||||
GUIFactory.ConstructApplication( this, G4XvtGUI1002 );
|
||||
#endif
|
||||
|
||||
// For example...
|
||||
#if 0
|
||||
#if (XVTWS == WINWS || XVTWS == NTWS )
|
||||
|
||||
// Follow the MDI look and feel when running on MS-Windows
|
||||
xvt_vobj_set_attr( NULL_WIN, ATTR_WIN_MDI, TRUE );
|
||||
|
||||
#endif
|
||||
|
||||
#if (XVTWS == WINWS || XVTWS == NTWS || XVTWS == PMWS)
|
||||
|
||||
// Allow drawing in the task window:
|
||||
xvt_vobj_set_attr(NULL_WIN, ATTR_WIN_PM_DRAWABLE_TWIN, TRUE);
|
||||
|
||||
#endif
|
||||
|
||||
#if (XVTWS == MTFWS)
|
||||
|
||||
// When running on Motif, don't display the "ghost" window
|
||||
xvt_vobj_set_attr( NULL_WIN, ATTR_X_DISPLAY_TASK_WIN, FALSE );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Application class destructor
|
||||
//
|
||||
// Delete the internal data objects for this class
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
G4XvtGUI::~G4XvtGUI( void )
|
||||
{
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Startup
|
||||
//
|
||||
// Defines the startup behavior for the application - whether an
|
||||
// initial about box is created, or a login screen is presented,
|
||||
// or an initial document object and its associated windows are
|
||||
// created, etc. Also, Initialize application level objects here.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void G4XvtGUI::StartUp( void )
|
||||
{
|
||||
// NOTE: The base class method must be called before adding any
|
||||
// of your own code.
|
||||
CApplication::StartUp();
|
||||
|
||||
#ifdef DSP_RELEASE
|
||||
GUIFactory.InitializeApplication( this, G4XvtGUI1002 );
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#if (XVTWS == WINWS || XVTWS == NTWS || XVTWS == PMWS)
|
||||
// To instantiate the views sketched out in the TaskWindow, use
|
||||
// the following code:
|
||||
CTaskWin* aTaskWindow = G->GetTaskWin();
|
||||
GUIFactory.DoCreateViews( aTaskWindow, CTaskWin1004, TRUE );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Create an instance of its documents and display their initial windows
|
||||
DoNew();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// ShutDown
|
||||
//
|
||||
// Defines the termination behavior for the application - typically
|
||||
// it deletes application level objects that were created in StartUp.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void G4XvtGUI::ShutDown( void )
|
||||
{
|
||||
// Base class method must be called as the last thing this method does
|
||||
CApplication::ShutDown();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SetUpMenus
|
||||
//
|
||||
// Initialize the application menubar - the one that is
|
||||
// available when there are no windows with menubars available.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void G4XvtGUI::SetUpMenus( CMenuBar* /*theMenuBar*/ )
|
||||
{
|
||||
// Example code to Initialize default menus
|
||||
// theMenuBar->SetEnabled( M_FILE_NEW, TRUE );
|
||||
// theMenuBar->SetEnabled( M_FILE_OPEN, TRUE );
|
||||
// theMenuBar->SetEnabled( M_EDIT, FALSE );
|
||||
// theMenuBar->SetEnabled( M_FONT_POPUP, FALSE );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DoCommand
|
||||
//
|
||||
// Handle commands here that have to do with behavior specific
|
||||
// to the application, or that create, destroy or otherwise
|
||||
// manage the data (document) objects of the application.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void G4XvtGUI::DoCommand( long theCommand, void* theData )
|
||||
{
|
||||
switch ( theCommand )
|
||||
{
|
||||
case NULLcmd: // stop propagation of "undefined" commands
|
||||
break;
|
||||
|
||||
#if 0
|
||||
#if (XVTWS == MTFWS)
|
||||
// if the application is running on motif, Terminate the app when the
|
||||
// last window is closed to Follow motif style guidelines
|
||||
case NOWINDOWcmd:
|
||||
DoClose(); // clean up TaskDoc
|
||||
xvt_app_destroy(); // Terminate the application
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
default:
|
||||
CApplication::DoCommand( theCommand, theData );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DoNew
|
||||
//
|
||||
// This method is automatically called when the New option on the
|
||||
// default File menu is selected. Create all document objects
|
||||
// that had the AutoCreate option specified in XVT-Architect.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
BOOLEAN G4XvtGUI::DoNew( void )
|
||||
{
|
||||
RWOrdered anExistingDocList( *itsDocuments );
|
||||
GUIFactory.DoCreateDocuments( this, G4XvtGUI1002, FALSE, &itsData );
|
||||
RWOrderedIterator nextDoc( *itsDocuments );
|
||||
CDocument* aDoc;
|
||||
RWOrdered orphanedDocs;
|
||||
BOOLEAN allDocsCreated = TRUE;
|
||||
while ( (aDoc = (CDocument*)nextDoc()) != NULL )
|
||||
if ( !anExistingDocList.find( aDoc ) && !aDoc->DoNew() )
|
||||
{
|
||||
orphanedDocs.append( aDoc );
|
||||
allDocsCreated = FALSE;
|
||||
}
|
||||
orphanedDocs.clearAndDestroy();
|
||||
return allDocsCreated;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DoOpen
|
||||
//
|
||||
// This method is automatically called when the Open option on the
|
||||
// default File menu is selected. Create a new document object,
|
||||
// allow the user to select a file, and Initialize the document
|
||||
// object from the file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
BOOLEAN G4XvtGUI::DoOpen( void )
|
||||
{
|
||||
RWOrdered anExistingDocList( *itsDocuments );
|
||||
GUIFactory.DoCreateDocuments( this, G4XvtGUI1002, FALSE, &itsData );
|
||||
RWOrderedIterator nextDoc( *itsDocuments );
|
||||
CDocument* aDoc;
|
||||
RWOrdered orphanedDocs;
|
||||
BOOLEAN allDocsCreated = TRUE;
|
||||
while ( (aDoc = (CDocument*)nextDoc()) != NULL )
|
||||
if ( !anExistingDocList.find( aDoc ) && !aDoc->DoOpen() )
|
||||
{
|
||||
orphanedDocs.append( aDoc );
|
||||
allDocsCreated = FALSE;
|
||||
}
|
||||
orphanedDocs.clearAndDestroy();
|
||||
return allDocsCreated;
|
||||
}
|
||||
|
||||
|
||||
// --- New code for the attachment stuff --- //
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// GetAttachmentFrame
|
||||
//
|
||||
// Returns a pointer to the attacment frame created for the application's
|
||||
// task window. A return value of NULL indicates that no attachment frame
|
||||
// was created.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
CAttachmentFrame* G4XvtGUI::GetAttachmentFrame() const
|
||||
{
|
||||
return itsAttachmentFrame;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: g4xvtgui.h,v 2.1 1998/07/12 02:39:05 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/********************************************************************
|
||||
*
|
||||
Copyright (c) 1996
|
||||
|
||||
File Name: G4XvtGUI.h
|
||||
Author: Simon Prior
|
||||
Date:
|
||||
|
||||
Class: G4XvtGUI
|
||||
Inheritance: CApplication->G4XvtGUI
|
||||
Helper(s): G4XvtDoc, CShellWin
|
||||
|
||||
Purpose: This is an example of how to override the minimal set of
|
||||
methods of CApplication. It initializes the inherited
|
||||
application, creates a document object to manage the
|
||||
application's data, and implements methods for handling
|
||||
application-level issues.
|
||||
|
||||
Usage: Override or add methods as necessary.
|
||||
|
||||
Modifications:
|
||||
*
|
||||
********************************************************************/
|
||||
|
||||
#ifndef G4XvtGUI_H
|
||||
#define G4XvtGUI_H
|
||||
|
||||
#include "XVTPwr.h"
|
||||
#include "AppDef.h"
|
||||
|
||||
#include GUI_i
|
||||
#include CApplication_i
|
||||
|
||||
#ifdef DSP_RELEASE
|
||||
#include G4XvtGUI_f
|
||||
#endif
|
||||
|
||||
// --- Alert code of the CAttachment frame class use --- //
|
||||
class CAttachmentFrame;
|
||||
|
||||
#include CGlobalClassLib_i
|
||||
#define ATTACHApp ((CAttachApp*) CObjectRWC::G->GetApplication())
|
||||
|
||||
class G4XvtGUI : public CApplication
|
||||
{
|
||||
public:
|
||||
|
||||
G4XvtGUI( CApplication::ApplicationByteAware theAppByte = CApplication::AB_SINGLEBYTE );
|
||||
virtual ~G4XvtGUI( void );
|
||||
|
||||
// --- CAttachApp specific interface --- //
|
||||
|
||||
CAttachmentFrame* GetAttachmentFrame() const;
|
||||
|
||||
virtual void StartUp( void );
|
||||
virtual void ShutDown( void );
|
||||
virtual void SetUpMenus( CMenuBar* theMenuBar );
|
||||
virtual void DoCommand( long theCommand, void* theData = NULL );
|
||||
|
||||
virtual BOOLEAN DoNew( void );
|
||||
virtual BOOLEAN DoOpen( void );
|
||||
|
||||
protected:
|
||||
|
||||
// By default, copy and assignment are disallowed
|
||||
G4XvtGUI( const G4XvtGUI& theApplication ) : CApplication( theApplication ) {}
|
||||
G4XvtGUI& operator=( const G4XvtGUI& theApplication ) { return *this; }
|
||||
|
||||
// --- Class data --- //
|
||||
|
||||
CAttachmentFrame* itsAttachmentFrame;
|
||||
|
||||
private:
|
||||
|
||||
G4XvtGUI1002Data itsData;
|
||||
|
||||
// PWRClassInfo
|
||||
};
|
||||
|
||||
#endif // G4XvtGUI_H
|
||||
@@ -0,0 +1,282 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: g4xvtwin.h,v 2.1 1998/07/12 02:39:07 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/********************************************************************
|
||||
*
|
||||
Copyright (c) 1996
|
||||
|
||||
File Name: G4XvtWin.h
|
||||
Author: Simon Prior
|
||||
Date:
|
||||
|
||||
Class: G4XvtWin
|
||||
Inheritance: CWindow->G4XvtWin
|
||||
Helper(s):
|
||||
|
||||
Purpose: This is a window class that has properties that were
|
||||
specified using XVT-Architect. It implements methods
|
||||
to Initialize and manage the state of views nested
|
||||
inside the window.
|
||||
|
||||
Usage: Override or add methods as necessary.
|
||||
|
||||
Modifications:
|
||||
*
|
||||
********************************************************************/
|
||||
|
||||
#ifndef G4XvtWin_H
|
||||
#define G4XvtWin_H
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Define named pipes //
|
||||
// //
|
||||
// Note - if you wish to change the location of where the pipes are //
|
||||
// created edit the following lines putting in the appropriate //
|
||||
// paths. The default is for the pipes to be created in the //
|
||||
// current directory. //
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define XvtToGeant "XvtToGeant.tmp"
|
||||
#define GeantToXvt "GeantToXvt.tmp"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Define file mode/permissions //
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define FILE_MODE (0664 | S_IFIFO)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Include different files depending on what platform you are //
|
||||
// compiling on. //
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef _AIX
|
||||
#include <sys/mode.h> // --- mkfifo utils --- //
|
||||
#endif
|
||||
|
||||
#include <strings.h> // --- bzero function --- //
|
||||
#include <sys/time.h> // --- struct timeval --- //
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h> // --- POSIX standards for stdin, out, err. --- //
|
||||
#include <values.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h> // --- Open, Close, Unlink etc --- //
|
||||
#include <sys/ioctl.h>
|
||||
#include <stdio.h> // --- sscanf, sprintf --- //
|
||||
|
||||
#include "XVTPwr.h"
|
||||
#include "AppDef.h"
|
||||
|
||||
#include GUI_i
|
||||
#include CWindow_i
|
||||
|
||||
#ifdef DSP_RELEASE
|
||||
#include G4XvtWin_f
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// New data structures, one to hold the parameter information of a //
|
||||
// command and one to hold information on the command itself. //
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef struct G4parameterData
|
||||
{
|
||||
CStringRW name;
|
||||
CStringRW guidance;
|
||||
CStringRW defaultValue;
|
||||
CStringRW range;
|
||||
CStringRW candidate;
|
||||
char type;
|
||||
CStringRW omittable;
|
||||
};
|
||||
|
||||
typedef struct G4commandData
|
||||
{
|
||||
int flag;
|
||||
CStringRW name;
|
||||
CStringRW guidance;
|
||||
int numOfParameters;
|
||||
G4parameterData parameters[10];
|
||||
|
||||
// CStringRW bitmapName;
|
||||
|
||||
int commandNumber;
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Variables for the status bar //
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const long NULL_FIELD = 1L;
|
||||
const long STATUS_FIELD = 2L;
|
||||
const long COORDS_FIELD = 3L;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Make code aware of the attachment and mouse handling classes use //
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class CAttachmentFrame;
|
||||
class CAttachment;
|
||||
class CToolBarAttachment;
|
||||
class CToolPalette;
|
||||
class CViewSinkData;
|
||||
class CDragSource;
|
||||
|
||||
class G4XvtWin : public CWindow
|
||||
{
|
||||
public:
|
||||
G4XvtWin(
|
||||
CDocument * theDocument,
|
||||
const CRect& theRegion,
|
||||
const CStringRW& theTitle = NULLString,
|
||||
long theWindowAttributes = WSF_NONE,
|
||||
WIN_TYPE theWindowType = W_DOC,
|
||||
int theMenuBarId = MENU_BAR_RID,
|
||||
WINDOW theParentWindow = TASK_WIN );
|
||||
|
||||
virtual ~G4XvtWin( void );
|
||||
|
||||
BOOLEAN I4XvtWin( void );
|
||||
|
||||
virtual void DoCommand( long theCommand, void * theData = NULL );
|
||||
|
||||
virtual void DoMenuCommand( MENU_TAG theMenuItem,
|
||||
BOOLEAN isShiftKey, BOOLEAN isControlKey );
|
||||
|
||||
virtual void UpdateMenus( CMenuBar * theMenuBar);
|
||||
|
||||
virtual void DoUpdateModel( long theControllerId,
|
||||
long theCommand, const CModel * theModel );
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Overriden timer method //
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
void DoTimer(long theTimerId);
|
||||
|
||||
protected:
|
||||
// By default, copy and assignment are disallowed
|
||||
|
||||
G4XvtWin( const G4XvtWin& theWindow ) : CWindow( theWindow ) { }
|
||||
G4XvtWin& operator=( const G4XvtWin& theWindow ){ return( *this ); }
|
||||
|
||||
private:
|
||||
G4WinData itsData;
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// IPC Data members //
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
int fd_XvtToGeant, fd_GeantToXvt;
|
||||
long theTimer;
|
||||
long interval;
|
||||
WINDOW theWin;
|
||||
char textDump[100];
|
||||
int number;
|
||||
int G4Running;
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// IPC methods //
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
void initTimer(void);
|
||||
void initIPC(void);
|
||||
void startSlave(void);
|
||||
void createNamedPipes(void);
|
||||
void destroyNamedPipes(void);
|
||||
void errorHandler(CStringRW theError);
|
||||
void writeData(CStringRW theString);
|
||||
void ExecuteCommand(void);
|
||||
CStringRW getString(void);
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Command Base data members //
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
G4commandData commandArray[200];
|
||||
int currentPosition, lastPosition;
|
||||
int reading;
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Command Base methods //
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
void initIndex(void);
|
||||
void fillLocalArray(void);
|
||||
void listCommandArray(void); // debugging method
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Palette and attachment data members //
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
CToolPalette* commandPalette;
|
||||
CDragSource* commandSource;
|
||||
CAttachmentFrame* itsAttachmentFrame;
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Palette and attachment methods //
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
void initFrame(void);
|
||||
void initCommandPalette(void);
|
||||
void destroyCommandPalette(void);
|
||||
void destroyDragSource(void);
|
||||
void buildCommandPalettes(void);
|
||||
void regenerateCommandPalette(void);
|
||||
CStringRW retrieveCommand(void);
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Status bar methods //
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
void initStatusBar(void);
|
||||
void setStatus(CStringRW theText);
|
||||
void resetStatus(void);
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Text window methods //
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
void initTextWindows(void);
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Help Method //
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
void showHelp(void);
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Parameter retrieval methods (pops up dialog) //
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
CStringRW getParameters(void);
|
||||
CStringRW getTextCommand(void);
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// Toolbar and enclosed view methods //
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
void activateButtons(void);
|
||||
|
||||
// PWRClassInfo
|
||||
};
|
||||
|
||||
#endif // G4XvtWin_H
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
#---------------------------------------------------------------------
|
||||
#
|
||||
# file: makefile
|
||||
# author: XVT-Architect, XVT Software
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# System settings
|
||||
|
||||
# Modify the following according to your system setup:
|
||||
#
|
||||
# XVT_DSP_DIR path to the xvt directrorie
|
||||
# CC the name of your C++ compiler
|
||||
# LD linker
|
||||
# UIL uil compiler
|
||||
# SFX suffix of C++ source files
|
||||
|
||||
CC = CC
|
||||
LD = CC
|
||||
UIL = /usr/bin/X11/uil
|
||||
SFX = .cxx
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Includes:
|
||||
|
||||
INCLUDE = -I. -I./factory \
|
||||
-I$(XVT_DSP_DIR)/include \
|
||||
-I/usr/include/Motif1.2 \
|
||||
-I/usr/include/X11R5
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Libraries:
|
||||
|
||||
PWRLIBS = $(XVT_DSP_DIR)/lib/libxvtxmpwr450.a
|
||||
PTKLIBS = $(XVT_DSP_DIR)/lib/libxvtxmapi457.a -lxvtxmhb457 -lxvtxmba457
|
||||
LIBS = $(PWRLIBS) $(PTKLIBS) -lxvtxmrw -lMrm -lXm -lXt -lX11 -lPW -lm
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Flags:
|
||||
|
||||
PWRFLAGS = -DSTDH -D_HPUX_SOURCE -DWSMTF -D__hpux -D__unix -D__STDC__
|
||||
CCFLAGS = -Aa +a1 $(PWRFLAGS) $(INCLUDE)
|
||||
LDFLAGS = -Wl,+s +a1 -L$(XVT_DSP_DIR)/lib -L/usr/lib/Motif1.2 -L/usr/lib/X11R5
|
||||
CURLFLAGS = -r mtf12 -s $(INCLUDE)
|
||||
UILFLAGS = -I/usr/include/Motif1.2
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# Default make instructions:
|
||||
|
||||
.SUFFIXES: .url .uil .uid .o $(SFX) .h
|
||||
|
||||
.url.uil:
|
||||
$(XVT_DSP_DIR)/bin/curl $(CURLFLAGS) $<
|
||||
|
||||
.uil.uid:
|
||||
$(UIL) $(UILFLAGS) -o $@ $<
|
||||
|
||||
$(SFX).o:
|
||||
$(CC) $(CCFLAGS) -o $@ -c $<
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# Targets for shell:
|
||||
APPNAME = GUI
|
||||
|
||||
# Shell and factory objects
|
||||
GENERATEDOBJECTS = \
|
||||
g4xvtgui.o \
|
||||
g4xvtdoc.o \
|
||||
XResMgr.o \
|
||||
g4xvtwin.o \
|
||||
cstartup.o \
|
||||
factory/factory.o \
|
||||
factory/faccb0.o \
|
||||
factory/faccb1.o \
|
||||
factory/faccb2.o \
|
||||
factory/faccb3.o \
|
||||
factory/faccb4.o \
|
||||
factory/classes.o
|
||||
|
||||
# other application objects
|
||||
# List all other object files which are needed for your application here
|
||||
APPNAMEOBJECTS =
|
||||
|
||||
OBJECTS = $(GENERATEDOBJECTS) $(APPNAMEOBJECTS)
|
||||
|
||||
$(APPNAME): $(OBJECTS) $(APPNAME).uil $(APPNAME).uid
|
||||
$(LD) $(LDFLAGS) -o $(APPNAME) $(OBJECTS) $(LIBS)
|
||||
|
||||
$(APPNAME).uil: $(APPNAME).url factory/images.url factory/strings.url factory/factory.url
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,487 @@
|
||||
Written by: Simon Prior
|
||||
Date: 25/08/97
|
||||
|
||||
GUI
|
||||
----
|
||||
|
||||
The purpose of this program is to be the first XVT/Geant4 GUI prototype.
|
||||
|
||||
Basic idea: Construct a prototype GUI which interacts with Geant 4.
|
||||
|
||||
Future use: After initial investigation into how XVT can interact etc with
|
||||
Geant, seeing what features I can use/exploit, it should be
|
||||
possible for future XVT GUI developers to build on the work
|
||||
done adding functionality and design ideas thus constructing one
|
||||
possible GUI for use with Geant 4. It should be different in
|
||||
design/features offered from other implementations so as to
|
||||
promote the use of XVT with Geant4 which will cost money (as XVT is
|
||||
not free) rather than the use of say TCL which is free.
|
||||
|
||||
Discoveries and implementation specifics :
|
||||
|
||||
For this part I shall go through the files which I have edited and
|
||||
explain each part - the idea as well as implementation details.
|
||||
|
||||
I will give an abstract view to show my overall idea and then a
|
||||
detailed one which will highlight implementation specifics.
|
||||
|
||||
The two files that do all the work regarding connection to Geant
|
||||
and handling of all user input are "g4xvtwin.h" and "g4xvtwin.cxx"
|
||||
- the 'window' files. These are both well commented.
|
||||
|
||||
Some of the other files have been added to (mainly for the floating
|
||||
dockable palettes - see my Geant4 web page or palette documentation
|
||||
in the 'palettes' directory).
|
||||
|
||||
I shall go through both files with a fine toothed comb and explain
|
||||
as much as possible. (each method will be looked at carefully - if
|
||||
need be).
|
||||
|
||||
==============================================================================
|
||||
|
||||
Abstract view of the prototype:
|
||||
-------------------------------
|
||||
|
||||
OK, start the XVT GUI, GUI then spawns the Geant benchmark program. The user
|
||||
interacts with the GUI via appropriate widgets selecting and executing
|
||||
commands, these are sent to Geant which does the processing, Geant then
|
||||
relays any information back to the user via the GUI.
|
||||
|
||||
==============================================================================
|
||||
|
||||
More Detailed view:
|
||||
-------------------
|
||||
|
||||
My main idea(s) for this interface:
|
||||
|
||||
Basically, the application starts (by executing the XVT GUI
|
||||
executable file).
|
||||
|
||||
This handles all the initialisation required for the IPC mechanism,
|
||||
it is in charge of creating the named pipes and opens them at the
|
||||
XVT end with the appropriate permissions on them.
|
||||
|
||||
Then it handles the startup of the Geant 'xvt.benchmark' file.
|
||||
|
||||
It basically forks off a process and execs the xvt.benchmark file.
|
||||
|
||||
See the xvt.benchmark documentation for the ideas behind that and a
|
||||
detailed description of what happens when it is executed.
|
||||
|
||||
==============================================================================
|
||||
|
||||
I will now cover some of the major parts and ideas of the interface before
|
||||
analysing the individual methods:
|
||||
|
||||
==============================================================================
|
||||
|
||||
The named pipes:
|
||||
----------------
|
||||
|
||||
This was the chosen IPC method after reviewing several IPC mechanisms (See
|
||||
the IPC section on my Geant4 web page). It works like the twoWay
|
||||
program - incorporating a timer in the XVT end to read the pipe, a suitable
|
||||
way of testing the pipe before reading it (blocking issues) etc - see the
|
||||
early work in the IPC section or the program code for details.
|
||||
|
||||
The data Structures:
|
||||
--------------------
|
||||
|
||||
Now, this was a new idea. I had to get all the command information from Geant
|
||||
and transfer it via the pipes and then use it to build a suitable dynamic
|
||||
widget at the XVT end. Therefore, the idea behind it all is simple, build a
|
||||
data structure at the Geant end and fill it with command information, then when
|
||||
requested by XVT, send all the information down the pipe. At the XVT end, parse
|
||||
this information into a data structure at this end and then build the widget
|
||||
etc using this data structures contained information.
|
||||
|
||||
The new data structures I defined were G4CommandData and G4ParameterData. (See
|
||||
the header file "g4xvtwin.h" for implementation specifics.
|
||||
|
||||
Some important issues were encountered. It became clear that a certain
|
||||
'protocol' had to be defined so that I could recognise command information etc
|
||||
- this will be explained when documenting the individual method in detail.
|
||||
|
||||
The Palettes:
|
||||
-------------
|
||||
|
||||
These were a new provided widget with XVT version 4.5 and were exactly what I
|
||||
required. (I was working to emulate their behaviour before the release came
|
||||
out). The best feature of them is that they are dynamic and can be created at
|
||||
run time etc - thus giving the flexibility needed for Geant.
|
||||
|
||||
As they are like an artists palette the first point is that you make a
|
||||
selection and it stays selected - this suited my idea well as I had the idea
|
||||
to have all the command information in one palette - i.e. select a command from
|
||||
this palette, then have a button which you press to 'Execute' the selected
|
||||
command. I have since added a 'Help' button which you can also press - this
|
||||
gives a small message about the selected command.
|
||||
|
||||
- This is my idea for command entry to date:
|
||||
|
||||
1.. Select command.
|
||||
2.. If help is required click help button for information.
|
||||
3.. If you are sure, press Execute which will dispatch the command to Geant.
|
||||
|
||||
Thus it gives a level of security so that selecting a command doesn't
|
||||
necessarily mean it gets executed - until you EXPLICITLY say so.
|
||||
|
||||
Command Retrieval:
|
||||
------------------
|
||||
|
||||
The idea behind this is quite clever. OK, firstly, on the geant side of
|
||||
things. This reads all the commands from the Geant command tree using 'get'
|
||||
methods from the Command tree class. All of the commands are read into a type
|
||||
I have defined - called G4CommandData - this basically holds all the
|
||||
information on a command and its parameters. (see data structures section
|
||||
mentioned earlier)
|
||||
|
||||
Now back to the GUI end. After this has initialised itself and listed all the
|
||||
available commands the user can click on a button to retrieve all the available
|
||||
commands from Geant. When this happens a command is sent from the GUI down the
|
||||
named pipes to Geant. When Geant receives this command it parses the command
|
||||
array at that end and writes all the information down the named pipe to XVT.
|
||||
|
||||
XVT also has the same data structure declared and basically reads all the
|
||||
information from the pipe into its own structure.
|
||||
|
||||
After this is done the floating command palette is constructed using the
|
||||
information contained in the data structure at the XVT end.
|
||||
|
||||
I have defined a protocol so that XVT recognises when the commands are coming
|
||||
down the pipe.
|
||||
|
||||
As the timer ticks and calls the DoTimer method this checks to see if there is
|
||||
anything present in the pipe - if so reads it and decides what to do with it.
|
||||
|
||||
When it receives the string "comTree" it knows that the commands are coming.
|
||||
|
||||
I basically bypass the timer for a while and then call some methods to deal
|
||||
with the incoming data. The first string that comes through is an integer
|
||||
which tells me exactly how many command entries there are - then a loop can
|
||||
be entered to fill the array at the XVT end with that number of entries.
|
||||
|
||||
All the appropriate casting and type changes are handled correctly. (i.e.
|
||||
converting from string to integer).
|
||||
|
||||
You have to be careful when reading the pipe that you check there is something
|
||||
present before actually reading it - especially in this case when order of
|
||||
information is critical - thats why I defined a method (getString) to handle
|
||||
correct reading of the named pipe. (it waits until thers is something present
|
||||
before reading and returning the string).
|
||||
|
||||
==============================================================================
|
||||
|
||||
Now I shall look at the header file g4xvtwin.h and then I shall look at
|
||||
the implementation file g4xvtwin.cxx in detail to explain what the methods
|
||||
do etc.
|
||||
|
||||
==============================================================================
|
||||
|
||||
g4xvtwin.h:
|
||||
-----------
|
||||
|
||||
First thing to note in this file is the #defines which define XvtToGeant and
|
||||
GeantToXvt. These are names I will use in my code for the named pipes which
|
||||
I set up for communication between the XVT executable and the Geant4 executable.
|
||||
|
||||
The next #define simply defines the file mode (i.e. appropriate UNIX
|
||||
permissions) to open the named pipes with.
|
||||
|
||||
After this come several #includes which include various functions I will
|
||||
use in the code.
|
||||
|
||||
After this I define 2 new types called 'G4parameterData' and 'G4commandData'.
|
||||
These are structures to hold information about commands.
|
||||
|
||||
After this are the usual method declarations and data member definitions
|
||||
etc. - These are commented.
|
||||
|
||||
******************************************************************************
|
||||
*************************** IMPORTANT ***************************************
|
||||
*** ***
|
||||
*** The declaration of 'G4commandData commandArray[200];' in the header ***
|
||||
*** file basically declares how many commands can be stored in the array ***
|
||||
*** and then used to create the command palette. ***
|
||||
*** IF during future use the GUI coredumps when creating the command ***
|
||||
*** palette it is most likely that there are greater that 200 commands ***
|
||||
*** - especially as commands are being added all the time. All you need ***
|
||||
*** to do is increase this value and everything will work fine again. ***
|
||||
*** ***
|
||||
******************************************************************************
|
||||
|
||||
==============================================================================
|
||||
|
||||
g4xvtwin.cxx:
|
||||
-------------
|
||||
|
||||
I shall cover the methods which I have written or added code to - the ones
|
||||
automatically generated are self explanatory and have good commenting (see
|
||||
file for more details).
|
||||
|
||||
The Constructor:
|
||||
----------------
|
||||
|
||||
Initialisation occurs here by calling several initialiser functions - see their
|
||||
own documentation later on (next).
|
||||
|
||||
initIndex:
|
||||
----------
|
||||
|
||||
This initialises the command base array indexing variables - very simple.
|
||||
|
||||
initStatusBar:
|
||||
--------------
|
||||
|
||||
This sets up the status bars fields with some initial values.
|
||||
|
||||
initTimer:
|
||||
----------
|
||||
|
||||
Starts the XVT timer (on every time interval (which the coder can alter) it
|
||||
activates the DoTimer method).
|
||||
|
||||
initIPC:
|
||||
--------
|
||||
|
||||
This sets the value of the pipe reading variable (i.e. how many bytes are
|
||||
read in a single read operation and then calls createNamedPipes and startSlave.
|
||||
|
||||
initFrame:
|
||||
----------
|
||||
|
||||
Creates an attachment frame and allows attachment to all sides.
|
||||
|
||||
createNamedPipes:
|
||||
-----------------
|
||||
|
||||
This method creates the named pipes required in the application.
|
||||
|
||||
It first creates the pipes and then opens them.
|
||||
|
||||
The XvtToGeant pipe with write permission only,
|
||||
the GeantToXvt with read permission only.
|
||||
|
||||
The program uses the errorHandler method to report errors because the
|
||||
program should terminate if IPC setup fails.
|
||||
|
||||
destroyNamedPipes:
|
||||
------------------
|
||||
|
||||
This method closes and unlinks all the open named pipes.
|
||||
|
||||
startSlave:
|
||||
-----------
|
||||
|
||||
This method forks and exec's the other process (xvt.benchmark - the Geant
|
||||
executable).
|
||||
|
||||
This method also uses the errorHandler to report errors because if the
|
||||
fork or Exec fail the program should terminate.
|
||||
|
||||
The fork and exec are UNIX specific - for more details on their use see a UNIX
|
||||
manual or man pages.
|
||||
|
||||
DoTimer:
|
||||
--------
|
||||
|
||||
Every time the timer ticks this method checks to see if the file descriptor
|
||||
can be read without blocking (i.e. there is something in the pipe), if
|
||||
there is it grabs the data from the pipe, if you are not in the process of
|
||||
reading all the commands from Geant it then checks if the string is equal to
|
||||
"comTree" which indicates all the commands are coming from Geant and
|
||||
different action should be taken. If it isn't comTree then it simply
|
||||
displays the string in the Main log area.
|
||||
|
||||
The different action to take is to call some other methods to do the reading of
|
||||
commands and building of the command palette. (discussed later.)
|
||||
|
||||
Refer to code for the implementation specifics.
|
||||
|
||||
errorHandler:
|
||||
-------------
|
||||
|
||||
A general purpose error handler. It can be called by any method. A string
|
||||
is passed so that this method can post a dialog box to the user stating
|
||||
where the program fault occurs then quit the GUI.
|
||||
|
||||
The key point is that this method should be called when processing should no
|
||||
longer continue i.e. the GUI should be killed.
|
||||
|
||||
writeData:
|
||||
----------
|
||||
|
||||
Writes the passed string to the Command log window and the XvtToGeant
|
||||
pipe - i.e. will send the string to Geant (commands!) for processing.
|
||||
|
||||
initCommandPalette:
|
||||
-------------------
|
||||
|
||||
Allocate storage space for a tool palette.
|
||||
|
||||
destroyCommandPalette:
|
||||
----------------------
|
||||
|
||||
Free up storage space allocated for the command palette.
|
||||
|
||||
buildCommandPalettes:
|
||||
---------------------
|
||||
|
||||
This method builds the palettes of commands available to the user.
|
||||
|
||||
This basically parses the commandArray that was received from Geant and
|
||||
builds up the command palette 'on-the-fly' from this information.
|
||||
|
||||
It checks the flag of the command in the array to see whether it is
|
||||
a 'directory', a command or a cascade. (this is denoted by the flag being a
|
||||
0, 1 or 2 and this is set at the Geant end when it reads in the commands).
|
||||
|
||||
Once it has this information it can decide how to handle it.. If it is a
|
||||
'directory' - i.e. a category of command it must have its own sub-palette
|
||||
so this can be constructed. If it is a command it must be a button in the
|
||||
current sub-palette and if it is a cascade it must be a sub-palette of the
|
||||
current palette - see code for implementation specifics.
|
||||
|
||||
destroyDragSource:
|
||||
------------------
|
||||
|
||||
This method destroys the space allocated for the drag source.
|
||||
|
||||
setStatus:
|
||||
----------
|
||||
|
||||
This method places the passed string into the status field of the status
|
||||
bar.
|
||||
|
||||
resetStatus:
|
||||
------------
|
||||
|
||||
This method completely blanks the status field of the status bar.
|
||||
|
||||
retrieveCommand:
|
||||
----------------
|
||||
|
||||
This method checks the command palette to see which button has been pressed
|
||||
then it will scan the command array to find the command that corresponds to
|
||||
the users selection and returns the command string to be sent to Geant.
|
||||
|
||||
It also tests to see if the command that is selected for execution requires a
|
||||
parameter and if so calls 'getParameters' to obtain this from the user.
|
||||
|
||||
initTextWindows:
|
||||
----------------
|
||||
|
||||
This method simply puts a title in the Text windows to start things off.
|
||||
|
||||
fillLocalArray:
|
||||
---------------
|
||||
|
||||
This method fills the command data structure at the XVT end with data that is
|
||||
being received from the Geant end. It uses the method 'getString' to grab the
|
||||
strings from the pipe without error.
|
||||
|
||||
showHelp:
|
||||
---------
|
||||
|
||||
This method is called when the user clicks on the 'help' button.
|
||||
|
||||
It looks which is the current selected tool and retrieves the guidance for
|
||||
that tool - then puts this in the text widget and a pop up window.
|
||||
|
||||
getParameters:
|
||||
--------------
|
||||
|
||||
This method retrieves parameters from the user via dialog boxes. - called by
|
||||
retrieveCommand.
|
||||
|
||||
getTextCommand:
|
||||
---------------
|
||||
|
||||
This method retrieves parameters from the user via dialog boxes. This method
|
||||
is very similar to 'getParameters' however this one is called if the user
|
||||
wishes to type a command in instead of using the command palette widget.
|
||||
|
||||
executeCommand:
|
||||
---------------
|
||||
|
||||
When the user clicks on the execute button this method is called.
|
||||
|
||||
It retrieves the command (with parameters if necessary) and writes it
|
||||
down the named pipe to Geant to deal with.
|
||||
|
||||
getString:
|
||||
----------
|
||||
|
||||
This method grabs the string that is located in the pipe and returns it
|
||||
to the caller - provided there is something present in the pipe.
|
||||
|
||||
activateButtons:
|
||||
----------------
|
||||
|
||||
This method enables the 'exec' buttons on the toolbar. It is called just
|
||||
after the user has retrieved the commands and built the widget.
|
||||
|
||||
It first enables the buttons and then refreshes the screen by redrawing
|
||||
them.
|
||||
|
||||
I have tried to limit the mistakes a user could make and this is a very good
|
||||
way of doing just that - by disabling buttons/widgets etc that could cause
|
||||
problems if pressed/clicked on at the wrong time.
|
||||
|
||||
==============================================================================
|
||||
|
||||
NOTE: Any code not mentioned here is self explanatory and well commented.
|
||||
|
||||
==============================================================================
|
||||
|
||||
Now I a couple of XVT specific discoveries to mention:
|
||||
|
||||
DISCOVERY 1:
|
||||
|
||||
There is some sort of problem with Dialog boxes and floating dockable palettes.
|
||||
|
||||
I had a palette which contained a button, when this button was pressed it
|
||||
called one of the pre-defined dialogs, this however caused a lock up concerning
|
||||
the mouse - I couldn't get control back, the dialog seemed to keep it.
|
||||
What happened exactly was when you clicked the button down it didn't pop up
|
||||
again thus it wasn't receiving the mouse up event. When you did click the
|
||||
mouse again however it spawned the dialog - again and again, it sort of
|
||||
entered a loop repeatedly spawning the dialog. - Technical support said that
|
||||
the dialog must have been inadvertently destroying the mouse handlers.
|
||||
|
||||
DISCOVERY 2:
|
||||
|
||||
You cannot have a toolbar with buttons in and a CAttachmentFrame which
|
||||
encomapasses the whole window because if you do, the CAttachmentFrame
|
||||
obscures all of the mouse events from reaching the toolbar - thus none
|
||||
of the buttons react.
|
||||
|
||||
A solution to this problem is to have a CAttachmentFrame that doesn't
|
||||
cover the entire window, just a part of it (this can be acheived with
|
||||
a certain constructor - see code) - thus the events can then
|
||||
get to the toolbar.
|
||||
|
||||
DISCOVERY 3:
|
||||
|
||||
For some reason you cannot pass a WINDOW variable between a view and a
|
||||
document - when I tried it the program kept core dumping on this.
|
||||
|
||||
DISCOVERY 4:
|
||||
|
||||
The Select() system call has been dropped. The reason is that it was failing
|
||||
for some reason which I couldn't work out. It kept returning TRUE all the
|
||||
time when I used it to see if the named pipe was ready for reading and this
|
||||
was not always the case.
|
||||
|
||||
The solution I came up with was to use a function from the ioctl library.
|
||||
The function I used is the following:
|
||||
|
||||
int nbytes;
|
||||
ioctl(fd_XvtToGeant, FIONREAD, &nbytes);
|
||||
|
||||
This is much better than select because I only have a single file descriptor
|
||||
to test and using this is far shorter and easier to code/understand than the
|
||||
select stuff.
|
||||
|
||||
==============================================================================
|
||||
S.Prior - August '97
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,102 @@
|
||||
#!/bin/csh -f
|
||||
#
|
||||
# --[ XVT-DSC++ Installation ] -------------------------------------------
|
||||
#
|
||||
|
||||
set ARCH "`uname`"
|
||||
|
||||
switch ($ARCH)
|
||||
case IRIX:
|
||||
#--------------------- XVT 3.2 environment variables ---------------------
|
||||
setenv XVT_DSP_DIR /afs/cern.ch/rd44/dev/XVT/xvtdsp32/xm12_sgi_irix
|
||||
setenv XA_SHELL_PATH $XVT_DSP_DIR/pwr/shell
|
||||
setenv PATH ${PATH}:$XVT_DSP_DIR/pwr/bin
|
||||
setenv PATH ${PATH}:$XVT_DSP_DIR/ptk/bin
|
||||
if ( "$?UIDPATH" == 0 ) then
|
||||
setenv UIDPATH ./%U:$XVT_DSP_DIR/pwr/bin/%U
|
||||
else
|
||||
setenv UIDPATH ${UIDPATH}:./%U:$XVT_DSP_DIR/pwr/bin/%U
|
||||
endif
|
||||
setenv UIDPATH ${UIDPATH}:$XVT_DSP_DIR/ptk/bin/%U
|
||||
setenv PWRDIR $XVT_DSP_DIR/pwr
|
||||
setenv XVTPATH $XVT_DSP_DIR/ptk/print
|
||||
alias xvth1 "$XVT_DSP_DIR/ptk/bin/helpview $XVT_DSP_DIR/pwr/doc/dscpp32.csc &
|
||||
alias xvth2 "$XVT_DSP_DIR/ptk/bin/helpview $XVT_DSP_DIR/pwr/doc/migrate.csc &
|
||||
alias xvt "$XVT_DSP_DIR/pwr/bin/Architect &"
|
||||
breaksw
|
||||
case HP-UX:
|
||||
#--------------------- XVT 4.5 environment variables ---------------------
|
||||
setenv XVT_DSP_DIR /afs/cern.ch/rd44/dev/XVT/xvtdsp45/xm12_hp_hpux
|
||||
setenv XVTPATH $XVT_DSP_DIR/print
|
||||
setenv XA_SHELL_PATH $XVT_DSP_DIR/bin/shell
|
||||
setenv PATH ${PATH}:$XVT_DSP_DIR/bin
|
||||
if ( "$?UIDPATH" == 0 ) then
|
||||
setenv UIDPATH ./%U:$XVT_DSP_DIR/bin/%U
|
||||
else
|
||||
setenv UIDPATH ${UIDPATH}:./%U:$XVT_DSP_DIR/bin/%U
|
||||
endif
|
||||
if ( "$?SHLIB_PATH" == 0 ) then
|
||||
setenv SHLIB_PATH /usr/lib:$XVT_DSP_DIR/lib
|
||||
else
|
||||
setenv SHLIB_PATH ${SHLIB_PATH}:/usr/lib:$XVT_DSP_DIR/lib
|
||||
endif
|
||||
if ( "$?LIBPATH" == 0 ) then
|
||||
setenv LIBPATH /usr/lib:$XVT_DSP_DIR/lib
|
||||
else
|
||||
setenv LIBPATH ${LIBPATH}:/usr/lib:$XVT_DSP_DIR/lib
|
||||
endif
|
||||
alias xvt "$XVT_DSP_DIR/bin/Architect &"
|
||||
alias xvth "$XVT_DSP_DIR/bin/helpview $XVT_DSP_DIR/doc/refman.csc &"
|
||||
breaksw
|
||||
case AIX:
|
||||
default:
|
||||
#--------------------- XVT 3.22 environment variables --------------------
|
||||
# setenv XVT_DSP_DIR /afs/cern.ch/rd44/dev/XVT/xvtdsp322/xm12_rs6_aix
|
||||
# setenv PWRDIR $XVT_DSP_DIR/pwr
|
||||
# setenv PTKDIR $XVT_DSP_DIR/ptk
|
||||
# setenv XA_SHELL_PATH $PWRDIR/shell
|
||||
# setenv PATH ${PATH}:$PWRDIR/bin
|
||||
# setenv PATH ${PATH}:$PTKDIR/bin
|
||||
# setenv UIDPATH ./%U:$PWRDIR/bin/%U:$PTKDIR/bin/%U
|
||||
# setenv XVTPATH $PTKDIR/print
|
||||
# if ( "$?SHLIB_PATH" == 0 ) then
|
||||
# setenv SHLIB_PATH $PTKDIR/lib:$PWRDIR/lib
|
||||
# else
|
||||
# setenv SHLIB_PATH ${SHLIB_PATH}:$PTKDIR/lib:$PWRDIR/lib
|
||||
# endif
|
||||
# if ( "$?LIBPATH" == 0 ) then
|
||||
# setenv LIBPATH $PTKDIR/lib:$PWRDIR/lib
|
||||
# else
|
||||
# setenv LIBPATH ${LIBPATH}:$PTKDIR/lib:$PWRDIR/lib
|
||||
# endif
|
||||
# alias xvt "$XVT_DSP_DIR/pwr/bin/Architect &"
|
||||
# alias xvth1 "$XVT_DSP_DIR/pwr/bin/helpview $PWRDIR/doc/dscpp32.csc &"
|
||||
# alias xvth2 "$XVT_DSP_DIR/pwr/bin/helpview $PWRDIR/doc/migrate.csc &"
|
||||
#--------------------- XVT 4.5 environment variables ---------------------
|
||||
setenv XVT_DSP_DIR /afs/cern.ch/rd44/dev/XVT/xvtdsp45/xm12_rs6_aix
|
||||
setenv XA_SHELL_PATH $XVT_DSP_DIR/bin/shell
|
||||
setenv PATH ${PATH}:$XVT_DSP_DIR/bin
|
||||
if ( "$?UIDPATH" == 0 ) then
|
||||
setenv UIDPATH ./%U:$XVT_DSP_DIR/bin/%U
|
||||
else
|
||||
setenv UIDPATH ${UIDPATH}:./%U:$XVT_DSP_DIR/bin/%U
|
||||
endif
|
||||
if ( "$?SHLIB_PATH" == 0 ) then
|
||||
setenv SHLIB_PATH $XVT_DSP_DIR/lib
|
||||
else
|
||||
setenv SHLIB_PATH ${SHLIB_PATH}:$XVT_DSP_DIR/lib
|
||||
endif
|
||||
if ( "$?LIBPATH" == 0 ) then
|
||||
setenv LIBPATH $XVT_DSP_DIR/lib
|
||||
else
|
||||
setenv LIBPATH ${LIBPATH}:$XVT_DSP_DIR/lib
|
||||
endif
|
||||
alias xvt "$XVT_DSP_DIR/bin/Architect &"
|
||||
alias xvth "$XVT_DSP_DIR/bin/helpview $XVT_DSP_DIR/refman.csc &"
|
||||
breaksw
|
||||
endsw
|
||||
|
||||
#
|
||||
# --[ End of XVT-DSC++ Installation ] ------------------------------------
|
||||
#
|
||||
exit
|
||||
@@ -0,0 +1,74 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyCalorimeterHit.cc,v 2.2 1998/07/13 17:29:34 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#include "MyCalorimeterHit.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
|
||||
G4Allocator<MyCalorimeterHit> MyCalorimeterHitAllocator;
|
||||
|
||||
MyCalorimeterHit::MyCalorimeterHit()
|
||||
{pLogV=NULL;}
|
||||
|
||||
MyCalorimeterHit::MyCalorimeterHit(G4LogicalVolume* logVol)
|
||||
:pLogV(logVol)
|
||||
{;}
|
||||
|
||||
MyCalorimeterHit::~MyCalorimeterHit()
|
||||
{;}
|
||||
|
||||
MyCalorimeterHit::MyCalorimeterHit(const MyCalorimeterHit &right)
|
||||
{
|
||||
edep = right.edep;
|
||||
pos = right.pos;
|
||||
rot = right.rot;
|
||||
pLogV = right.pLogV;
|
||||
}
|
||||
|
||||
const MyCalorimeterHit& MyCalorimeterHit::operator=(const MyCalorimeterHit &right)
|
||||
{
|
||||
edep = right.edep;
|
||||
pos = right.pos;
|
||||
rot = right.rot;
|
||||
pLogV = right.pLogV;
|
||||
return *this;
|
||||
}
|
||||
|
||||
int MyCalorimeterHit::operator==(const MyCalorimeterHit &right) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MyCalorimeterHit::Draw()
|
||||
{
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if(pVVisManager)
|
||||
{
|
||||
G4Transform3D trans(rot,pos);
|
||||
G4VisAttributes attribs;
|
||||
const G4VisAttributes* pVA = pLogV->GetVisAttributes();
|
||||
if(pVA) attribs = *pVA;
|
||||
G4Colour colour(1.,0.,0.);
|
||||
attribs.SetColour(colour);
|
||||
attribs.SetForceWireframe(false);
|
||||
attribs.SetForceSolid(true);
|
||||
pVVisManager->Draw(*pLogV,attribs,trans);
|
||||
}
|
||||
}
|
||||
|
||||
void MyCalorimeterHit::Print()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyCalorimeterHit.hh,v 2.1 1998/07/12 02:37:12 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef MyCalorimeterHit_h
|
||||
#define MyCalorimeterHit_h 1
|
||||
|
||||
#include "G4VHit.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
#include "G4RotationMatrix.hh"
|
||||
|
||||
class MyCalorimeterHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
|
||||
MyCalorimeterHit();
|
||||
MyCalorimeterHit(G4LogicalVolume* logVol);
|
||||
~MyCalorimeterHit();
|
||||
MyCalorimeterHit(const MyCalorimeterHit &right);
|
||||
const MyCalorimeterHit& operator=(const MyCalorimeterHit &right);
|
||||
int operator==(const MyCalorimeterHit &right) const;
|
||||
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aHit);
|
||||
|
||||
void Draw();
|
||||
void Print();
|
||||
|
||||
private:
|
||||
G4double edep;
|
||||
G4ThreeVector pos;
|
||||
G4RotationMatrix rot;
|
||||
const G4LogicalVolume* pLogV;
|
||||
|
||||
public:
|
||||
inline void SetEdep(G4double de)
|
||||
{ edep = de; };
|
||||
inline void AddEdep(G4double de)
|
||||
{ edep += de; };
|
||||
inline G4double GetEdep()
|
||||
{ return edep; };
|
||||
inline void SetPos(G4ThreeVector xyz)
|
||||
{ pos = xyz; };
|
||||
inline G4ThreeVector GetPos()
|
||||
{ return pos; };
|
||||
inline void SetRot(G4RotationMatrix rmat)
|
||||
{ rot = rmat; };
|
||||
inline G4RotationMatrix GetRot()
|
||||
{ return rot; };
|
||||
inline const G4LogicalVolume * GetLogV()
|
||||
{ return pLogV; };
|
||||
|
||||
};
|
||||
|
||||
extern G4Allocator<MyCalorimeterHit> MyCalorimeterHitAllocator;
|
||||
|
||||
inline void* MyCalorimeterHit::operator new(size_t)
|
||||
{
|
||||
void *aHit;
|
||||
aHit = (void *) MyCalorimeterHitAllocator.MallocSingle();
|
||||
return aHit;
|
||||
}
|
||||
|
||||
inline void MyCalorimeterHit::operator delete(void *aHit)
|
||||
{
|
||||
MyCalorimeterHitAllocator.FreeSingle((MyCalorimeterHit*) aHit);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyCalorimeterHitsCollection.cc,v 2.1 1998/07/12 02:37:12 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#include "MyCalorimeterHitsCollection.hh"
|
||||
|
||||
MyCalorimeterHitsCollection::MyCalorimeterHitsCollection()
|
||||
{}
|
||||
|
||||
MyCalorimeterHitsCollection::MyCalorimeterHitsCollection(G4String aName,
|
||||
G4VSensitiveDetector * theSD)
|
||||
:G4VHitsCollection(aName,theSD)
|
||||
{}
|
||||
|
||||
MyCalorimeterHitsCollection::~MyCalorimeterHitsCollection()
|
||||
{}
|
||||
|
||||
void MyCalorimeterHitsCollection::DrawAllHits()
|
||||
{
|
||||
G4int n_hit = theCollection.entries();
|
||||
for(G4int i=0;i<n_hit;i++)
|
||||
{ theCollection[i].Draw(); }
|
||||
}
|
||||
|
||||
void MyCalorimeterHitsCollection::PrintAllHits()
|
||||
{
|
||||
G4int n_hit = theCollection.entries();
|
||||
for(G4int i=0;i<n_hit;i++)
|
||||
{ theCollection[i].Print(); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyCalorimeterHitsCollection.hh,v 2.1 1998/07/12 02:37:13 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef MyCalorimeterHitsCollection_h
|
||||
#define MyCalorimeterHitsCollection_h 1
|
||||
|
||||
#include <rw/tvordvec.h>
|
||||
|
||||
#include "G4VHitsCollection.hh"
|
||||
#include "MyCalorimeterHit.hh"
|
||||
|
||||
class G4VSensitiveDetector;
|
||||
|
||||
class MyCalorimeterHitsCollection : public G4VHitsCollection
|
||||
{
|
||||
public:
|
||||
MyCalorimeterHitsCollection();
|
||||
MyCalorimeterHitsCollection(G4String aName,G4VSensitiveDetector* theSD);
|
||||
~MyCalorimeterHitsCollection();
|
||||
|
||||
void DrawAllHits();
|
||||
void PrintAllHits();
|
||||
private:
|
||||
RWTValOrderedVector<MyCalorimeterHit> theCollection;
|
||||
public:
|
||||
inline RWTValOrderedVector<MyCalorimeterHit>& GetVector()
|
||||
{ return theCollection; };
|
||||
inline int insert(MyCalorimeterHit* pHit)
|
||||
{
|
||||
theCollection.insert(*pHit);
|
||||
return theCollection.entries()-1;
|
||||
};
|
||||
inline void AddEdep(int i,G4double edep)
|
||||
{ theCollection[i].AddEdep(edep); };
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyCalorimeterSD.cc,v 2.2 1998/07/13 17:29:36 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#include "MyCalorimeterSD.hh"
|
||||
#include "MyCalorimeterHit.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
MyCalorimeterSD::MyCalorimeterSD(G4String name)
|
||||
:G4VSensitiveDetector(name),numberOfCells(2550)
|
||||
{
|
||||
G4String HCname;
|
||||
collectionName.insert(HCname="CalCollection");
|
||||
CellID = new int[numberOfCells];
|
||||
}
|
||||
|
||||
MyCalorimeterSD::~MyCalorimeterSD()
|
||||
{
|
||||
delete [] CellID;
|
||||
}
|
||||
|
||||
void MyCalorimeterSD::Initialize()
|
||||
{
|
||||
CalCollection = new MyCalorimeterHitsCollection(collectionName[0],this);
|
||||
for(int j=0;j<numberOfCells;j++)
|
||||
{
|
||||
CellID[j] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
G4bool MyCalorimeterSD::ProcessHits(G4Step*aStep)
|
||||
{
|
||||
G4double edep = aStep->GetDeltaEnergy();
|
||||
|
||||
if(edep<=0.) return false;
|
||||
|
||||
const G4VPhysicalVolume* physVol
|
||||
= aStep->GetPreStepPoint()->GetPhysicalVolume();
|
||||
int copyID = physVol->GetCopyNo();
|
||||
|
||||
if(CellID[copyID]==-1)
|
||||
{
|
||||
MyCalorimeterHit calHit(physVol->GetLogicalVolume());
|
||||
G4RotationMatrix rotM;
|
||||
if(physVol->GetObjectRotation()) rotM = *(physVol->GetObjectRotation());
|
||||
calHit.SetEdep( edep );
|
||||
calHit.SetPos( physVol->GetTranslation() );
|
||||
calHit.SetRot( rotM );
|
||||
int icell = CalCollection->insert( &calHit );
|
||||
CellID[copyID] = icell;
|
||||
if(verboseLevel>0)
|
||||
{ G4cout << " New Calorimeter Hit on CellID " << copyID << endl; }
|
||||
}
|
||||
else
|
||||
{
|
||||
CalCollection->AddEdep( CellID[copyID], edep );
|
||||
if(verboseLevel>0)
|
||||
{ G4cout << " Energy added to CellID " << copyID << endl; }
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void MyCalorimeterSD::EndOfEvent(G4HCofThisEvent*HCE)
|
||||
{
|
||||
HCE->AddHitsCollection( CalCollection );
|
||||
}
|
||||
|
||||
void MyCalorimeterSD::clear()
|
||||
{
|
||||
}
|
||||
|
||||
void MyCalorimeterSD::DrawAll()
|
||||
{
|
||||
}
|
||||
|
||||
void MyCalorimeterSD::PrintAll()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyCalorimeterSD.hh,v 2.1 1998/07/12 02:37:13 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef MyCalorimeterSD_h
|
||||
#define MyCalorimeterSD_h 1
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "MyCalorimeterHitsCollection.hh"
|
||||
#include "MyCalorimeterHit.hh"
|
||||
#include "G4Step.hh"
|
||||
|
||||
class MyCalorimeterSD : public G4VSensitiveDetector
|
||||
{
|
||||
|
||||
public:
|
||||
MyCalorimeterSD(G4String name);
|
||||
~MyCalorimeterSD();
|
||||
|
||||
void Initialize();
|
||||
G4bool ProcessHits(G4Step*aStep);
|
||||
void EndOfEvent(G4HCofThisEvent*HCE);
|
||||
void clear();
|
||||
void DrawAll();
|
||||
void PrintAll();
|
||||
|
||||
private:
|
||||
MyCalorimeterHitsCollection *CalCollection;
|
||||
|
||||
int* CellID;
|
||||
int numberOfCells;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyDetectorConstruction.cc,v 2.2 1998/07/13 17:29:37 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#include "MyDetectorConstruction.hh"
|
||||
|
||||
#include "MyCalorimeterSD.cc"
|
||||
#include "MyCalorimeterHit.cc"
|
||||
#include "MyCalorimeterHitsCollection.cc"
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4Element.hh"
|
||||
#include "G4ElementTable.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Colour.hh"
|
||||
|
||||
MyDetectorConstruction::MyDetectorConstruction()
|
||||
{;}
|
||||
|
||||
MyDetectorConstruction::~MyDetectorConstruction()
|
||||
{;}
|
||||
|
||||
G4VPhysicalVolume* MyDetectorConstruction::Construct()
|
||||
{
|
||||
G4cout << "Calorimeter volume Performance Test" << endl;
|
||||
|
||||
//--------- Material definition ---------
|
||||
|
||||
G4double a, iz, z, density;
|
||||
G4String name, symbol;
|
||||
G4int nel;
|
||||
|
||||
a = 14.01*g/mole;
|
||||
G4Element* elN = new G4Element(name="Nitrogen", symbol="N", iz=7., a);
|
||||
a = 16.00*g/mole;
|
||||
G4Element* elO = new G4Element(name="Oxigen", symbol="O", iz=8., a);
|
||||
|
||||
a = 26.98*g/mole;
|
||||
density = 2.7*g/cm3;
|
||||
G4Material* Al = new G4Material(name="Aluminium", z=13., a, density);
|
||||
a = 207.19*g/mole;
|
||||
density = 11.35*g/cm3;
|
||||
G4Material* Pb = new G4Material(name="Lead", z=82., a, density);
|
||||
density = 1.29e-03*g/cm3;
|
||||
G4Material* Air = new G4Material(name="Air", density, nel=2);
|
||||
Air->AddElement(elN, .7);
|
||||
Air->AddElement(elO, .3);
|
||||
|
||||
//--------- G4VSolid, G4LogicalVolume, G4VPhysicalVolume ---------
|
||||
|
||||
G4double offset=22.5*cm, xTlate, yTlate;
|
||||
G4int i,j,copyNo;
|
||||
|
||||
G4Box *myWorldBox= new G4Box("WBox",2000*cm, 2000*cm, 2000*cm);
|
||||
G4Box *myCalBox = new G4Box("CBox",1500*cm, 1500*cm, 1000*cm);
|
||||
G4Tubs *myTargetTube
|
||||
= new G4Tubs("TTube",0*cm, 22.5*cm, 1000*cm, 0.*deg, 360.*deg);
|
||||
|
||||
G4LogicalVolume *myWorldLog=new G4LogicalVolume(myWorldBox,Air,
|
||||
"WLog", 0, 0, 0);
|
||||
G4LogicalVolume *myCalLog=new G4LogicalVolume(myCalBox,Al,
|
||||
"CLog", 0, 0, 0);
|
||||
G4LogicalVolume *myTargetLog=new G4LogicalVolume(myTargetTube,Pb,
|
||||
"TLog", 0, 0, 0);
|
||||
|
||||
G4PVPlacement *myWorldPhys=new G4PVPlacement(0,G4ThreeVector(),
|
||||
"WPhys",
|
||||
myWorldLog,
|
||||
0,false,0);
|
||||
G4PVPlacement *myCalPhys=new G4PVPlacement(0,G4ThreeVector(),
|
||||
"CalPhys",
|
||||
myCalLog,
|
||||
myWorldPhys,false,0);
|
||||
|
||||
G4String tName1("TPhys1"); // Allow all target physicals to share
|
||||
// same name (delayed copy)
|
||||
copyNo=0;
|
||||
for (j=1;j<=25;j++)
|
||||
{
|
||||
yTlate = -1000.0*cm - 40.0*cm + j*80.0*cm;
|
||||
for (i=1;i<=50;i++)
|
||||
{
|
||||
xTlate = -1000.0*cm - 20.0*cm + i*45.0*cm - offset;
|
||||
G4PVPlacement *myTargetPhys
|
||||
=new G4PVPlacement(0,G4ThreeVector(xTlate,yTlate,0*cm),
|
||||
tName1,myTargetLog,myCalPhys,false,copyNo++);
|
||||
}
|
||||
}
|
||||
for (j=1;j<=26;j++)
|
||||
{
|
||||
yTlate = -1000.0*cm - 80.0*cm + j*80.0*cm;
|
||||
for (i=1;i<=50;i++)
|
||||
{
|
||||
xTlate = -1000.0*cm - 20.0*cm + i*45.0*cm;
|
||||
G4PVPlacement *myTargetPhys
|
||||
=new G4PVPlacement(0,G4ThreeVector(xTlate,yTlate,0*cm),
|
||||
tName1,myTargetLog,myCalPhys,false,copyNo++);
|
||||
}
|
||||
}
|
||||
|
||||
//--------- Sensitive detector -------------------------------------
|
||||
|
||||
G4SDManager* SDman = G4SDManager::GetSDMpointer();
|
||||
|
||||
G4String calorimeterSDname = "example4/calorimeter";
|
||||
MyCalorimeterSD * myCalorimeterSD = new MyCalorimeterSD( calorimeterSDname );
|
||||
SDman->AddNewDetector( myCalorimeterSD );
|
||||
myTargetLog->SetSensitiveDetector(myCalorimeterSD);
|
||||
|
||||
//--------- Visualization attributes -------------------------------
|
||||
|
||||
G4VisAttributes * experimantalHallVisAtt
|
||||
= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
|
||||
experimantalHallVisAtt->SetVisibility(false);
|
||||
myWorldLog->SetVisAttributes(experimantalHallVisAtt);
|
||||
|
||||
G4VisAttributes * calorimeterBoxVisAtt
|
||||
= new G4VisAttributes(G4Colour(0.0,0.0,0.5));
|
||||
calorimeterBoxVisAtt->SetForceWireframe(true);
|
||||
myCalLog->SetVisAttributes(calorimeterBoxVisAtt);
|
||||
|
||||
G4VisAttributes * calorimeterTubeVisAtt
|
||||
= new G4VisAttributes(G4Colour(0.0,0.5,0.5));
|
||||
// calorimeterTubeVisAtt->SetForceWireframe(true);
|
||||
myTargetLog->SetVisAttributes(calorimeterTubeVisAtt);
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
return myWorldPhys;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyDetectorConstruction.hh,v 2.1 1998/07/12 02:37:14 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef MyDetectorConstruction_h
|
||||
#define MyDetectorConstruction_h 1
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class MyDetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
MyDetectorConstruction();
|
||||
~MyDetectorConstruction();
|
||||
|
||||
public:
|
||||
G4VPhysicalVolume* Construct();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyDetectorMessenger.cc,v 2.2 1998/07/13 17:29:39 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#include "MyDetectorMessenger.hh"
|
||||
|
||||
#include "MyDetectorConstruction.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4UIparameter.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
MyDetectorMessenger::MyDetectorMessenger(MyDetectorConstruction * myDC)
|
||||
:myDetector(myDC)
|
||||
{
|
||||
G4UIcommand * command;
|
||||
G4UIparameter * param;
|
||||
G4String defParam;
|
||||
|
||||
command = new G4UIcommand("/init/SelectDetector",this);
|
||||
command->SetGuidance("Select Detector Setup.");
|
||||
command->SetGuidance(" Choice : SimpleBox / Honeycomb ");
|
||||
param = new G4UIparameter("Choice",'c',true);
|
||||
param->SetGuidance("SimpleBox is default.");
|
||||
param->SetDefaultValue("SimpleBox");
|
||||
myDetector->SelectDetector(defParam="SimpleBox");
|
||||
command->SetParameter(param);
|
||||
AddUIcommand(command);
|
||||
|
||||
command = new G4UIcommand("/init/SelectMaterial",this);
|
||||
command->SetGuidance("Select Material of the SimpleBox.");
|
||||
command->SetGuidance(" Choice : Air, Al, Pb (default)");
|
||||
param = new G4UIparameter("Choice",'c',true);
|
||||
param->SetGuidance("Material choice");
|
||||
param->SetDefaultValue("Pb");
|
||||
myDetector->SelectMaterial(defParam="Pb");
|
||||
command->SetParameter(param);
|
||||
AddUIcommand(command);
|
||||
}
|
||||
|
||||
void MyDetectorMessenger::SetNewValue(G4UIcommand * command,G4String newValues)
|
||||
{
|
||||
if( command->GetCommandName() == "SelectDetector" )
|
||||
{
|
||||
myDetector->SelectDetector(newValues);
|
||||
}
|
||||
if( command->GetCommandName() == "SelectMaterial" )
|
||||
{
|
||||
myDetector->SelectMaterial(newValues);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyDetectorMessenger.hh,v 2.2 1998/07/13 17:29:41 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef MyDetectorMessenger_h
|
||||
#define MyDetectorMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
#ifdef WIN32
|
||||
# include <Strstrea.h>
|
||||
#else
|
||||
# include <strstream.h>
|
||||
#endif
|
||||
|
||||
class G4UIcommand;
|
||||
class MyDetectorConstruction;
|
||||
|
||||
class MyDetectorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
MyDetectorMessenger(MyDetectorConstruction * myDC);
|
||||
void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
private:
|
||||
MyDetectorConstruction * myDetector;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyEventAction.cc,v 2.2 1998/07/13 17:29:43 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#include "MyEventAction.hh"
|
||||
|
||||
#include "MyCalorimeterHit.hh"
|
||||
#include "MyCalorimeterHitsCollection.hh"
|
||||
#include <rw/tvordvec.h>
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4HCofThisEvent.hh"
|
||||
#include "G4VHitsCollection.hh"
|
||||
#include "G4TrajectoryContainer.hh"
|
||||
#include "G4Trajectory.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "MyEventActionMessenger.cc"
|
||||
|
||||
MyEventAction::MyEventAction()
|
||||
:drawFlag(false)
|
||||
{
|
||||
G4SDManager * SDman = G4SDManager::GetSDMpointer();
|
||||
G4String colNam;
|
||||
|
||||
calorimeterCollID = SDman->GetCollectionID(colNam="CalCollection");
|
||||
//////////bulkCollID = SDman->GetCollectionID(colNam="bulkCollection");
|
||||
|
||||
new MyEventActionMessenger(this);
|
||||
}
|
||||
|
||||
MyEventAction::~MyEventAction()
|
||||
{;}
|
||||
|
||||
void MyEventAction::BeginOfEventAction()
|
||||
{
|
||||
if(drawFlag)
|
||||
{
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if(pVVisManager)
|
||||
{
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis~/Draw/current");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MyEventAction::EndOfEventAction()
|
||||
{
|
||||
const G4Event* evt = fpEventManager->GetConstCurrentEvent();
|
||||
|
||||
G4cout << ">>> Event " << evt->GetEventID() << endl;
|
||||
|
||||
G4HCofThisEvent * HCE = evt->GetHCofThisEvent();
|
||||
MyCalorimeterHitsCollection* CHC = NULL;
|
||||
if(HCE)
|
||||
CHC = (MyCalorimeterHitsCollection*)(HCE->GetHC(calorimeterCollID));
|
||||
|
||||
if(CHC)
|
||||
{
|
||||
RWTValOrderedVector<MyCalorimeterHit> theCollection
|
||||
= CHC->GetVector();
|
||||
int n_hit = theCollection.entries();
|
||||
G4cout << " " << n_hit
|
||||
<< " hits are stored in MyCalorimeterHitsCollection." << endl;
|
||||
G4double totE = 0;
|
||||
for(int i=0;i<n_hit;i++)
|
||||
{ totE += theCollection[i].GetEdep(); }
|
||||
G4cout << " Total energy deposition in calorimeter tubes : "
|
||||
<< totE / GeV << " (GeV)" << endl;
|
||||
}
|
||||
|
||||
if(drawFlag)
|
||||
{
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if(pVVisManager)
|
||||
{
|
||||
if(CHC) CHC->DrawAllHits();
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis~/show/view");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyEventAction.hh,v 2.1 1998/07/12 02:37:16 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef MyEventAction_h
|
||||
#define MyEventAction_h 1
|
||||
|
||||
#include "G4UserEventAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Event;
|
||||
|
||||
class MyEventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
MyEventAction();
|
||||
~MyEventAction();
|
||||
|
||||
public:
|
||||
void BeginOfEventAction();
|
||||
void EndOfEventAction();
|
||||
|
||||
private:
|
||||
G4int calorimeterCollID;
|
||||
/////////G4int bulkCollID;
|
||||
G4bool drawFlag;
|
||||
|
||||
public:
|
||||
inline void SetDrawFlag(G4bool val)
|
||||
{ drawFlag = val; };
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyEventActionMessenger.cc,v 2.1 1998/07/12 02:37:16 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#include "MyEventActionMessenger.hh"
|
||||
|
||||
#include "MyEventAction.hh"
|
||||
#include "G4UIparameter.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
MyEventActionMessenger::MyEventActionMessenger(MyEventAction * myEA)
|
||||
:myEventAction(myEA)
|
||||
{
|
||||
G4UIcommand * command;
|
||||
G4UIparameter * param;
|
||||
|
||||
command = new G4UIcommand("/event/Draw",this);
|
||||
command->SetGuidance("Set drawFlag to Draw an event.");
|
||||
command->SetGuidance(" default value is 0 (false).");
|
||||
param = new G4UIparameter("flag (1:true/0:fasle)",'i',true);
|
||||
param->SetDefaultValue(0);
|
||||
command->SetParameter(param);
|
||||
AddUIcommand(command);
|
||||
}
|
||||
|
||||
void MyEventActionMessenger::SetNewValue(G4UIcommand * command,G4String newValues)
|
||||
{
|
||||
if( command->GetCommandName() == "Draw" )
|
||||
{
|
||||
G4int vl;
|
||||
const char* t = newValues;
|
||||
istrstream is((char*)t);
|
||||
is >> vl;
|
||||
myEventAction->SetDrawFlag(vl!=0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyEventActionMessenger.hh,v 2.1 1998/07/12 02:37:17 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef MyEventActionMessenger_h
|
||||
#define MyEventActionMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
|
||||
class MyEventAction;
|
||||
|
||||
class MyEventActionMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
MyEventActionMessenger(MyEventAction * myEA);
|
||||
void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
private:
|
||||
MyEventAction * myEventAction;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyPrimaryGeneratorAction.cc,v 2.1 1998/07/12 02:37:17 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#include "MyPrimaryGeneratorAction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
MyPrimaryGeneratorAction::MyPrimaryGeneratorAction()
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
particleGun = new G4ParticleGun(n_particle);
|
||||
|
||||
// default particle
|
||||
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
G4String particleName;
|
||||
G4ParticleDefinition* particle
|
||||
= particleTable->FindParticle(particleName="e-");
|
||||
particleGun->SetParticleDefinition(particle);
|
||||
particleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
|
||||
particleGun->SetParticleEnergy(1.*GeV);
|
||||
particleGun->SetParticlePosition(G4ThreeVector(0.*cm,0.*cm,0.*cm));
|
||||
|
||||
}
|
||||
|
||||
MyPrimaryGeneratorAction::~MyPrimaryGeneratorAction()
|
||||
{
|
||||
delete particleGun;
|
||||
}
|
||||
|
||||
void MyPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyPrimaryGeneratorAction.hh,v 2.1 1998/07/12 02:37:17 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef MyPrimaryGeneratorAction_h
|
||||
#define MyPrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
|
||||
class G4ParticleGun;
|
||||
class G4Event;
|
||||
|
||||
class MyPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
MyPrimaryGeneratorAction();
|
||||
~MyPrimaryGeneratorAction();
|
||||
|
||||
public:
|
||||
void GeneratePrimaries(G4Event* anEvent);
|
||||
|
||||
private:
|
||||
G4ParticleGun* particleGun;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyRunAction.cc,v 2.2 1998/07/13 17:29:45 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#include "MyRunAction.hh"
|
||||
|
||||
#include "G4Run.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
MyRunAction::MyRunAction()
|
||||
{
|
||||
timer = new G4Timer;
|
||||
runIDcounter = 0;
|
||||
}
|
||||
|
||||
MyRunAction::~MyRunAction()
|
||||
{
|
||||
delete timer;
|
||||
}
|
||||
|
||||
void MyRunAction::BeginOfRunAction(G4Run* aRun)
|
||||
{
|
||||
aRun->SetRunID(runIDcounter++);
|
||||
aRun->transient(true);
|
||||
|
||||
G4cout << "### Run " << aRun->GetRunID() << " start." << endl;
|
||||
timer->Start();
|
||||
}
|
||||
|
||||
void MyRunAction::EndOfRunAction(G4Run* aRun)
|
||||
{
|
||||
timer->Stop();
|
||||
G4cout << "number of event = " << aRun->GetNumberOfEvent()
|
||||
<< " " << *timer << endl;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MyRunAction.hh,v 2.1 1998/07/12 02:37:18 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef MyRunAction_h
|
||||
#define MyRunAction_h 1
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "G4Timer.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Run;
|
||||
|
||||
class MyRunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
MyRunAction();
|
||||
~MyRunAction();
|
||||
|
||||
public:
|
||||
void BeginOfRunAction(G4Run* aRun);
|
||||
void EndOfRunAction(G4Run* aRun);
|
||||
|
||||
private:
|
||||
G4Timer* timer;
|
||||
G4int runIDcounter;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MySteppingAction.cc,v 2.1 1998/07/12 02:37:19 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#include "MySteppingAction.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4Polyline.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
#include "MySteppingActionMessenger.cc"
|
||||
|
||||
MySteppingAction::MySteppingAction()
|
||||
:drawFlag(false)
|
||||
{
|
||||
new MySteppingActionMessenger(this);
|
||||
}
|
||||
|
||||
void MySteppingAction::UserSteppingAction()
|
||||
{
|
||||
if(drawFlag)
|
||||
{
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
|
||||
if (pVVisManager) {
|
||||
const G4SteppingManager* pSM = GetSteppingManager();
|
||||
G4Polyline polyline;
|
||||
|
||||
G4double charge = pSM->GetTrack()->GetDefinition()->GetPDGCharge();
|
||||
G4Colour colour;
|
||||
if (charge < 0.) colour = G4Colour(1., 0., 0.);
|
||||
else if (charge > 0.) colour = G4Colour(0., 0., 1.);
|
||||
else colour = G4Colour(0., 1., 0.);
|
||||
G4VisAttributes attribs(colour);
|
||||
polyline.SetVisAttributes(attribs);
|
||||
polyline.append(pSM->GetStep()->GetPreStepPoint()->GetPosition());
|
||||
polyline.append(pSM->GetStep()->GetPostStepPoint()->GetPosition());
|
||||
pVVisManager -> Draw(polyline);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MySteppingAction.hh,v 2.1 1998/07/12 02:37:19 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef MySteppingAction_h
|
||||
#define MySteppingAction_h 1
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class MySteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
MySteppingAction();
|
||||
~MySteppingAction(){};
|
||||
|
||||
void UserSteppingAction();
|
||||
|
||||
private:
|
||||
G4bool drawFlag;
|
||||
|
||||
public:
|
||||
inline void SetDrawFlag(G4bool val)
|
||||
{ drawFlag = val; };
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,44 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MySteppingActionMessenger.cc,v 2.1 1998/07/12 02:37:20 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#include "MySteppingActionMessenger.hh"
|
||||
|
||||
#include "MySteppingAction.hh"
|
||||
#include "G4UIparameter.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
MySteppingActionMessenger::MySteppingActionMessenger(MySteppingAction * mySA)
|
||||
:mySteppingAction(mySA)
|
||||
{
|
||||
G4UIcommand * command;
|
||||
G4UIparameter * param;
|
||||
|
||||
command = new G4UIcommand("/Step/Draw",this);
|
||||
command->SetGuidance("Set drawFlag to Draw event Step.");
|
||||
command->SetGuidance(" default value is 0 (false).");
|
||||
param = new G4UIparameter("flag (1:true/0:fasle)",'i',true);
|
||||
param->SetDefaultValue(0);
|
||||
command->SetParameter(param);
|
||||
AddUIcommand(command);
|
||||
}
|
||||
|
||||
void MySteppingActionMessenger::SetNewValue(G4UIcommand * command,G4String newValues)
|
||||
{
|
||||
if( command->GetCommandName() == "Draw" )
|
||||
{
|
||||
G4int vl;
|
||||
const char* t = newValues;
|
||||
istrstream is((char*)t);
|
||||
is >> vl;
|
||||
mySteppingAction->SetDrawFlag(vl!=0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: MySteppingActionMessenger.hh,v 2.1 1998/07/12 02:37:20 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef MySteppingActionMessenger_h
|
||||
#define MySteppingActionMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
|
||||
class MySteppingAction;
|
||||
|
||||
class MySteppingActionMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
MySteppingActionMessenger(MySteppingAction * mySA);
|
||||
void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
private:
|
||||
MySteppingAction * mySteppingAction;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
$Id: README,v 2.1 1998/07/10 20:44:49 gcosmo Exp $
|
||||
-----------------------------------------------------------------------------
|
||||
$Name: geant4-00 $
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
XVT GUI - Release Notes
|
||||
-----------------------
|
||||
|
||||
The code included in this directory implements a Graphical User Interface
|
||||
based on the XVT commercial product. The code has been extracted from Geant4
|
||||
release "alpha02" from what was the directory xvt_standalone_test in
|
||||
geant4alpha/prototype/interfaces.
|
||||
|
||||
NB - This code has _not_ been ported and tested on Geant4 "beta" yet !
|
||||
@@ -0,0 +1,197 @@
|
||||
XVT_G4_TUTORIAL
|
||||
================
|
||||
|
||||
Written by: S.Prior
|
||||
Date: 15/08/97
|
||||
Platform: HP-UX (10.20)
|
||||
|
||||
==============================================================================
|
||||
|
||||
Firstly, make sure both the XVT GUI and the xvt.benchmark files are compiled.
|
||||
|
||||
Please follow the instructions in the 'readme.txt' file in the
|
||||
xvt_standalone_test directory on compiling the xvt.benchmark executable.
|
||||
|
||||
After compilation please move the xvt.benchmark file from the HP-AFS/
|
||||
directory up on level to the xvt_standalone_test directory.
|
||||
|
||||
To compile the XVT GUI, go to the HP_GUI sub-directory and type 'make'.
|
||||
|
||||
After this has compiled please move the files 'GUI' and 'GUI.uid' into the
|
||||
xvt_standalone_test directory.
|
||||
|
||||
Now you are ready to start.
|
||||
|
||||
==============================================================================
|
||||
|
||||
At the command prompt, type 'GUI > file1.txt &' to run the XVT GUI and pipe
|
||||
the output to a file - this will catch all the output from the simulation.
|
||||
|
||||
The GUI will now startup and connect to Geant (after a while you will see this
|
||||
in the Output log window.)
|
||||
|
||||
It will then do a listing of all the commands available to the user from Geant.
|
||||
|
||||
Once this has finished listing you are ready to begin executing commands.
|
||||
(you will know it has finished because the scrollbar will stop sizing and the
|
||||
last command: (currently) /vis~/expert/draw_square will be at the bottom of the
|
||||
list).
|
||||
|
||||
==============================================================================
|
||||
|
||||
STEP 1: Getting the command widget
|
||||
-----------------------------------
|
||||
|
||||
OK, what you should do now is get the command widget (you will use this to
|
||||
enter commands later on).
|
||||
|
||||
Click the button on the toolbar that is immediately to the left of the green
|
||||
coloured text box (you will see a message in the status bar if you move the
|
||||
mouse over the button).
|
||||
|
||||
The button will 'deselect' itself so that it is no longer clickable and a
|
||||
palette of buttons will appear after a short while - also the buttons to the
|
||||
right of the green text area will be enabled.
|
||||
|
||||
==============================================================================
|
||||
|
||||
STEP 2: Using the command widget
|
||||
---------------------------------
|
||||
|
||||
To familiarise yourself with the command widget use the mouse to click on the
|
||||
area which has the title in it - this will allow you to drag and drop the widget
|
||||
in the area of the screen under the text boxes.
|
||||
|
||||
Use the mouse to drag and drop the widget. You will notice that it is not
|
||||
allowed to move out of the area under the text boxes.
|
||||
|
||||
You can drop the palette of buttons into the border of this area - click down
|
||||
on the palettes title area and move it towards an edge of the area - you will
|
||||
notice the dragging frame changes and if you release the mouse button the
|
||||
palette will now be contained in the border - with its layout changed slightly.
|
||||
|
||||
******************************************************************************
|
||||
WARNING: whatever you do, do not click the small button in the left top corner
|
||||
as this will permanently close the command palette.
|
||||
|
||||
In the future code will be written to allow you to regenerate the
|
||||
palette - this has not yet been implemented.
|
||||
******************************************************************************
|
||||
|
||||
Now, regardless of whether the palette is in the border or floating click on
|
||||
the first button on the palette and hold the mouse down.
|
||||
|
||||
You will now see the palette cascade into another set of buttons. Still with
|
||||
the mouse held down drag it over the cascade of buttons and off into the main
|
||||
area and you will see that the new palette is free floating in its own right
|
||||
- you can now drag and drop this into the area or border as well.
|
||||
|
||||
Play about with this mechanism with the other command palette sub cascades to
|
||||
familiarise yourself with them.
|
||||
|
||||
You are perfectly free to drag the palette(s) out of the border again - just
|
||||
click somewhere on the space around the buttons and it will be possible to drag
|
||||
it out again.
|
||||
|
||||
******************************************************************************
|
||||
NOTE: The cascaded palettes CAN be closed with no problems as these will be
|
||||
regenerated automatically if you click on the same main palette button
|
||||
as you did before - only the main command palette must remain open.
|
||||
******************************************************************************
|
||||
|
||||
==============================================================================
|
||||
|
||||
STEP 3: Entering commands
|
||||
--------------------------
|
||||
|
||||
There are currently 2 methods to enter commands and you will do both here.
|
||||
|
||||
Firstly (the recommended way) - Using the command palette.
|
||||
|
||||
You are going to enter '/gun/particle kaon0s'.
|
||||
|
||||
Using the command palette, locate the '/gun/' cascade (3rd from last button) -
|
||||
tear it off so it is free floating.
|
||||
|
||||
Click on the 'particle' button (2nd button).
|
||||
|
||||
Now, if you are unsure on this selection click the HELP BUTTON on the toolbar
|
||||
(it is the rightmost button on the bar).
|
||||
|
||||
This will display a small help message in the Output log window to guide you.
|
||||
|
||||
Now that you are satisfied it is the correct command to execute you click the
|
||||
EXECUTE BUTTON on the toolbar (located immediately after the green text box).
|
||||
|
||||
A small dialog box will pop up asking you for a parameter, in this you
|
||||
type kaon0s and return.
|
||||
|
||||
The command will then be sent to Geant for processing and you will then see
|
||||
the command you have just entered appear in the COMMAND LOG text box.
|
||||
|
||||
This is the recommended way of entering commands.
|
||||
|
||||
The other method is to simply click the COMMAND ENTRY button which is located
|
||||
on the toolbar in between the execute button and the help button.
|
||||
|
||||
This will pop up a dialog box and you can simply type the command in.
|
||||
|
||||
Try it by typing '/gun/direction 1 1 0' then enter.
|
||||
|
||||
This method is only really offered as an extra means to enter a command.
|
||||
|
||||
==============================================================================
|
||||
|
||||
STEP 4: Doing a full simulation including visualisation
|
||||
--------------------------------------------------------
|
||||
|
||||
Please enter the following commands using the method(s) you have learn't:
|
||||
|
||||
/gun/particle kaon0s
|
||||
/gun/direction 1 1 0
|
||||
/gun/energy 100 GeV
|
||||
/vis~/create_view/new_graphics_system DAWN
|
||||
/event/draw 1
|
||||
/step/draw 1
|
||||
/event/verbose 1
|
||||
/tracking/verbose 1
|
||||
/run/beamOn 2
|
||||
|
||||
This will then start the simulation and you will see DAWN appear and start
|
||||
rendering the visualisation output.
|
||||
|
||||
Follow any instructions given until finished.
|
||||
|
||||
==============================================================================
|
||||
|
||||
STEP 5: Incorporating BreakPoints
|
||||
----------------------------------
|
||||
|
||||
If you require breakpoints in the program you can put these in using the
|
||||
command palette.
|
||||
|
||||
The setBreakPoint command is located in the CONTROL cascade palette.
|
||||
|
||||
If you execute the command you will be prompted as always for the parameter(s).
|
||||
|
||||
Then you must follow the instructions in the usual manner until finished.
|
||||
|
||||
==============================================================================
|
||||
|
||||
STEP 6: Quitting the application
|
||||
---------------------------------
|
||||
|
||||
This is most important, you MUST execute the /control/exit command before
|
||||
quitting the GUI otherwise the xvt.benchmark program will remain active and
|
||||
have to be killed.
|
||||
|
||||
You will know it has been executed when the DAWN rendering window has
|
||||
disappeared - then it is safe to exit the program.
|
||||
|
||||
Currently there is no in-built checking on the GUI quit command so you can
|
||||
actually quit the GUI but leave the benchmark file going - not advisable.
|
||||
|
||||
It will be changed in the future.
|
||||
|
||||
==============================================================================
|
||||
S.Prior - August '97
|
||||
@@ -0,0 +1,52 @@
|
||||
xvt.benchmark.readme
|
||||
=====================
|
||||
|
||||
Written by: S.Prior
|
||||
Date: 11/07/97
|
||||
Platform: HP-UX (10.20)
|
||||
=============================================================================
|
||||
|
||||
This GUI is specific to HP (HP-UX 10.20) - it is NOT compiled (yet) for any
|
||||
other platform, this is because the version of XVT we have (4.5) is not able
|
||||
to run on the current AIX CERNSP operating system (it is too old a version).
|
||||
|
||||
Please run the script (HP_setup) to set up some of the appropriate
|
||||
environment variables.
|
||||
|
||||
************************ IMPORTANT ******************************************
|
||||
*** ***
|
||||
*** Please compile this benchmark file using the following compilation ***
|
||||
*** flags and environment variables on HP: ***
|
||||
*** ***
|
||||
*** CXXFLAGS=+O3 +a1 -DRW_NO_STL -ptS'.hh .c .C .cxx .CXX .cc .CC ***
|
||||
*** .cpp' -pts -ptr(path of your g4.ptrep) ***
|
||||
*** ***
|
||||
*** ***
|
||||
*** One Important thing: The flags used when compiling the benchmark must ***
|
||||
*** not contain the -z option as this causes some strange problems. - ***
|
||||
*** This is one of the future development issues that needs sorting out. ***
|
||||
*** ***
|
||||
*** ***
|
||||
*** setenv DAWN_INSTALLED 1 ***
|
||||
*** setenv DAWN_HOME (your DAWN path) ***
|
||||
*** set path=( $path $DAWN_HOME ) ***
|
||||
*** setenv XKEYSYMDB (your path to: XKeysymDB) ***
|
||||
*** setenv TCL_LIBRARY (your path to the tcl library) ***
|
||||
*** setenv TK_LIBRARY (your path to the TK library) ***
|
||||
*** setenv DISPLAY (your display) ***
|
||||
*** setenv TESTTARGET xvt.benchmark ***
|
||||
*** ***
|
||||
*** Then 'gmake -e' to compile ***
|
||||
*** ***
|
||||
*****************************************************************************
|
||||
|
||||
=============================================================================
|
||||
|
||||
This benchmark file is essentially 'example4' of Makoto's except that I have
|
||||
updated the relevant parts for XVT.
|
||||
|
||||
You can enter all the commands available for Geant in an entirely graphical
|
||||
manner.
|
||||
|
||||
To familiarise yourself with the XVT GUI please read the file 'XVT_G4_TUTORIAL'
|
||||
which goes through an example for you to follow and shows how to use the GUI.
|
||||
@@ -0,0 +1,95 @@
|
||||
Future Recommendations for XVT GUI development.
|
||||
================================================
|
||||
|
||||
By S. Prior - August '97.
|
||||
--------------------------
|
||||
|
||||
1.. Code methods to allow user to completely close the command palette and
|
||||
later on regenerate it (method exists but is not coded).
|
||||
|
||||
2.. Sort out methods to update the command palette if new commands are added or
|
||||
the commands change in some way during execution.
|
||||
|
||||
3.. The issue of parameter entry needs to be aired and heavily discussed.
|
||||
Currently it is accomplished by using a simple text entry dialog box which
|
||||
is automatically displayed if the command needs a parameter - the user can
|
||||
simply type this value or string in. However, it would be better to have
|
||||
some custom 'built' way of parameter entry that incorporates some nice,
|
||||
easy to use, intuitive widgets that reduce the scope for errors in user
|
||||
command entry.
|
||||
|
||||
The difficulty at present is the fact that on startup we don't actually
|
||||
know what commands are available from Geant - all this information has to
|
||||
be read in dynamically - this is where the problem lies... If we don't know
|
||||
what the parameter type, range, default value (etc) are, how can we
|
||||
construct a suitable widget representation ??? - it is more suited to TCL
|
||||
which is interpreted and can easily generate widgets 'on-the-fly' but XVT
|
||||
works in a different manner - so this problem must be addressed
|
||||
before any attempt at coding takes place.
|
||||
|
||||
4.. The help needs updating to be more informative to the user - i.e. along
|
||||
with the description of the command if it has parameters the user should be
|
||||
made aware of what type and ranges he/she can enter.
|
||||
|
||||
5.. Also as XVT supports hypertext help systems it might be an idea creating a
|
||||
help system for other areas which the user might need help on (i.e. NOT the
|
||||
commands!).
|
||||
|
||||
6.. Add a quitting safeguard so that if the user clicks 'quit' but hasn't
|
||||
exitted from Geant they should be warned or not permitted to quit the XVT
|
||||
GUI until Geant has been exitted.
|
||||
|
||||
7.. Investigation needs to be done into why there are problems when compilation
|
||||
takes place with the -z option in the CXXFLAGS line.
|
||||
|
||||
8.. There are a couple of debugging methods I wrote that can also be got
|
||||
rid of when it is sure that the program works bug-free (I have them in
|
||||
there for ease of use). An example is the method I use to print out the
|
||||
command arrays contents.
|
||||
|
||||
There are also some COUTS in various methods which are also used for
|
||||
debugging and these can be deleted when the time is right.
|
||||
|
||||
9.. The State change Geant4 needs investigating and properly specifying as to
|
||||
'what should happen when the state changes to X ??' - then the GUI can
|
||||
respond accordingly - things like blanking out commands/buttons so the user
|
||||
cannot execute them at the wrong time etc. What currently happens is that
|
||||
even though Geant might be processing stuff, the XVT GUI is still 'live'
|
||||
and can send commands - then when Geant has finished processing events etc
|
||||
it plays catch-up to those commands - this is not too favourable, what
|
||||
should happen is the disabling of the commands etc until Geants state is
|
||||
able to receive the commands OK.
|
||||
|
||||
As yet though the state change Geant4 is very new and not properly
|
||||
specified.
|
||||
|
||||
10. Portability issues should be addressed sometime. The XVT GUI and the
|
||||
benchmark file rely on named pipes for communication so for UNIX based
|
||||
systems this is fine. However - porting to NT and PC based operating
|
||||
systems could cause problems in this area. A suggestion might be to have a
|
||||
sort of 'switch' in the code which detects which operating system you are
|
||||
on and uses the relevant IPC mechanism available. This should all be
|
||||
transparent to the user.
|
||||
|
||||
11. Small things to enhance the interface could be done - like displaying the
|
||||
mouse coordinates in the field already set up in the status bar - this is
|
||||
trivial 'final touch' stuff though.
|
||||
|
||||
12. A few more checks might be added to the code - for example when doing a
|
||||
write to a named pipe - currently there is no action taken if the write was
|
||||
unsucessful apart from printing out a message to the user. - Maybe this
|
||||
could be extended so that it would be repeated until the write WAS
|
||||
successful.
|
||||
|
||||
13. File I/O operations need adding (to save the log etc) - Please refer to the
|
||||
Object Oriented persistent file I/O work I did early on.
|
||||
|
||||
14. When the appropriate bitmaps have been drawn for the command palette (they
|
||||
must be 16X16 pixels in size) the code needs changing to actually do the
|
||||
attaching of the bitmaps to the buttons. You will note that there is a
|
||||
data member commented out of the type 'G4CommandData' which holds
|
||||
information about the bitmap (its name).
|
||||
|
||||
I propose that there is a directory created in the CVS repository where all
|
||||
the command bitmaps are located and then the XVT GUI can go to this
|
||||
directory at run time and find the appropriate bitmaps for the buttons.
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,79 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: xvt.benchmark.cc,v 2.2 1998/07/13 17:29:47 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// Updated for XVT GUI by Simon Prior 12/08/97
|
||||
|
||||
#include "MyDetectorConstruction.cc"
|
||||
#include "MyRunAction.cc"
|
||||
#include "MyPrimaryGeneratorAction.cc"
|
||||
#include "MyEventAction.cc"
|
||||
#include "MySteppingAction.cc"
|
||||
|
||||
#include "G4UIxvt.hh"
|
||||
#include "G4Initializer.hh"
|
||||
#include "G4RunManager.hh"
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
#include "MyVisManager.cc"
|
||||
#endif
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
// Solve templates.
|
||||
#ifdef GNU_GCC
|
||||
#include "MyCalorimeterHit.hh"
|
||||
template class RWTValVector<MyCalorimeterHit>;
|
||||
template class G4Allocator<MyCalorimeterHit>;
|
||||
#endif
|
||||
#include "g4templates.hh"
|
||||
|
||||
main() {
|
||||
|
||||
|
||||
// Initializer
|
||||
G4Initializer * initializer = new G4Initializer;
|
||||
|
||||
// Detector geometry
|
||||
initializer->SetUserInitialization(new MyDetectorConstruction);
|
||||
|
||||
// Initialization
|
||||
initializer->Initialize();
|
||||
|
||||
// Run manager
|
||||
G4cout << "RunManager construction starting...." << endl;
|
||||
G4RunManager * runManager = new G4RunManager;
|
||||
|
||||
// UserAction classes.
|
||||
runManager->SetUserAction(new MyRunAction);
|
||||
runManager->SetUserAction(new MyPrimaryGeneratorAction);
|
||||
runManager->SetUserAction(new MyEventAction);
|
||||
runManager->SetUserAction(new MySteppingAction);
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
G4cout << "Instantiating MyVisManager......." << endl;
|
||||
G4VisManager* visManager = new MyVisManager;
|
||||
visManager -> Initialize ();
|
||||
#endif
|
||||
|
||||
// Event loop
|
||||
// Define (G)UI XVT
|
||||
G4UIsession * session = new G4UIxvt;
|
||||
session->SessionStart();
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
delete visManager;
|
||||
#endif
|
||||
delete session;
|
||||
delete initializer;
|
||||
delete runManager;
|
||||
return 0;
|
||||
}
|
||||
|
||||