#include <G4Colour.hh>
#include <G4VisAttributes.hh>
#endif //ALICE_VISUALIZE
-#include <globals.hh>
+#include <G4LogicalVolume.hh>
+//_____________________________________________________________________________
AliLVStructure::AliLVStructure(G4String path)
: fPathName(path),
fDirName(path),
}
}
+//_____________________________________________________________________________
AliLVStructure::AliLVStructure(const AliLVStructure& right)
{
- // copy vector of structures
- fStructures.clearAndDestroy();
- G4int i;
- for (i=0; i<right.fStructures.entries(); i++) {
- // new full structure tree has to be created
- AliLVStructure* rhsStructure = right.fStructures[i];
- fStructures.insert(new AliLVStructure(*rhsStructure));
- }
-
- // copy vector of logical volumes
- fLogicalVolumes.clear();
- for (i=0; i<right.fLogicalVolumes.entries(); i++) {
- G4LogicalVolume* rhsLV = right.fLogicalVolumes[i];
- fLogicalVolumes.insert(rhsLV);
- }
-
- fPathName = right.fPathName;
- fDirName = right.fPathName;
- fVerboseLevel = right.fVerboseLevel;
+ // copy stuff
+ *this = right;
}
+//_____________________________________________________________________________
AliLVStructure::AliLVStructure() {
//
}
+//_____________________________________________________________________________
AliLVStructure::~AliLVStructure() {
//
fStructures.clearAndDestroy();
// operators
+//_____________________________________________________________________________
AliLVStructure& AliLVStructure::operator=(const AliLVStructure &right)
{
// check assignement to self
return *this;
}
+//_____________________________________________________________________________
G4int AliLVStructure::operator==(const AliLVStructure &right) const
{
// check == to self
// private methods
+//_____________________________________________________________________________
AliLVStructure* AliLVStructure::FindSubDirectory(G4String subDir)
{
// Finds the subdirectory.
return 0;
}
+//_____________________________________________________________________________
G4String AliLVStructure::ExtractDirName(G4String name)
{
// Extracts the directory name from the path.
// public methods
+//_____________________________________________________________________________
void AliLVStructure::AddNewVolume(G4LogicalVolume* lv,
G4String treeStructure)
{
}
}
+//_____________________________________________________________________________
G4LogicalVolume* AliLVStructure::GetVolume(G4String lvName)
{
// Returns logical volume of lvName if present in the structure,
return 0;
}
+//_____________________________________________________________________________
G4LogicalVolume* AliLVStructure::FindVolume(G4String name)
{
// Finds logical volume of given name in all structure tree.
}
}
+//_____________________________________________________________________________
void AliLVStructure::ListTree() const
{
// Prints LV tree structure.
}
}
+//_____________________________________________________________________________
void AliLVStructure::ListTreeLong() const
{
// Prints LV tree structure with number of
}
}
+//_____________________________________________________________________________
void AliLVStructure::SetVerboseLevel(G4int verbose)
{
// Sets verbose level.
}
#ifdef ALICE_VISUALIZE
+//_____________________________________________________________________________
void AliLVStructure::SetTreeVisibility(G4bool visibility)
{
// Sets visibility to all logical volumes in the structure
for (G4int i=0; i<fLogicalVolumes.entries(); i++) {
G4LogicalVolume* lv = fLogicalVolumes(i);
- const G4VisAttributes* kpVisAttributes = lv->GetVisAttributes ();
- G4Colour colour = kpVisAttributes->GetColour();
+ const G4VisAttributes* kpVisAttributes = lv->GetVisAttributes();
+ G4VisAttributes* newVisAttributes;
+ if (kpVisAttributes) {
+ G4Colour colour = kpVisAttributes->GetColour();
+ newVisAttributes = new G4VisAttributes(colour);
+ }
+ else
+ newVisAttributes = new G4VisAttributes();
delete kpVisAttributes;
- G4VisAttributes* newVisAttributes = new G4VisAttributes(colour);
newVisAttributes->SetVisibility(visibility);
lv->SetVisAttributes(newVisAttributes);
}
}
+//_____________________________________________________________________________
void AliLVStructure::SetTreeColour(G4String colName)
{
// Sets colour specified by name to all logical volumes
G4LogicalVolume* lv = fLogicalVolumes(i);
const G4VisAttributes* kpVisAttributes = lv->GetVisAttributes ();
- G4bool oldVisibility = kpVisAttributes->IsVisible();
+ G4VisAttributes* newVisAttributes;
+ if (kpVisAttributes) {
+ G4bool oldVisibility = kpVisAttributes->IsVisible();
+ newVisAttributes = new G4VisAttributes(oldVisibility);
+ }
+ else
+ newVisAttributes = new G4VisAttributes();
delete kpVisAttributes;
- G4VisAttributes* newVisAttributes = new G4VisAttributes(oldVisibility);
-
AliColourStore* pColours = AliColourStore::Instance();
G4Colour colour = pColours->GetColour(colName);
newVisAttributes->SetColour(colour);