Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:19

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4GDMLWriteDefine
0027 //
0028 // Class description:
0029 //
0030 // GDML writer class for positionings and transformations.
0031 
0032 // Author: Zoltan Torzsok, November 2007
0033 // --------------------------------------------------------------------
0034 #ifndef G4GDMLWRITEDEFINE_HH
0035 #define G4GDMLWRITEDEFINE_HH 1
0036 
0037 #include "G4Types.hh"
0038 #include "G4ThreeVector.hh"
0039 #include "G4RotationMatrix.hh"
0040 
0041 #include "G4GDMLWrite.hh"
0042 
0043 class G4GDMLWriteDefine : public G4GDMLWrite
0044 {
0045   public:
0046 
0047     G4ThreeVector GetAngles(const G4RotationMatrix&);
0048     void ScaleWrite(xercesc::DOMElement* element, const G4String& name,
0049                     const G4ThreeVector& scl)
0050     {
0051       Scale_vectorWrite(element, "scale", name, scl);
0052     }
0053     void RotationWrite(xercesc::DOMElement* element, const G4String& name,
0054                        const G4ThreeVector& rot)
0055     {
0056       Rotation_vectorWrite(element, "rotation", name, rot);
0057     }
0058     void PositionWrite(xercesc::DOMElement* element, const G4String& name,
0059                        const G4ThreeVector& pos)
0060     {
0061       Position_vectorWrite(element, "position", name, pos);
0062     }
0063     void FirstrotationWrite(xercesc::DOMElement* element, const G4String& name,
0064                             const G4ThreeVector& rot)
0065     {
0066       Rotation_vectorWrite(element, "firstrotation", name, rot);
0067     }
0068     void FirstpositionWrite(xercesc::DOMElement* element, const G4String& name,
0069                             const G4ThreeVector& pos)
0070     {
0071       Position_vectorWrite(element, "firstposition", name, pos);
0072     }
0073     void AddPosition(const G4String& name, const G4ThreeVector& pos)
0074     {
0075       Position_vectorWrite(defineElement, "position", name, pos);
0076     }
0077 
0078     virtual void DefineWrite(xercesc::DOMElement*);
0079 
0080   protected:
0081 
0082     G4GDMLWriteDefine();
0083     virtual ~G4GDMLWriteDefine();
0084 
0085     void Scale_vectorWrite(xercesc::DOMElement*, const G4String&,
0086                            const G4String&, const G4ThreeVector&);
0087     void Rotation_vectorWrite(xercesc::DOMElement*, const G4String&,
0088                               const G4String&, const G4ThreeVector&);
0089     void Position_vectorWrite(xercesc::DOMElement*, const G4String&,
0090                               const G4String&, const G4ThreeVector&);
0091 
0092   protected:
0093 
0094     static const G4double kRelativePrecision;
0095     static const G4double kAngularPrecision;
0096     static const G4double kLinearPrecision;
0097 
0098     xercesc::DOMElement* defineElement = nullptr;
0099 };
0100 
0101 #endif