49 fOptionString(
"none"),
50 fScene(
"room-and-chair"),
57 fWindowSillHeight(80*
cm),
58 fWindowOffset(-50*
cm),
62 fDoorFrameOffset(1.5*
m),
70 fChairThickness(3.*
cm)
84 if (fScene ==
"room-and-chair" )
93 void PerspectiveVisAction::RoomAndChair()
97 room_visAtts.SetForceWireframe(
true);
102 G4Box (
"window",fWindowX,fWindowY,fWindowZ);
104 (
G4Box(
"window-x",fWindowX,fWindowY,fWindowZ),
106 G4Translate3D(-fRoomX - fWindowX, fWindowOffset, fWindowY + fWindowSillHeight));
108 (
G4Box(
"window-y1",fWindowX,fWindowY,fWindowZ),
110 G4Translate3D(0., -fRoomY - fWindowX, fWindowY + fWindowSillHeight) *
113 (
G4Box(
"window-y2",fWindowX,fWindowY,fWindowZ),
115 G4Translate3D(0., fRoomY + fWindowX, fWindowY + fWindowSillHeight) *
120 (
G4Box(
"door-frame",fDoorFrameX,fDoorFrameY,fDoorFrameZ),
122 G4Translate3D(-fRoomX - fDoorFrameX, fDoorFrameOffset, fDoorFrameZ));
124 (
G4Box(
"door",fDoorX,fDoorY,fDoorZ),
139 Chair(chair_visAtts, chair_transform);
144 void PerspectiveVisAction::Chair
150 (
G4Box(
"chair-back",fChairX, fChairThickness, fChairZ - fChairSeat),
152 G4Translate3D(0.,-fChairY + fChairThickness, fChairZ + fChairSeat));
154 (
G4Box(
"chair-seat",fChairX, fChairY, fChairThickness),
155 visAtts, transform *
G4TranslateZ3D(-fChairThickness + 2.* fChairSeat));
156 for (
int i = -1; i < 2; i+=2) {
157 for (
int j = -1; j < 2; j+=2) {
159 (
G4Box(
"chair-leg",fChairThickness,
161 fChairSeat - fChairThickness),
164 j * (fChairY - fChairThickness),
165 fChairSeat - fChairThickness));
172 void PerspectiveVisAction::ExtendedDraw
183 G4bool any =
false, A =
false,
X =
false,
Y =
false,
Z =
false;
184 if (fOptionString.
contains(
"a")) {A =
true; any =
true;}
185 if (fOptionString.
contains(
"x")) {
X =
true; any =
true;}
186 if (fOptionString.
contains(
"y")) {
Y =
true; any =
true;}
187 if (fOptionString.
contains(
"z")) {
Z =
true; any =
true;}
191 G4bool isAuxEdgeVisible =
false;
201 notLastEdge = polyhedron->
GetNextEdge(v1, v2, edgeFlag);
202 if (isAuxEdgeVisible || edgeFlag > 0) {
206 v21a.transform(transform);
210 (
Z && abs(v21a.
z()) >
211 sqrt(v21a.
x()*v21a.
x()+v21a.
y()*v21a.
y())) ||
212 (
X && abs(v21a.
x()) >
213 sqrt(v21a.
y()*v21a.
y()+v21a.
z()*v21a.
z())) ||
214 (
Y && abs(v21a.
y()) >
215 sqrt(v21a.
x()*v21a.
x()+v21a.
x()*v21a.
z()))) {
218 edge.push_back(v1 - extender * v21.
unit());
219 edge.push_back(v2 + extender * v21.
unit());
220 fpVisManager->Draw(edge, transform);
223 }
while (notLastEdge);
224 }
while (notLastFace);
228 fpVisManager->
Draw(solid, visAtts, transform);
virtual G4Polyhedron * GetPolyhedron() const
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
static G4VVisManager * GetConcreteInstance()
G4bool GetNextEdge(G4Point3D &p1, G4Point3D &p2, G4int &edgeFlag) const
BasicVector3D< T > unit() const
Definition of the PerspectiveVisActionMessenger class.
G4bool GetNextFacet(G4int &n, G4Point3D *nodes, G4int *edgeFlags=0, G4Normal3D *normals=0) const
void SetVisAttributes(const G4VisAttributes *)
G4bool contains(const std::string &) const
Definition of the PerspectiveVisAction class.