Import Geant4 11.0.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2021-06-25 16:12:29 +02:00
parent c968e26a39
commit 6399a014b6
4200 changed files with 207479 additions and 237366 deletions
@@ -146,10 +146,24 @@ G4InteractorMessenger::G4InteractorMessenger (
parameter->SetParameterCandidates("highlight no-highlight");
parameter->SetDefaultValue("highlight");
outputStyle->SetParameter (parameter);
// /gui/nativeMenuBar :
nativeMenu = new G4UIcommand("/gui/nativeMenuBar",this);
nativeMenu->SetGuidance("Allow native menu bar in Geant4 Qt driver.");
nativeMenu->SetGuidance("By default, enable.");
parameter = new G4UIparameter("bool",'b',true);
parameter->SetDefaultValue("true");
nativeMenu->SetParameter (parameter);
// /gui/clearMenu
clearMenu = new G4UIcommand("/gui/clearMenu",this);
clearMenu->SetGuidance("Clear menu bar, remove all user defined menu entries.");
}
G4InteractorMessenger::~G4InteractorMessenger()
{
delete clearMenu;
delete nativeMenu;
delete outputStyle;
delete sys;
delete defaultIcons;
@@ -180,6 +194,10 @@ void G4InteractorMessenger::SetNewValue (
if ( rc < 0 ){ }
} else if(command==outputStyle) {
session->OutputStyle((const char*)params[0],(const char*)params[1],(const char*)params[2]);
} else if(command==nativeMenu) {
session->NativeMenu(command->ConvertToBool(newValue));
} else if(command==clearMenu) {
session->ClearMenu();
}
}
delete [] params;
@@ -66,6 +66,16 @@ void G4VInteractiveSession::OutputStyle(const char*,const char*,const char*)
{
}
/***************************************************************************/
void G4VInteractiveSession::NativeMenu (bool)
{
}
/***************************************************************************/
void G4VInteractiveSession::ClearMenu ()
{
}
/***************************************************************************/
void G4VInteractiveSession::AddInteractor (G4String a_name,
G4Interactor a_interactor)
+16 -9
View File
@@ -23,9 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4Win32 implementation
//
//
// G.Barrand
// Original author: G.Barrand, 1998
// --------------------------------------------------------------------
#if defined(G4INTY_BUILD_WIN32) || defined(G4INTY_USE_WIN32)
@@ -72,15 +73,21 @@ G4Win32::G4Win32 (
wc.lpszClassName = className;
::RegisterClass (&wc);
topWindow = ::CreateWindow(className,className,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
NULL, NULL,
::GetModuleHandle(NULL),
NULL);
topWindow = ::CreateWindowEx(WS_EX_CLIENTEDGE,
className,
"Test",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
::GetModuleHandle(NULL),
NULL);
if(topWindow==NULL) {
G4cout << "G4Win32 : Unable to create Win32 window." << G4endl;
G4cout << "G4Win32: Unable to create Win32 window." << G4endl;
}
Win32Inited = TRUE;
-205
View File
@@ -1,205 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
// L. Garnier
#if defined(G4INTY_BUILD_WT) || defined(G4INTY_USE_WT)
#include <stdlib.h>
#include <string.h>
#include "G4ios.hh"
#include "G4Wt.hh"
#include <Wt/WApplication>
#include <Wt/WEnvironment>
G4Wt* G4Wt::instance = NULL;
static G4bool WtInited = FALSE;
/***************************************************************************/
G4Wt* G4Wt::getInstance (
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
return G4Wt::getInstance (0,NULL,(char*)"Geant4");
}
/***************************************************************************/
G4Wt* G4Wt::getInstance (
int a_argn
,char** a_args
,char* a_class
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
if (instance==NULL) {
instance = new G4Wt(a_argn,a_args,a_class);
}
return instance;
}
/***************************************************************************/
G4Wt::G4Wt (
int a_argn
,char** a_args
,char* /*a_class */
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
argn = 0;
args = NULL;
#ifdef G4DEBUG_INTERFACES_COMMON
printf("G4Wt::G4Wt try to inited Wt\n");
#endif
// Check if Wt already init in another external app
if(wApp) {
WtInited = TRUE;
SetMainInteractor (wServer);
//#endif
SetArguments (a_argn,a_args);
#ifdef G4DEBUG_INTERFACES_COMMON
printf("G4Wt::G4Wt alredy inited in external \n");
#endif
} else {
if(WtInited==FALSE) { //Wt should be Inited once !
// Then two cases :
// - It is the first time we create G4UI (argc!=0)
// -> Inited and register
// - It is the first time we create G4VIS (argc == 0)
// -> Inited and NOT register
if (a_argn != 0) {
argn = a_argn;
args = a_args;
} else { //argc = 0
// FIXME : That's not the good arguments, but I don't know how to get args from other Interactor.
// Ex: How to get them from G4Xt ?
argn = 1;
args = (char **)malloc( 1 * sizeof(char *) );
args[0] = (char *)malloc(10 * sizeof(char));
strncpy(args[0], "my_app \0", 9);
}
int *p_argn = (int*)malloc(sizeof(int));
*p_argn = argn;
#ifdef G4DEBUG_INTERFACES_COMMON
printf("G4Wt::G4Wt WAppl \n");
#endif
Wt::WApplication:: instance();
////
//WApplication (*p_argn, args);
if(!wApp) {
G4cout << "G4Wt : Unable to init Wt." << G4endl;
} else {
WtInited = TRUE;
if (a_argn != 0) {
#ifdef G4DEBUG_INTERFACES_COMMON
printf("G4Wt::G4Wt SetMainInteractor\n");
#endif
// SetMainInteractor ();
}
SetArguments (a_argn,a_args);
#ifdef G4DEBUG_INTERFACES_COMMON
printf("G4Wt::G4Wt inited Wt END\n");
#endif
}
}
}
#ifdef G4DEBUG_INTERFACES_COMMON
if (wApp) {
printf("G4Wt::wApp already exist\n");
} else {
printf("G4Wt::wApp not exist\n");
}
#endif
// AddDispatcher ((G4DispatchFunction)XtDispatchEvent);
DisableSecondaryLoop ();
}
/***************************************************************************/
G4Wt::~G4Wt (
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
if(this==instance) {
instance = NULL;
}
}
/***************************************************************************/
G4bool G4Wt::Inited (
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
return WtInited;
}
/***************************************************************************/
void* G4Wt::GetEvent (
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
//FIXME
// G4cout << "G4Wt : Rien compris a cette fonction G4Wt::GetEvent." << G4endl;
// static XEvent event;
// if(appContext==NULL) return NULL;
// if(mainApp==NULL) return NULL;
// WtAppNextEvent (appContext, &event);
// return &event;
printf("*");
return 0;
}
/***************************************************************************/
void G4Wt::FlushAndWaitExecution (
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
// printf("G4Wt::FlushAndWaitExecution :: Flush ....\n");
if(!wApp) return;
// wApp->processEvents();
}
#endif