G4GDMLReadDefine.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // class G4GDMLReadDefine
00027 //
00028 // Class description:
00029 //
00030 // GDML class for positionings and transformations according to
00031 // specifications in Geant4.
00032 
00033 // History:
00034 // - Created.                                  Zoltan Torzsok, November 2007
00035 // -------------------------------------------------------------------------
00036 
00037 #ifndef _G4GDMLREADDEFINE_INCLUDED_
00038 #define _G4GDMLREADDEFINE_INCLUDED_
00039 
00040 #include <map>
00041 
00042 #include "G4ThreeVector.hh"
00043 #include "G4RotationMatrix.hh"
00044 
00045 #include "G4GDMLRead.hh"
00046 
00047 class G4GDMLMatrix
00048 {
00049 
00050  public:
00051 
00052    G4GDMLMatrix();
00053    G4GDMLMatrix(size_t rows0,size_t cols0);
00054    G4GDMLMatrix(const G4GDMLMatrix& rhs);
00055    G4GDMLMatrix& operator=(const G4GDMLMatrix& rhs); 
00056   ~G4GDMLMatrix();
00057 
00058    void Set(size_t r,size_t c,G4double a);
00059    G4double Get(size_t r,size_t c) const;
00060    size_t GetRows() const;
00061    size_t GetCols() const;
00062 
00063  private:
00064 
00065    G4double *m;
00066    size_t rows,cols;
00067 };
00068 
00069 class G4GDMLReadDefine : public G4GDMLRead
00070 {
00071 
00072  public:
00073 
00074    G4bool IsValidID(const G4String&) const;
00075    G4double GetConstant(const G4String&);
00076    G4double GetVariable(const G4String&);
00077    G4double GetQuantity(const G4String&);
00078    G4ThreeVector GetPosition(const G4String&);
00079    G4ThreeVector GetRotation(const G4String&);
00080    G4ThreeVector GetScale(const G4String&);
00081    G4GDMLMatrix GetMatrix(const G4String&);
00082 
00083    virtual void DefineRead(const xercesc::DOMElement* const);
00084 
00085  protected:
00086 
00087    G4GDMLReadDefine();
00088    virtual ~G4GDMLReadDefine();
00089 
00090    G4RotationMatrix GetRotationMatrix(const G4ThreeVector&);
00091    void VectorRead(const xercesc::DOMElement* const,G4ThreeVector&);
00092    G4String RefRead(const xercesc::DOMElement* const);
00093 
00094    void ConstantRead(const xercesc::DOMElement* const); 
00095    void MatrixRead(const xercesc::DOMElement* const);
00096    void PositionRead(const xercesc::DOMElement* const);
00097    void RotationRead(const xercesc::DOMElement* const);
00098    void ScaleRead(const xercesc::DOMElement* const);
00099    void VariableRead(const xercesc::DOMElement* const); 
00100    void QuantityRead(const xercesc::DOMElement* const);
00101    void ExpressionRead(const xercesc::DOMElement* const);
00102 
00103  protected:
00104 
00105    std::map<G4String,G4double> quantityMap;
00106    std::map<G4String,G4ThreeVector> positionMap;
00107    std::map<G4String,G4ThreeVector> rotationMap;
00108    std::map<G4String,G4ThreeVector> scaleMap;
00109    std::map<G4String,G4GDMLMatrix> matrixMap;
00110 };
00111 
00112 #endif

Generated on Mon May 27 17:48:19 2013 for Geant4 by  doxygen 1.4.7