Import Geant4 8.0.0 source tree
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# $Id: GNUmakefile,v 1.1 2005/10/18 18:09:14 allison Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
|
||||
# --------------------------------------------------------------
|
||||
|
||||
name = standalone
|
||||
G4TARGET := $(name)
|
||||
G4EXLIB := true
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../../..
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: lib bin
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
@@ -0,0 +1,20 @@
|
||||
$Id: History,v 1.1 2005/10/18 18:09:14 allison Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
examples/extended/visualization/standalone History file
|
||||
-------------------------------------------------------
|
||||
|
||||
This file should be used by the G4 example coordinator to briefly
|
||||
summarize all major modifications introduced in the code and keep
|
||||
track of all tags.
|
||||
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
18th October 2005 (exam-ext-vis-V07-01-00)
|
||||
- First standalone example.
|
||||
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * 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: StandaloneVisAction.hh,v 1.1 2005/10/18 18:09:14 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
|
||||
#ifndef STANDALONEVISACTION_HH
|
||||
#define STANDALONEVISACTION_HH
|
||||
|
||||
#include "G4VUserVisAction.hh"
|
||||
|
||||
class StandaloneVisAction: public G4VUserVisAction {
|
||||
void Draw();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * 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: StandaloneVisAction.cc,v 1.1 2005/10/18 18:09:14 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
|
||||
#include "StandaloneVisAction.hh"
|
||||
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Polyhedron.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4SubtractionSolid.hh"
|
||||
|
||||
void StandaloneVisAction::Draw() {
|
||||
G4VVisManager* pVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if (pVisManager) {
|
||||
|
||||
// Simple box...
|
||||
pVisManager->Draw(G4Box("box",2*m,2*m,2*m),
|
||||
G4VisAttributes(G4Colour(1,1,0)));
|
||||
|
||||
// Boolean solid...
|
||||
G4Box boxA("boxA",3*m,3*m,3*m);
|
||||
G4Box boxB("boxB",1*m,1*m,1*m);
|
||||
G4SubtractionSolid subtracted("subtracted_boxes",&boxA,&boxB,
|
||||
G4Translate3D(3*m,3*m,3*m));
|
||||
pVisManager->Draw(subtracted,
|
||||
G4VisAttributes(G4Colour(0,1,1)),
|
||||
G4Translate3D(-6*m,-6*m,-6*m));
|
||||
|
||||
// Same, but explicit polyhedron...
|
||||
G4Polyhedron* pA = G4Box("boxA",3*m,3*m,3*m).CreatePolyhedron();
|
||||
G4Polyhedron* pB = G4Box("boxB",1*m,1*m,1*m).CreatePolyhedron();
|
||||
pB->Transform(G4Translate3D(3*m,3*m,3*m));
|
||||
G4Polyhedron* pSubtracted = new G4Polyhedron(pA->subtract(*pB));
|
||||
G4VisAttributes subVisAtts(G4Colour(0,1,1));
|
||||
pSubtracted->SetVisAttributes(&subVisAtts);
|
||||
pVisManager->Draw(*pSubtracted,G4Translate3D(6*m,6*m,6*m));
|
||||
delete pA;
|
||||
delete pB;
|
||||
delete pSubtracted;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * 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: standalone.cc,v 1.1 2005/10/18 18:09:14 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VisExecutive.hh"
|
||||
#include "G4VisExtent.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIterminal.hh"
|
||||
#include "G4UItcsh.hh"
|
||||
|
||||
#include "StandaloneVisAction.hh"
|
||||
|
||||
int main() {
|
||||
|
||||
G4VisManager* visManager = new G4VisExecutive;
|
||||
visManager->Initialize ();
|
||||
|
||||
visManager->SetUserAction
|
||||
(new StandaloneVisAction,
|
||||
G4VisExtent(-5*m,5*m,-5*m,5*m,-5*m,5*m)); // 2nd argument optional.
|
||||
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer ();
|
||||
UI->ApplyCommand ("/control/execute standalone.g4m");
|
||||
|
||||
G4UIsession* session = new G4UIterminal(new G4UItcsh);
|
||||
session->SessionStart();
|
||||
|
||||
delete session;
|
||||
delete visManager;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/control/verbose 2
|
||||
/vis/verbose p
|
||||
/vis/open OGLSXm
|
||||
/vis/scene/create
|
||||
#/vis/scene/add/userAction
|
||||
/vis/scene/add/userAction -10 10 -10 10 -10 10 m
|
||||
#/vis/scene/add/axes 0 0 0 10 m
|
||||
#/vis/scene/add/scale 10 m
|
||||
/vis/sceneHandler/attach
|
||||
/vis/viewer/flush
|
||||
Reference in New Issue
Block a user