BLGroupElement.hh
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef BLGROUPELEMENT_HH
00020 #define BLGROUPELEMENT_HH
00021
00022 #include <vector>
00023 #include <map>
00024 #include "G4RotationMatrix.hh"
00025 #include "G4VPhysicalVolume.hh"
00026 #include "BLElement.hh"
00027
00028 const G4String NO_RENAME("\x01");
00029
00030
00031
00032
00033
00034 class BLGroupElement : public BLElement {
00035 struct Child { G4RotationMatrix rot; G4ThreeVector offset;
00036 BLElement *element; G4String rename; };
00037 std::vector<Child> child;
00038 static std::map<G4String,BLGroupElement*> mapGroupElement;
00039 BLGroupElement& operator=(const BLGroupElement&);
00040
00041 friend class BLGroup;
00042 public:
00043
00044 BLGroupElement() : BLElement(), child() { }
00045
00046
00047 BLGroupElement(const BLGroupElement& r) : BLElement(r), child(r.child) { }
00048
00049
00050 ~BLGroupElement() { }
00051
00052
00053
00054 void setName(G4String _name);
00055
00056
00057 int getNChildren() { return child.size(); }
00058
00059
00060
00061
00062 virtual void constructChildren(G4LogicalVolume *parent,
00063 G4String parentName,
00064 G4RotationMatrix *parentRotation,
00065 G4ThreeVector parentPosition);
00066
00067
00068
00069
00070 virtual void placeChild(BLElement* element, G4RotationMatrix *rot,
00071 G4ThreeVector& offset, G4String rename);
00072
00073
00074
00075
00076
00077
00078 int testGeometry(int npoints, G4double tolerance, bool visual=false,
00079 G4RotationMatrix rotation=G4RotationMatrix(),
00080 G4ThreeVector offset=G4ThreeVector());
00081
00082
00083 virtual G4bool isGroupElement() { return true; }
00084
00085
00086
00087
00088 virtual G4bool isWithin(G4ThreeVector &local, G4double tolerance) = 0;
00089
00090
00091 static BLGroupElement *find(G4String name);
00092 };
00093
00094 #endif // BLGROUPELEMENT_HH