source: trunk/source/persistency/gdml/include/G4GDMLReadDefine.hh @ 1202

Last change on this file since 1202 was 987, checked in by garnier, 15 years ago

fichiers manquants

File size: 3.6 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26// class G4GDMLReadDefine
27//
28// Class description:
29//
30// GDML class for positionings and transformations according to
31// specifications in Geant4.
32
33// History:
34// - Created.                                  Zoltan Torzsok, November 2007
35// -------------------------------------------------------------------------
36
37#ifndef _G4GDMLREADDEFINE_INCLUDED_
38#define _G4GDMLREADDEFINE_INCLUDED_
39
40#include <map>
41
42#include "G4ThreeVector.hh"
43#include "G4GDMLRead.hh"
44
45class G4GDMLMatrix
46{
47
48 public:
49
50   G4GDMLMatrix();
51   G4GDMLMatrix(size_t rows0,size_t cols0);
52   ~G4GDMLMatrix();
53
54   void Set(size_t r,size_t c,G4double a);
55   G4double Get(size_t r,size_t c) const;
56   size_t GetRows() const;
57   size_t GetCols() const;
58
59 private:
60
61   G4double *m;
62   size_t rows,cols;
63};
64
65class G4GDMLReadDefine : public G4GDMLRead
66{
67
68 public:
69
70   G4double GetConstant(const G4String&);
71   G4double GetVariable(const G4String&);
72   G4double GetQuantity(const G4String&);
73   G4ThreeVector GetPosition(const G4String&);
74   G4ThreeVector GetRotation(const G4String&);
75   G4ThreeVector GetScale(const G4String&);
76   G4GDMLMatrix GetMatrix(const G4String&);
77
78   virtual void DefineRead(const xercesc::DOMElement* const);
79
80 protected:
81
82   G4RotationMatrix GetRotationMatrix(const G4ThreeVector&);
83   void VectorRead(const xercesc::DOMElement* const,G4ThreeVector&);
84   G4String RefRead(const xercesc::DOMElement* const);
85
86   void ConstantRead(const xercesc::DOMElement* const); 
87   void MatrixRead(const xercesc::DOMElement* const);
88   void PositionRead(const xercesc::DOMElement* const);
89   void RotationRead(const xercesc::DOMElement* const);
90   void ScaleRead(const xercesc::DOMElement* const);
91   void VariableRead(const xercesc::DOMElement* const); 
92   void QuantityRead(const xercesc::DOMElement* const); 
93
94 protected:
95
96   std::map<G4String,G4double> quantityMap;
97   std::map<G4String,G4ThreeVector> positionMap;
98   std::map<G4String,G4ThreeVector> rotationMap;
99   std::map<G4String,G4ThreeVector> scaleMap;
100   std::map<G4String,G4GDMLMatrix> matrixMap;
101};
102
103#endif
Note: See TracBrowser for help on using the repository browser.