/*////////////////////////////////////////////////////////////////////////////// // CMT Cosmic Muon Tomography project ////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova All rights reserved Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > ------------------------------------------------------------------ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. //////////////////////////////////////////////////////////////////////////////*/ #ifndef SOLID_H #define SOLID_H #include "Core/Object.h" #include "Geant/Matter.h" #include #include "Math/ContainerBox.h" #include "Math/Dense.h" #include "Math/TriangleMesh.h" class G4Material; class G4LogicalVolume; class G4TessellatedSolid; class G4Box; namespace uLib { namespace Geant { class Solid : public Object { public: Solid(); Solid(const char *name); void SetNistMaterial(const char *name); void SetMaterial(G4Material *material); void SetSizeUnit(const char *unit); // Implementiamo SetParent qui, per tutti. virtual void SetParent(Solid *parent); // Setters per la posizione (necessari per il piazzamento) void SetTransform(Matrix4f transform); uLibGetMacro(Material, G4Material *) uLibGetSetMacro(Logical, G4LogicalVolume *) uLibGetSetMacro(Physical, G4VPhysicalVolume *) inline const char *GetName() const { return m_Logical ? m_Logical->GetName().c_str() : m_Name.c_str(); } protected: std::string m_Name; G4Material *m_Material; G4LogicalVolume *m_Logical; G4VPhysicalVolume *m_Physical; // <-- Memorizza l'oggetto posizionato G4ThreeVector *m_Position; // <-- Offset rispetto al centro del padre G4RotationMatrix* m_Rotation; // <-- Rotazione rispetto al padre }; class TessellatedSolid : public Solid { typedef Solid BaseClass; public: TessellatedSolid(const char *name); void SetMesh(TriangleMesh &mesh); uLibGetMacro(Solid, G4TessellatedSolid *) public slots: void Update(); private : G4TessellatedSolid *m_Solid; }; class BoxSolid : public Solid { typedef Solid BaseClass; public: BoxSolid(const char *name, ContainerBox *box); public slots: void Update(); private: ContainerBox *m_Object; G4Box *m_Solid; }; } // namespace Geant } // namespace uLib #endif // SOLID_H