Import Geant4 6.2.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.1 1999/01/07 16:09:08 gunter Exp $
|
||||
# $Id: GNUmakefile,v 1.2 2004/06/01 15:36:32 gcosmo Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for graphics_reps library. John Allison, 19/7/96.
|
||||
# --------------------------------------------------------------
|
||||
@@ -9,6 +9,8 @@ ifndef G4INSTALL
|
||||
G4INSTALL = ../..
|
||||
endif
|
||||
|
||||
GLOBLIBS = libG4global.lib
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
CPPFLAGS += -I$(G4BASE)/global/management/include \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cvs log $Id: History,v 1.47 2003/09/18 11:03:10 johna Exp $
|
||||
cvs log $Id: History,v 1.51 2004/06/07 08:55:29 gcosmo Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,7 +17,16 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
18th September 2003 John Alison (greps-V05-02-00)
|
||||
7th June 2004 G.Cosmo (greps-V06-01-01)
|
||||
- Fixed compilation problem on WIN32-VC for G4AttDefStore.
|
||||
- Added definition of GLOBLIBS in GNUmakefile for DLLs build on Windows.
|
||||
|
||||
30th March 2004 G.Cosmo (greps-V06-01-00)
|
||||
- Implemented constructor and destructor for G4AttDefStore, to properly
|
||||
delete objects in the static map, allocated through explicit calls to
|
||||
GetInstance(). Made G4AttDefStore a singleton.
|
||||
|
||||
18th September 2003 J.Allison (greps-V05-02-00)
|
||||
- Introduced G4Colour<->G4ThreeVector conversion operators.
|
||||
|
||||
3rd April 2003 G.Cosmo (greps-V05-00-00)
|
||||
@@ -26,20 +35,20 @@ committal in the CVS repository !
|
||||
27th November 2002 J.Allison (greps-V04-01-05)
|
||||
- Small revison of G4Scale and improvements in G4VMarker class description.
|
||||
|
||||
Nov 20, 2002, G.Cosmo (greps-V04-01-04)
|
||||
20th November 2002 G.Cosmo (greps-V04-01-04)
|
||||
- Patched access to public static data in G4Scale and G4VisAttributes.
|
||||
Added static accessors to be used in the kernel to allow porting on
|
||||
Windows DLLs.
|
||||
- HepPolyhedron[.hh.cc]: changed inline static methods to not inlined.
|
||||
|
||||
Nov 11, 2002, E.Chernaev (greps-V04-01-03)
|
||||
11th November 2002 E.Chernaev (greps-V04-01-03)
|
||||
- Minor bug fix in HepPolyhedron::GetFacet().
|
||||
- HepDouble, HepBoolean --> double, bool in HepPolyhedron
|
||||
|
||||
Nov 7, 2002, E.Chernaev (greps-V04-01-02)
|
||||
7th November 2002 E.Chernaev (greps-V04-01-02)
|
||||
- Added createTwistedTrap() and createPolyhedron() to HepPolyhedron.
|
||||
|
||||
Oct 28, 2002, J.Allison (greps-V04-01-01)
|
||||
28th October 2002 J.Allison (greps-V04-01-01)
|
||||
- Changed AttDefStore to return a map.
|
||||
|
||||
24th October 2002 John Allison (greps-V04-01-00)
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4AttDefStore.hh,v 1.4 2003/06/16 16:55:05 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4AttDefStore.hh,v 1.6 2004/06/07 08:54:00 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
|
||||
#ifndef G4ATTDEFSTORE_HH
|
||||
#define G4ATTDEFSTORE_HH
|
||||
@@ -32,18 +32,31 @@
|
||||
|
||||
class G4AttDef;
|
||||
|
||||
class G4AttDefStore{
|
||||
public:
|
||||
static std::map<G4String,G4AttDef>*
|
||||
GetInstance(G4String storeName,bool& isNew);
|
||||
// Returns a pointer to the named store and isNew is true if store is new.
|
||||
protected:
|
||||
G4AttDefStore();
|
||||
~G4AttDefStore();
|
||||
private:
|
||||
G4AttDefStore(const G4AttDefStore&);
|
||||
G4AttDefStore& operator=(const G4AttDefStore&);
|
||||
static std::map<G4String,std::map<G4String,G4AttDef>*> m_stores;
|
||||
class G4AttDefStore
|
||||
{
|
||||
public:
|
||||
|
||||
static std::map<G4String,G4AttDef>*
|
||||
GetInstance(G4String storeName, G4bool& isNew);
|
||||
// Returns a pointer to the named store
|
||||
// and isNew is true if store is new.
|
||||
// The store keeps the ownership of the returned
|
||||
// pointer to the map.
|
||||
|
||||
~G4AttDefStore();
|
||||
// Destructor.
|
||||
|
||||
protected:
|
||||
|
||||
G4AttDefStore();
|
||||
|
||||
private:
|
||||
|
||||
G4AttDefStore(const G4AttDefStore&);
|
||||
G4AttDefStore& operator=(const G4AttDefStore&);
|
||||
|
||||
static std::map<G4String,std::map<G4String,G4AttDef>*> m_stores;
|
||||
static G4AttDefStore* theInstance;
|
||||
};
|
||||
|
||||
#endif //G4ATTDEFSTORE_H
|
||||
|
||||
@@ -21,28 +21,67 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4AttDefStore.cc,v 1.3 2003/06/16 16:55:18 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4AttDefStore.cc,v 1.5 2004/03/31 06:50:19 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
|
||||
#include "G4AttDefStore.hh"
|
||||
|
||||
#include "G4AttDef.hh"
|
||||
|
||||
G4AttDefStore* G4AttDefStore::theInstance = 0;
|
||||
std::map<G4String,std::map<G4String,G4AttDef>*> G4AttDefStore::m_stores;
|
||||
|
||||
std::map<G4String,G4AttDef>*
|
||||
G4AttDefStore::GetInstance(G4String storeName,bool& isNew) {
|
||||
G4AttDefStore::GetInstance(G4String storeName, G4bool& isNew)
|
||||
{
|
||||
// Create the private static instance first to allow for
|
||||
// the deletion of the allocated attributes in the map store
|
||||
//
|
||||
static G4AttDefStore theStore;
|
||||
if (!theInstance)
|
||||
{
|
||||
theInstance = &theStore;
|
||||
}
|
||||
|
||||
// Allocate the new map if not existing already
|
||||
// and return it to the caller
|
||||
//
|
||||
std::map<G4String,G4AttDef>* store;
|
||||
std::map<G4String,std::map<G4String,G4AttDef>*>::iterator iStore =
|
||||
m_stores.find(storeName);
|
||||
if (iStore == m_stores.end()) {
|
||||
|
||||
if (iStore == m_stores.end())
|
||||
{
|
||||
isNew = true;
|
||||
store = new std::map<G4String,G4AttDef>;
|
||||
m_stores[storeName] = store;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
isNew = false;
|
||||
store = iStore->second;
|
||||
}
|
||||
return store;
|
||||
}
|
||||
|
||||
G4AttDefStore::G4AttDefStore()
|
||||
{
|
||||
}
|
||||
|
||||
G4AttDefStore::~G4AttDefStore()
|
||||
{
|
||||
std::map<G4String,std::map<G4String,G4AttDef>*>::iterator iStore, iStore_tmp;
|
||||
for ( iStore = m_stores.begin(); iStore != m_stores.end(); )
|
||||
{
|
||||
if (iStore->second)
|
||||
{
|
||||
delete iStore->second;
|
||||
iStore_tmp = iStore++;
|
||||
m_stores.erase(iStore_tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
++iStore;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user