Import Geant4 8.1.0 source tree
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# $Id: GNUmakefile,v 1.3 2005/09/19 19:40:53 capra Exp $
|
||||
# --------------------------------------------------------------------
|
||||
# GNUmakefile for exaple subpackage
|
||||
# R. Capra, 09 Sep 2005
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
name := Radmon
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../../..
|
||||
endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
CPPFLAGS += -I$(G4BASE)/global/management/include \
|
||||
-I$(G4BASE)/intercoms/include
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonDumpStyle.hh
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonDumpStyle.hh,v 1.3 2006/06/29 16:14:17 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
// Description: Define dump widths
|
||||
//
|
||||
|
||||
#ifndef RADMONDUMPSTYLE_HH
|
||||
#define RADMONDUMPSTYLE_HH
|
||||
|
||||
#define RADMONDUMP_INDENT_WIDTH 25
|
||||
#define RADMONDUMP_DOUBLE_PRECISION 5
|
||||
#define RADMONDUMP_DOUBLE_WIDTH 7
|
||||
#endif /* RADMONDUMPSTYLE_HH */
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonLayoutEntityWithAttributes.hh
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonLayoutEntityWithAttributes.hh,v 1.3.2.2 2006/06/29 16:14:19 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
// Description: Provides attributes to other detector classes
|
||||
//
|
||||
|
||||
#ifndef RADMONLAYOUTENTITYWITHATTRIBUTES_HH
|
||||
#define RADMONLAYOUTENTITYWITHATTRIBUTES_HH
|
||||
|
||||
// Include files
|
||||
#include "G4String.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4RotationMatrix.hh"
|
||||
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
|
||||
class RadmonLayoutEntityWithAttributes
|
||||
{
|
||||
public:
|
||||
G4int GetNAttributes(void) const;
|
||||
const G4String & GetAttributeName(G4int index) const;
|
||||
|
||||
G4String GetAttribute(const G4String & attributeName, const G4String & defaultValue = G4String("")) const;
|
||||
G4bool ExistsAttribute(const G4String & attributeName) const;
|
||||
void SetAttribute(const G4String & attributeName, const G4String & value);
|
||||
void ClearAttribute(const G4String & attributeName);
|
||||
void ClearAllAttributes(void);
|
||||
|
||||
G4double GetAttributeAsDouble(const G4String & attributeName, double defaultValue) const;
|
||||
G4double GetAttributeAsMeasure(const G4String & attributeName, const char * category, double defaultValue) const;
|
||||
G4int GetAttributeAsInteger(const G4String & attributeName, G4int defaultValue) const;
|
||||
G4ThreeVector GetAttributeAsThreeVector(const G4String & attributeName, const G4ThreeVector & defaultValue) const;
|
||||
G4ThreeVector GetAttributeAsThreeVectorWithMeasure(const G4String & attributeName, const char * category, const G4ThreeVector & defaultValue) const;
|
||||
G4ThreeVector GetAttributeAsDirection(const G4String & attributeName, const G4ThreeVector & defaultValue) const;
|
||||
G4RotationMatrix GetAttributeAsRotationMatrix(const G4String & attributeName, const G4RotationMatrix & defaultValue) const;
|
||||
|
||||
protected:
|
||||
inline RadmonLayoutEntityWithAttributes();
|
||||
inline RadmonLayoutEntityWithAttributes(const RadmonLayoutEntityWithAttributes & copy);
|
||||
inline ~RadmonLayoutEntityWithAttributes();
|
||||
|
||||
void DumpAttributesLayout(std::ostream & out, const G4String & indent=G4String()) const;
|
||||
|
||||
inline RadmonLayoutEntityWithAttributes & operator=(const RadmonLayoutEntityWithAttributes & copy);
|
||||
|
||||
private:
|
||||
// Private methods
|
||||
void CopyFrom(const RadmonLayoutEntityWithAttributes & copy);
|
||||
|
||||
// Private attributes
|
||||
typedef std::pair<G4String, G4String> AttributeItem;
|
||||
typedef std::vector<AttributeItem> AttributesVector;
|
||||
AttributesVector attributesVector;
|
||||
};
|
||||
|
||||
// Inline implementations
|
||||
#include "RadmonLayoutEntityWithAttributes.icc"
|
||||
#endif /* RADMONLAYOUTENTITYWITHATTRIBUTES_HH */
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonLayoutEntityWithAttributes.icc
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonLayoutEntityWithAttributes.icc,v 1.3 2006/06/29 16:14:21 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
|
||||
#ifndef RADMONLAYOUTENTITYWITHATTRIBUTES_HH
|
||||
#error "RadmonLayoutEntityWithAttributes.icc cannot be included directly. Please use RadmonLayoutEntityWithAttributes.hh"
|
||||
#else /* RADMONLAYOUTENTITYWITHATTRIBUTES_HH */
|
||||
inline RadmonLayoutEntityWithAttributes :: RadmonLayoutEntityWithAttributes()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline RadmonLayoutEntityWithAttributes :: RadmonLayoutEntityWithAttributes(const RadmonLayoutEntityWithAttributes & copy)
|
||||
{
|
||||
CopyFrom(copy);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
inline RadmonLayoutEntityWithAttributes :: ~RadmonLayoutEntityWithAttributes()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
inline RadmonLayoutEntityWithAttributes & RadmonLayoutEntityWithAttributes :: operator=(const RadmonLayoutEntityWithAttributes & copy)
|
||||
{
|
||||
CopyFrom(copy);
|
||||
return (*this);
|
||||
}
|
||||
#endif /* RADMONLAYOUTENTITYWITHATTRIBUTES_HH */
|
||||
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonMessenger.hh
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonMessenger.hh,v 1.3 2006/06/29 16:14:23 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
// Description: UI commands for managing a layout
|
||||
//
|
||||
|
||||
#ifndef RADMONMESSENGER_HH
|
||||
#define RADMONMESSENGER_HH
|
||||
|
||||
// Include files
|
||||
#include "G4UImessenger.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "RadmonMessengersSupport.hh"
|
||||
|
||||
class RadmonMessenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
static G4bool ProcessArguments(const G4String & rawArguments, G4int nArgs, G4String * arguments);
|
||||
static G4double GetUnit(const G4String & unitStr, const char * cathegory);
|
||||
|
||||
protected:
|
||||
RadmonMessenger(const char * path, const char * guidance=0);
|
||||
inline ~RadmonMessenger();
|
||||
|
||||
std::istream * OpenForInput(const G4String & fileName) const;
|
||||
std::ostream * OpenForOutput(const G4String & fileName) const;
|
||||
|
||||
private:
|
||||
// Hidden constructors and operators
|
||||
RadmonMessenger();
|
||||
RadmonMessenger(const RadmonMessenger & copy);
|
||||
RadmonMessenger & operator=(const RadmonMessenger & copy);
|
||||
|
||||
// Private Attributes
|
||||
G4UIdirectory * directory;
|
||||
};
|
||||
|
||||
// Inline implementation
|
||||
#include "RadmonMessenger.icc"
|
||||
#endif /* RADMONMESSENGER_HH */
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonMessenger.icc
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonMessenger.icc,v 1.3 2006/06/29 16:14:25 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
|
||||
#ifndef RADMONMESSENGER_HH
|
||||
#error "RadmonMessenger.icc cannot be included directly. Please use RadmonMessenger.hh"
|
||||
#else /* RADMONMESSENGER_HH */
|
||||
inline RadmonMessenger :: ~RadmonMessenger()
|
||||
{
|
||||
if (directory)
|
||||
delete directory;
|
||||
}
|
||||
#endif /* RADMONMESSENGER_HH */
|
||||
@@ -0,0 +1,99 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonMessengersSupport.hh
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonMessengersSupport.hh,v 1.3 2006/06/29 16:14:27 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
// Description: Define macros useful to maintain the code of messengers
|
||||
//
|
||||
|
||||
#ifndef RADMONMESSENGERSSUPPORT_HH
|
||||
#define RADMONMESSENGERSSUPPORT_HH
|
||||
|
||||
#include "G4UIcommand.hh"
|
||||
|
||||
#define RADMON_DECLARE_COMMAND(command) private: \
|
||||
void On ## command (const G4String & value); \
|
||||
G4UIcommand * cmd ## command
|
||||
|
||||
#define RADMON_INITIALIZE_COMMAND(command) cmd ## command (0)
|
||||
|
||||
#define _CREATE_COMMAND(command, guidance) cmd ## command = new G4UIcommand(COMMANDS_PATH #command , this); \
|
||||
\
|
||||
if (! cmd ## command ) \
|
||||
{ \
|
||||
G4cout << "RadmonDetectorMessenger::RadmonDetectorMessenger: Command \"" #command "\" not allocated."<< G4endl; \
|
||||
return; \
|
||||
} \
|
||||
\
|
||||
cmd ## command ->SetGuidance(guidance)
|
||||
|
||||
#define _ADD_ARG(command, argName) cmd ## command ->SetParameter(new G4UIparameter(argName, 's', false))
|
||||
|
||||
#define RADMON_CREATE_COMMAND_0ARGS(command, guidance) \
|
||||
_CREATE_COMMAND(command, guidance);
|
||||
|
||||
#define RADMON_CREATE_COMMAND_1ARG(command, guidance, argName0) \
|
||||
RADMON_CREATE_COMMAND_0ARGS(command, guidance); \
|
||||
_ADD_ARG(command, argName0)
|
||||
|
||||
#define RADMON_CREATE_COMMAND_2ARGS(command, guidance, argName0, argName1) \
|
||||
RADMON_CREATE_COMMAND_1ARG(command, guidance, argName0); \
|
||||
_ADD_ARG(command, argName1)
|
||||
|
||||
#define RADMON_CREATE_COMMAND_3ARGS(command, guidance, argName0, argName1, argName2) \
|
||||
RADMON_CREATE_COMMAND_2ARGS(command, guidance, argName0, argName1); \
|
||||
_ADD_ARG(command, argName2)
|
||||
|
||||
#define RADMON_CREATE_COMMAND_4ARGS(command, guidance, argName0, argName1, argName2, argName3) \
|
||||
RADMON_CREATE_COMMAND_3ARGS(command, guidance, argName0, argName1, argName2); \
|
||||
_ADD_ARG(command, argName3)
|
||||
|
||||
#define RADMON_CREATE_COMMAND_5ARGS(command, guidance, argName0, argName1, argName2, argName3, argName4) \
|
||||
RADMON_CREATE_COMMAND_4ARGS(command, guidance, argName0, argName1, argName2, argName3); \
|
||||
_ADD_ARG(command, argName4)
|
||||
|
||||
#define RADMON_CREATE_COMMAND_6ARGS(command, guidance, argName0, argName1, argName2, argName3, argName4, argName5) \
|
||||
RADMON_CREATE_COMMAND_5ARGS(command, guidance, argName0, argName1, argName2, argName3, argName4); \
|
||||
_ADD_ARG(command, argName5)
|
||||
|
||||
#define RADMON_DESTROY_COMMAND(command) if ( cmd ## command ) \
|
||||
delete cmd ## command;
|
||||
|
||||
#define RADMON_BEGIN_LIST_SET_COMMANDS if (!command) \
|
||||
G4cout << "RadmonDetectorMessenger::SetNewValue: command==0." << G4endl; \
|
||||
else
|
||||
|
||||
#define RADMON_SET_COMMAND(name) if ( cmd ## name == command) \
|
||||
On ## name (newValue); \
|
||||
else
|
||||
|
||||
#define RADMON_END_LIST_SET_COMMANDS G4cout << "RadmonDetectorMessenger::SetNewValue: Command \"" << command->GetCommandPath() << "\" not supported." << G4endl;
|
||||
#endif /* RADMONMESSENGERSSUPPORT_HH */
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonTLabelledCollection.hh
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonTLabelledCollection.hh,v 1.4 2006/06/29 16:14:29 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
// Description: Container for objects with the following methods
|
||||
// - Constructor
|
||||
// - Copy-constructor
|
||||
// - Destructor
|
||||
// - Copy operation
|
||||
// - const G4String & GetLabel(void) const
|
||||
//
|
||||
|
||||
#ifndef RADMONTLABELLEDCOLLECTION_HH
|
||||
#define RADMONTLABELLEDCOLLECTION_HH
|
||||
|
||||
// Include files
|
||||
#include "globals.hh"
|
||||
|
||||
#include <vector>
|
||||
|
||||
// Forward declarations
|
||||
class G4String;
|
||||
|
||||
template <typename LabelledObject>
|
||||
class RadmonTLabelledCollection
|
||||
{
|
||||
public:
|
||||
RadmonTLabelledCollection();
|
||||
RadmonTLabelledCollection(const RadmonTLabelledCollection<LabelledObject> & copy);
|
||||
~RadmonTLabelledCollection();
|
||||
|
||||
RadmonTLabelledCollection<LabelledObject> & operator=(const RadmonTLabelledCollection<LabelledObject> & copy);
|
||||
|
||||
G4int GetNItems() const;
|
||||
G4bool Empty() const;
|
||||
|
||||
G4bool ExistsItemByLabel(const G4String & label) const;
|
||||
G4int MultiplicityItemByLabel(const G4String & label) const;
|
||||
|
||||
const LabelledObject & GetItem(G4int index) const;
|
||||
LabelledObject & GetItem(G4int index);
|
||||
const LabelledObject & FindItemByLabel(const G4String & label, G4int count = 0) const;
|
||||
LabelledObject & FindItemByLabel(const G4String & label, G4int count = 0);
|
||||
|
||||
LabelledObject & InsertItemAfter(G4int index);
|
||||
LabelledObject & InsertItemBefore(G4int index);
|
||||
LabelledObject & AppendItem(void);
|
||||
LabelledObject & PrependItem(void);
|
||||
|
||||
void RemoveItemByLabel(const G4String & label, G4int count = 0);
|
||||
void RemoveItemsByLabel(const G4String & label);
|
||||
void RemoveItem(G4int index);
|
||||
void RemoveItemsByRange(G4int first, G4int last);
|
||||
void RemoveAllItems();
|
||||
|
||||
private:
|
||||
typedef std::vector<LabelledObject> Collection;
|
||||
Collection collection;
|
||||
};
|
||||
|
||||
// Inline implementations
|
||||
#include "RadmonTLabelledCollection.icc"
|
||||
#endif /* RADMONTLABELLEDCOLLECTION_HH */
|
||||
+298
@@ -0,0 +1,298 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonTLabelledCollection.icc
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonTLabelledCollection.icc,v 1.6 2006/06/29 16:14:31 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
|
||||
#ifndef RADMONTLABELLEDCOLLECTION_HH
|
||||
#error "RadmonTLabelledCollection.icc cannot be included directly. Please use RadmonTLabelledCollection.hh"
|
||||
#else /* RADMONTLABELLEDCOLLECTION_HH */
|
||||
template <typename LabelledObject>
|
||||
RadmonTLabelledCollection<LabelledObject> :: RadmonTLabelledCollection()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
RadmonTLabelledCollection<LabelledObject> :: RadmonTLabelledCollection(const RadmonTLabelledCollection<LabelledObject> & copy)
|
||||
{
|
||||
collection=copy.collection;
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
RadmonTLabelledCollection<LabelledObject> :: ~RadmonTLabelledCollection()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
RadmonTLabelledCollection<LabelledObject> & RadmonTLabelledCollection<LabelledObject> :: operator=(const RadmonTLabelledCollection<LabelledObject> & copy)
|
||||
{
|
||||
collection=copy.collection;
|
||||
|
||||
return (*this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
G4int RadmonTLabelledCollection<LabelledObject> :: GetNItems() const
|
||||
{
|
||||
return collection.size();
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
G4bool RadmonTLabelledCollection<LabelledObject> :: Empty() const
|
||||
{
|
||||
return collection.empty();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
G4bool RadmonTLabelledCollection<LabelledObject> :: ExistsItemByLabel(const G4String & label) const
|
||||
{
|
||||
size_t i(collection.size());
|
||||
|
||||
while (i>0)
|
||||
{
|
||||
i--;
|
||||
if (collection[i].GetLabel()==label)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
G4int RadmonTLabelledCollection<LabelledObject> :: MultiplicityItemByLabel(const G4String & label) const
|
||||
{
|
||||
G4int count(0);
|
||||
size_t i(collection.size());
|
||||
|
||||
while (i>0)
|
||||
{
|
||||
i--;
|
||||
if (collection[i].GetLabel()==label)
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
const LabelledObject & RadmonTLabelledCollection<LabelledObject> :: GetItem(G4int index) const
|
||||
{
|
||||
return collection[index];
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
LabelledObject & RadmonTLabelledCollection<LabelledObject> :: GetItem(G4int index)
|
||||
{
|
||||
return collection[index];
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
const LabelledObject & RadmonTLabelledCollection<LabelledObject> :: FindItemByLabel(const G4String & label, G4int count) const
|
||||
{
|
||||
return const_cast<RadmonTLabelledCollection *>(this)->FindItemByLabel(label, count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
LabelledObject & RadmonTLabelledCollection<LabelledObject> :: FindItemByLabel(const G4String & label, G4int count)
|
||||
{
|
||||
typename Collection::iterator i(collection.begin());
|
||||
typename Collection::iterator const end(collection.end());
|
||||
|
||||
while (i<end)
|
||||
{
|
||||
if (i->GetLabel()==label)
|
||||
{
|
||||
if (count==0)
|
||||
return (*i);
|
||||
|
||||
count--;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
G4String text("RadmonTLabelledCollection::FindItemByLabel: Label \"");
|
||||
text+=label;
|
||||
text+="\" not found.";
|
||||
|
||||
G4Exception(text);
|
||||
|
||||
return collection.front();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
LabelledObject & RadmonTLabelledCollection<LabelledObject> :: InsertItemAfter(G4int index)
|
||||
{
|
||||
return InsertBefore(index+1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
LabelledObject & RadmonTLabelledCollection<LabelledObject> :: InsertItemBefore(G4int index)
|
||||
{
|
||||
typename Collection::iterator i(collection.begin());
|
||||
i+=index;
|
||||
|
||||
collection.insert(i, LabelledObject());
|
||||
|
||||
return collection[index];
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
LabelledObject & RadmonTLabelledCollection<LabelledObject> :: AppendItem(void)
|
||||
{
|
||||
collection.push_back(LabelledObject());
|
||||
return collection.back();
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
LabelledObject & RadmonTLabelledCollection<LabelledObject> :: PrependItem(void)
|
||||
{
|
||||
collection.insert(collection.begin(), LabelledObject());
|
||||
return collection.front();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
void RadmonTLabelledCollection<LabelledObject> :: RemoveItemByLabel(const G4String & label, G4int count)
|
||||
{
|
||||
typename Collection::iterator i(collection.begin());
|
||||
typename Collection::iterator const end(collection.end());
|
||||
|
||||
while (i<end)
|
||||
{
|
||||
if (i->GetLabel()==label)
|
||||
{
|
||||
if (count==0)
|
||||
{
|
||||
collection.erase(i);
|
||||
return;
|
||||
}
|
||||
|
||||
count--;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
void RadmonTLabelledCollection<LabelledObject> :: RemoveItemsByLabel(const G4String & label)
|
||||
{
|
||||
typename Collection::iterator i(collection.begin());
|
||||
typename Collection::iterator const end(collection.end());
|
||||
|
||||
while (i<end)
|
||||
{
|
||||
if (i->GetLabel()==label)
|
||||
i=collection.erase(i);
|
||||
else
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
void RadmonTLabelledCollection<LabelledObject> :: RemoveItem(G4int index)
|
||||
{
|
||||
typename Collection::iterator i(collection.begin());
|
||||
i+=index;
|
||||
|
||||
collection.erase(i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
void RadmonTLabelledCollection<LabelledObject> :: RemoveItemsByRange(G4int first, G4int last)
|
||||
{
|
||||
typename Collection::iterator i(collection.begin());
|
||||
typename Collection::iterator j(i);
|
||||
|
||||
i+=first;
|
||||
j+=last;
|
||||
|
||||
collection.erase(i, j);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename LabelledObject>
|
||||
void RadmonTLabelledCollection<LabelledObject> :: RemoveAllItems()
|
||||
{
|
||||
collection.clear();
|
||||
}
|
||||
#endif /* RADMONTLABELLEDCOLLECTION_HH */
|
||||
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonTokenizer.hh
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonTokenizer.hh,v 1.3 2006/06/29 16:14:33 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
// Description: Reads single tokens of a string
|
||||
//
|
||||
|
||||
#ifndef RADMONTOKENIZER_HH
|
||||
#define RADMONTOKENIZER_HH
|
||||
|
||||
// Include files
|
||||
#include "globals.hh"
|
||||
#include "G4String.hh"
|
||||
|
||||
class RadmonTokenizer
|
||||
{
|
||||
public:
|
||||
inline RadmonTokenizer(const G4String & str);
|
||||
inline ~RadmonTokenizer();
|
||||
|
||||
inline void rewind(void);
|
||||
G4String operator()(const char * separators=" \t\n", const char * quotations="'\"");
|
||||
|
||||
inline G4bool eos(void) const;
|
||||
|
||||
private:
|
||||
// Hidden constructors and operators
|
||||
RadmonTokenizer();
|
||||
RadmonTokenizer(const RadmonTokenizer & copy);
|
||||
RadmonTokenizer & operator=(const RadmonTokenizer & copy);
|
||||
|
||||
// Private attributes
|
||||
str_size position;
|
||||
G4String data;
|
||||
};
|
||||
|
||||
// Inline implementations
|
||||
#include "RadmonTokenizer.icc"
|
||||
#endif /* RADMONTOKENIZER_HH */
|
||||
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonTokenizer.icc
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonTokenizer.icc,v 1.3 2006/06/29 16:14:35 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
|
||||
#ifndef RADMONTOKENIZER_HH
|
||||
#error "RadmonTokenizer.icc cannot be included directly. Please use RadmonTokenizer.hh"
|
||||
#else /* RADMONTOKENIZER_HH */
|
||||
inline RadmonTokenizer :: RadmonTokenizer(const G4String & str)
|
||||
:
|
||||
position(0),
|
||||
data(str)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline RadmonTokenizer :: ~RadmonTokenizer()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
inline void RadmonTokenizer :: rewind(void)
|
||||
{
|
||||
position=0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
inline G4bool RadmonTokenizer :: eos(void) const
|
||||
{
|
||||
return position>=data.size();
|
||||
}
|
||||
#endif /* RADMONTOKENIZER_HH */
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonVLayoutObserver.hh
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonVLayoutObserver.hh,v 1.3 2006/06/29 16:14:37 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
// Description: Observer class of the observer-subjectmodel for the detector
|
||||
// layout
|
||||
//
|
||||
|
||||
#ifndef RADMONVLAYOUTOBSERVER_HH
|
||||
#define RADMONVLAYOUTOBSERVER_HH
|
||||
|
||||
class RadmonVLayoutSubject;
|
||||
|
||||
class RadmonVLayoutObserver
|
||||
{
|
||||
public:
|
||||
virtual void OnLayoutChange(void) = 0;
|
||||
|
||||
protected:
|
||||
inline RadmonVLayoutObserver();
|
||||
inline ~RadmonVLayoutObserver();
|
||||
|
||||
private:
|
||||
// Hidden constructors and operators
|
||||
RadmonVLayoutObserver(const RadmonVLayoutObserver & copy);
|
||||
RadmonVLayoutObserver & operator=(const RadmonVLayoutObserver & copy);
|
||||
};
|
||||
|
||||
// Inline implementations
|
||||
#include "RadmonVLayoutObserver.icc"
|
||||
#endif /* RADMONVLAYOUTOBSERVER_HH */
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonVLayoutObserver.icc
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonVLayoutObserver.icc,v 1.3 2006/06/29 16:14:39 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
|
||||
#ifndef RADMONVLAYOUTOBSERVER_HH
|
||||
#error "RadmonVLayoutObserver.icc cannot be included directly. Please use RadmonVLayoutObserver.hh"
|
||||
#else /* RADMONVLAYOUTOBSERVER_HH */
|
||||
inline RadmonVLayoutObserver :: RadmonVLayoutObserver()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline RadmonVLayoutObserver :: ~RadmonVLayoutObserver()
|
||||
{
|
||||
}
|
||||
#endif /* RADMONVLAYOUTOBSERVER_HH */
|
||||
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonVLayoutSubject.hh
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonVLayoutSubject.hh,v 1.2.2.2 2006/06/29 16:14:41 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
// Description: Subject class of the observer-subjectmodel for the detector
|
||||
// layout
|
||||
//
|
||||
|
||||
#ifndef RADMONVLAYOUTSUBJECT_HH
|
||||
#define RADMONVLAYOUTSUBJECT_HH
|
||||
|
||||
// Include files
|
||||
#include <set>
|
||||
|
||||
// Forward declarations
|
||||
class RadmonVLayoutObserver;
|
||||
|
||||
class RadmonVLayoutSubject
|
||||
{
|
||||
public:
|
||||
void AttachObserver(RadmonVLayoutObserver * observer);
|
||||
void DetachObserver(RadmonVLayoutObserver * observer);
|
||||
|
||||
protected:
|
||||
inline RadmonVLayoutSubject();
|
||||
inline ~RadmonVLayoutSubject();
|
||||
|
||||
void NotifyChange(void);
|
||||
|
||||
private:
|
||||
// Hidden constructors and operators
|
||||
RadmonVLayoutSubject(const RadmonVLayoutSubject & copy);
|
||||
RadmonVLayoutSubject & operator=(const RadmonVLayoutSubject & copy);
|
||||
|
||||
// Private attributes
|
||||
typedef std::set<RadmonVLayoutObserver *> ObserversSet;
|
||||
ObserversSet observersSet;
|
||||
};
|
||||
|
||||
// Inline implementations
|
||||
#include "RadmonVLayoutSubject.icc"
|
||||
#endif /* RADMONVLAYOUTSUBJECT_HH */
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonVLayoutSubject.icc
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonVLayoutSubject.icc,v 1.3 2006/06/29 16:14:43 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
|
||||
#ifndef RADMONVLAYOUTSUBJECT_HH
|
||||
#error "RadmonVLayoutSubject.icc cannot be included directly. Please use RadmonVLayoutSubject.hh"
|
||||
#else /* RADMONVLAYOUTSUBJECT_HH */
|
||||
inline RadmonVLayoutSubject :: RadmonVLayoutSubject()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline RadmonVLayoutSubject :: ~RadmonVLayoutSubject()
|
||||
{
|
||||
}
|
||||
#endif /* RADMONVLAYOUTSUBJECT_HH */
|
||||
+343
@@ -0,0 +1,343 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonLayoutEntityWithAttributes.cc
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonLayoutEntityWithAttributes.cc,v 1.5 2006/06/29 16:14:45 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
|
||||
// Include files
|
||||
#include "RadmonLayoutEntityWithAttributes.hh"
|
||||
#include "RadmonDumpStyle.hh"
|
||||
#include "RadmonMessenger.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
#include <iomanip>
|
||||
|
||||
|
||||
|
||||
G4int RadmonLayoutEntityWithAttributes :: GetNAttributes(void) const
|
||||
{
|
||||
return attributesVector.size();
|
||||
}
|
||||
|
||||
|
||||
|
||||
const G4String & RadmonLayoutEntityWithAttributes :: GetAttributeName(G4int index) const
|
||||
{
|
||||
return attributesVector[index].first;
|
||||
}
|
||||
|
||||
|
||||
|
||||
G4String RadmonLayoutEntityWithAttributes :: GetAttribute(const G4String & attributeName, const G4String & defaultValue) const
|
||||
{
|
||||
AttributesVector::const_iterator i(attributesVector.begin());
|
||||
AttributesVector::const_iterator end(attributesVector.end());
|
||||
|
||||
while (i!=end)
|
||||
{
|
||||
if (i->first==attributeName)
|
||||
return i->second;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
G4bool RadmonLayoutEntityWithAttributes :: ExistsAttribute(const G4String & attributeName) const
|
||||
{
|
||||
AttributesVector::const_iterator i(attributesVector.begin());
|
||||
AttributesVector::const_iterator end(attributesVector.end());
|
||||
|
||||
while (i!=end)
|
||||
{
|
||||
if (i->first==attributeName)
|
||||
return true;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void RadmonLayoutEntityWithAttributes :: SetAttribute(const G4String & attributeName, const G4String & value)
|
||||
{
|
||||
AttributesVector::iterator i(attributesVector.begin());
|
||||
AttributesVector::iterator end(attributesVector.end());
|
||||
|
||||
while (i!=end)
|
||||
{
|
||||
if (i->first==attributeName)
|
||||
{
|
||||
i->second=value;
|
||||
return;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
size_t n(attributesVector.size());
|
||||
attributesVector.resize(n+1);
|
||||
attributesVector[n].first=attributeName;
|
||||
attributesVector[n].second=value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void RadmonLayoutEntityWithAttributes :: ClearAttribute(const G4String & attributeName)
|
||||
{
|
||||
AttributesVector::iterator i(attributesVector.begin());
|
||||
AttributesVector::iterator end(attributesVector.end());
|
||||
|
||||
while (i!=end)
|
||||
{
|
||||
if (i->first==attributeName)
|
||||
{
|
||||
attributesVector.erase(i);
|
||||
return;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void RadmonLayoutEntityWithAttributes :: ClearAllAttributes(void)
|
||||
{
|
||||
attributesVector.clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
G4double RadmonLayoutEntityWithAttributes :: GetAttributeAsDouble(const G4String & attributeName, double defaultValue) const
|
||||
{
|
||||
G4String str;
|
||||
|
||||
str=GetAttribute(attributeName, "#");
|
||||
if (str=="#")
|
||||
return defaultValue;
|
||||
|
||||
G4String args[1];
|
||||
if (!RadmonMessenger::ProcessArguments(str, 1, args))
|
||||
return defaultValue;
|
||||
|
||||
return G4UIcommand::ConvertToDouble(args[0]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
G4double RadmonLayoutEntityWithAttributes :: GetAttributeAsMeasure(const G4String & attributeName, const char * category, double defaultValue) const
|
||||
{
|
||||
G4String str;
|
||||
|
||||
str=GetAttribute(attributeName, "#");
|
||||
if (str=="#")
|
||||
return defaultValue;
|
||||
|
||||
G4String args[2];
|
||||
if (!RadmonMessenger::ProcessArguments(str, 2, args))
|
||||
return defaultValue;
|
||||
|
||||
G4double unit(RadmonMessenger::GetUnit(args[1], category));
|
||||
if (unit<=0.)
|
||||
return defaultValue;
|
||||
|
||||
return G4UIcommand::ConvertToDouble(args[0])*unit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
G4int RadmonLayoutEntityWithAttributes :: GetAttributeAsInteger(const G4String & attributeName, G4int defaultValue) const
|
||||
{
|
||||
G4String str;
|
||||
|
||||
str=GetAttribute(attributeName, "#");
|
||||
if (str=="#")
|
||||
return defaultValue;
|
||||
|
||||
G4String args[1];
|
||||
if (!RadmonMessenger::ProcessArguments(str, 1, args))
|
||||
return defaultValue;
|
||||
|
||||
return G4UIcommand::ConvertToInt(args[0]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
G4ThreeVector RadmonLayoutEntityWithAttributes :: GetAttributeAsThreeVector(const G4String & attributeName, const G4ThreeVector & defaultValue) const
|
||||
{
|
||||
G4String str;
|
||||
|
||||
str=GetAttribute(attributeName, "#");
|
||||
if (str=="#")
|
||||
return defaultValue;
|
||||
|
||||
G4String args[3];
|
||||
if (!RadmonMessenger::ProcessArguments(str, 3, args))
|
||||
return defaultValue;
|
||||
|
||||
return G4ThreeVector(G4UIcommand::ConvertToDouble(args[0]), G4UIcommand::ConvertToDouble(args[1]), G4UIcommand::ConvertToDouble(args[2]));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
G4ThreeVector RadmonLayoutEntityWithAttributes :: GetAttributeAsThreeVectorWithMeasure(const G4String & attributeName, const char * category, const G4ThreeVector & defaultValue) const
|
||||
{
|
||||
G4String str;
|
||||
|
||||
str=GetAttribute(attributeName, "#");
|
||||
if (str=="#")
|
||||
return defaultValue;
|
||||
|
||||
G4String args[4];
|
||||
if (!RadmonMessenger::ProcessArguments(str, 4, args))
|
||||
return defaultValue;
|
||||
|
||||
G4double unit(RadmonMessenger::GetUnit(args[3], category));
|
||||
if (unit<=0.)
|
||||
return defaultValue;
|
||||
|
||||
return G4ThreeVector(G4UIcommand::ConvertToDouble(args[0])*unit, G4UIcommand::ConvertToDouble(args[1])*unit, G4UIcommand::ConvertToDouble(args[2])*unit);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
G4ThreeVector RadmonLayoutEntityWithAttributes :: GetAttributeAsDirection(const G4String & attributeName, const G4ThreeVector & defaultValue) const
|
||||
{
|
||||
G4String str;
|
||||
|
||||
str=GetAttribute(attributeName, "#");
|
||||
if (str=="#")
|
||||
return defaultValue;
|
||||
|
||||
G4String args[3];
|
||||
if (!RadmonMessenger::ProcessArguments(str, 3, args))
|
||||
return defaultValue;
|
||||
|
||||
G4double theta(RadmonMessenger::GetUnit(args[2], "Angle"));
|
||||
if (theta<=0.)
|
||||
return defaultValue;
|
||||
|
||||
G4double phi(theta*G4UIcommand::ConvertToDouble(args[1]));
|
||||
theta*=G4UIcommand::ConvertToDouble(args[0]);
|
||||
|
||||
G4ThreeVector axis;
|
||||
axis.setRThetaPhi(1., theta/rad, phi/rad);
|
||||
|
||||
return axis;
|
||||
}
|
||||
|
||||
|
||||
|
||||
G4RotationMatrix RadmonLayoutEntityWithAttributes :: GetAttributeAsRotationMatrix(const G4String & attributeName, const G4RotationMatrix & defaultValue) const
|
||||
{
|
||||
G4String str;
|
||||
|
||||
str=GetAttribute(attributeName, "#");
|
||||
if (str=="#")
|
||||
return defaultValue;
|
||||
|
||||
G4String args[4];
|
||||
if (!RadmonMessenger::ProcessArguments(str, 4, args))
|
||||
return defaultValue;
|
||||
|
||||
G4double theta(RadmonMessenger::GetUnit(args[3], "Angle"));
|
||||
if (theta<=0.)
|
||||
return defaultValue;
|
||||
|
||||
G4double phi(theta*G4UIcommand::ConvertToDouble(args[1]));
|
||||
G4double delta(theta*G4UIcommand::ConvertToDouble(args[2]));
|
||||
theta*=G4UIcommand::ConvertToDouble(args[0]);
|
||||
|
||||
G4ThreeVector axis;
|
||||
axis.setRThetaPhi(1., theta/rad, phi/rad);
|
||||
|
||||
return G4RotationMatrix(axis, delta/rad);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void RadmonLayoutEntityWithAttributes :: DumpAttributesLayout(std::ostream & out, const G4String & indent) const
|
||||
{
|
||||
AttributesVector::const_iterator i(attributesVector.begin());
|
||||
AttributesVector::const_iterator end(attributesVector.end());
|
||||
|
||||
if (i==end)
|
||||
{
|
||||
out << indent << "No attributes defined.\n";
|
||||
return;
|
||||
}
|
||||
|
||||
G4int width(RADMONDUMP_INDENT_WIDTH-1-indent.length());
|
||||
if (width<0)
|
||||
width=0;
|
||||
|
||||
G4int width2;
|
||||
|
||||
while (i!=end)
|
||||
{
|
||||
width2=width-i->first.length();
|
||||
if (width2<0)
|
||||
width2=0;
|
||||
|
||||
out << indent << '\"' << i->first << std::setw(width2);
|
||||
out.setf(std::ostream::left, std::ostream::adjustfield);
|
||||
out << "\"";
|
||||
out.setf(std::ostream::right, std::ostream::adjustfield);
|
||||
out << " = \"" << i->second << "\"\n";
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void RadmonLayoutEntityWithAttributes :: CopyFrom(const RadmonLayoutEntityWithAttributes & copy)
|
||||
{
|
||||
attributesVector=copy.attributesVector;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonMessenger.cc
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonMessenger.cc,v 1.3 2006/06/29 16:14:47 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
|
||||
// Include files
|
||||
#include "RadmonMessenger.hh"
|
||||
#include "RadmonTokenizer.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4String.hh"
|
||||
|
||||
#include <fstream>
|
||||
|
||||
G4bool RadmonMessenger :: ProcessArguments(const G4String & rawArguments, G4int nArgs, G4String * arguments)
|
||||
{
|
||||
RadmonTokenizer args(rawArguments);
|
||||
|
||||
for (G4int i(0); i<nArgs; i++)
|
||||
{
|
||||
if (args.eos())
|
||||
{
|
||||
G4cout << "RadmonMessenger::ProcessArguments: " << (nArgs-i) << " arguments missing." << G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
arguments[i]=args();
|
||||
}
|
||||
|
||||
if (!args.eos())
|
||||
{
|
||||
G4cout << "RadmonMessenger::ProcessArguments: Unexpected arguments after \"" << arguments[nArgs-1] << "\"." << G4endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
G4double RadmonMessenger :: GetUnit(const G4String & unitStr, const char * category)
|
||||
{
|
||||
G4double dbl(G4UnitDefinition::GetValueOf(unitStr));
|
||||
|
||||
if (dbl<=0.)
|
||||
{
|
||||
G4cout << "RadmonMessenger::GetUnit(): Unknown unit of measure \"" << unitStr << "\"." << G4endl;
|
||||
return -1.;
|
||||
}
|
||||
|
||||
if (G4UnitDefinition::GetCategory(unitStr)!=category)
|
||||
{
|
||||
G4cout << "RadmonMessenger::GetUnit(): Unit of measure \"" << unitStr << "\" is not a " << category << '.' << G4endl;
|
||||
return -1.;
|
||||
}
|
||||
|
||||
return dbl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
RadmonMessenger :: RadmonMessenger(const char * path, const char * guidance)
|
||||
{
|
||||
directory=new G4UIdirectory(path);
|
||||
|
||||
if (directory==0)
|
||||
{
|
||||
G4String text("RadmonMaterialsMessenger::RadmonMaterialsMessenger: \"");
|
||||
text+=path;
|
||||
text+="\" directory not allocated.";
|
||||
|
||||
G4Exception(text);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (guidance)
|
||||
directory->SetGuidance(guidance);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
std::istream * RadmonMessenger :: OpenForInput(const G4String & fileName) const
|
||||
{
|
||||
std::ifstream * in(new std::ifstream(fileName.data()));
|
||||
|
||||
if (!in)
|
||||
{
|
||||
G4cout << "RadmonMessenger::OpenForInput(): Cannot allocate class std::ifstream." << G4endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!in->good())
|
||||
{
|
||||
G4cout << "RadmonMessenger::OpenForInput(): Cannot access to file \"" << fileName << "\" for read." << G4endl;
|
||||
delete in;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::ostream * RadmonMessenger :: OpenForOutput(const G4String & fileName) const
|
||||
{
|
||||
std::ofstream * out(new std::ofstream(fileName.data()));
|
||||
|
||||
if (!out)
|
||||
{
|
||||
G4cout << "RadmonMessenger::OpenForOutput(): Cannot allocate class std::ofstream." << G4endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!out->good())
|
||||
{
|
||||
G4cout << "RadmonMessenger::OpenForOutput(): Cannot access to file \"" << fileName << "\" for write." << G4endl;
|
||||
delete out;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonTokenizer.cc
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonTokenizer.cc,v 1.3 2006/06/29 16:14:49 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
|
||||
// Include files
|
||||
#include "RadmonTokenizer.hh"
|
||||
|
||||
G4String RadmonTokenizer :: operator()(const char * separators, const char * quotations)
|
||||
{
|
||||
size_t i;
|
||||
char c;
|
||||
|
||||
while (position<data.size())
|
||||
{
|
||||
i=0;
|
||||
c=data[position];
|
||||
|
||||
while (separators[i]!=0)
|
||||
{
|
||||
if (c==separators[i])
|
||||
break;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
if (separators[i]==0)
|
||||
break;
|
||||
|
||||
position++;
|
||||
}
|
||||
|
||||
if (position>=data.size())
|
||||
return G4String();
|
||||
|
||||
i=0;
|
||||
while (quotations[i]!=0)
|
||||
{
|
||||
if (c==quotations[i])
|
||||
break;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
char pattern[2];
|
||||
|
||||
if (quotations[i]!=0)
|
||||
{
|
||||
pattern[0]=quotations[i];
|
||||
pattern[1]=0;
|
||||
|
||||
separators=pattern;
|
||||
position++;
|
||||
}
|
||||
|
||||
str_size start(position);
|
||||
|
||||
while (position<data.size())
|
||||
{
|
||||
i=0;
|
||||
c=data[position];
|
||||
|
||||
while (separators[i]!=0)
|
||||
{
|
||||
if (c==separators[i])
|
||||
break;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
if (separators[i]!=0)
|
||||
break;
|
||||
|
||||
position++;
|
||||
}
|
||||
|
||||
str_size stop(position);
|
||||
position++;
|
||||
|
||||
return data(start, stop-start);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// File name: RadmonVLayoutSubject.cc
|
||||
// Creation date: Sep 2005
|
||||
// Main author: Riccardo Capra <capra@ge.infn.it>
|
||||
//
|
||||
// Id: $Id: RadmonVLayoutSubject.cc,v 1.3 2006/06/29 16:14:51 gunter Exp $
|
||||
// Tag: $Name: geant4-08-01 $
|
||||
//
|
||||
|
||||
// Include files
|
||||
#include "RadmonVLayoutSubject.hh"
|
||||
|
||||
#include "RadmonVLayoutObserver.hh"
|
||||
|
||||
|
||||
void RadmonVLayoutSubject :: AttachObserver(RadmonVLayoutObserver * observer)
|
||||
{
|
||||
observersSet.insert(observer);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void RadmonVLayoutSubject :: DetachObserver(RadmonVLayoutObserver * observer)
|
||||
{
|
||||
observersSet.erase(observer);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void RadmonVLayoutSubject :: NotifyChange(void)
|
||||
{
|
||||
ObserversSet::iterator i=observersSet.begin();
|
||||
ObserversSet::iterator end=observersSet.end();
|
||||
|
||||
while (i!=end)
|
||||
{
|
||||
(*i)->OnLayoutChange();
|
||||
i++;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user