add geant4 scene and gcompose app
This commit is contained in:
@@ -23,39 +23,51 @@
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
|
||||
|
||||
#ifndef SOLID_H
|
||||
#define SOLID_H
|
||||
|
||||
#include "Core/Object.h"
|
||||
#include "Geant/Matter.h"
|
||||
#include <Geant4/G4LogicalVolume.hh>
|
||||
#include "Math/ContainerBox.h"
|
||||
#include "Math/Dense.h"
|
||||
#include "Math/TriangleMesh.h"
|
||||
#include "Detectors/Matter.h"
|
||||
|
||||
class G4Material;
|
||||
class G4LogicalVolume;
|
||||
class G4TessellatedSolid;
|
||||
|
||||
class G4Box;
|
||||
|
||||
namespace uLib {
|
||||
|
||||
class Solid : public Object {
|
||||
public:
|
||||
Solid();
|
||||
Solid(const char *name);
|
||||
|
||||
Solid();
|
||||
Solid(const char *name);
|
||||
void SetNistMaterial(const char *name);
|
||||
void SetMaterial(G4Material *material);
|
||||
|
||||
void SetNistMaterial(const char *name);
|
||||
// Implementiamo SetParent qui, per tutti.
|
||||
virtual void SetParent(Solid *parent);
|
||||
|
||||
void SetMaterial(G4Material *material);
|
||||
// Setters per la posizione (necessari per il piazzamento)
|
||||
void SetTransform(Matrix4f transform);
|
||||
|
||||
uLibGetMacro(Material,G4Material *)
|
||||
uLibGetMacro(Logical,G4LogicalVolume *)
|
||||
uLibGetMacro(Material, G4Material *)
|
||||
uLibGetSetMacro(Logical, G4LogicalVolume *)
|
||||
uLibGetSetMacro(Physical, G4VPhysicalVolume *)
|
||||
|
||||
protected:
|
||||
G4Material *m_Material;
|
||||
G4LogicalVolume *m_Logical;
|
||||
inline const char *GetName() const { return m_Logical->GetName().c_str(); }
|
||||
|
||||
protected:
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
|
||||
@@ -63,24 +75,38 @@ protected:
|
||||
|
||||
|
||||
class TessellatedSolid : public Solid {
|
||||
typedef Solid BaseClass;
|
||||
|
||||
typedef Solid BaseClass;
|
||||
public:
|
||||
TessellatedSolid(const char *name);
|
||||
TessellatedSolid(const char *name);
|
||||
void SetMesh(TriangleMesh &mesh);
|
||||
uLibGetMacro(Solid, G4TessellatedSolid *)
|
||||
|
||||
void SetMesh(TriangleMesh &mesh);
|
||||
public slots:
|
||||
void Update();
|
||||
|
||||
uLibGetMacro(Solid,G4TessellatedSolid *)
|
||||
private:
|
||||
G4TessellatedSolid *m_Solid;
|
||||
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 uLib
|
||||
|
||||
#endif // SOLID_H
|
||||
|
||||
Reference in New Issue
Block a user