46 fOptionString(
"none"),
47 fScene(
"room-and-chair"),
54 fWindowSillHeight(80*
cm),
55 fWindowOffset(-50*
cm),
59 fDoorFrameOffset(1.5*
m),
67 fChairThickness(3.*
cm)
79 if (fScene ==
"room-and-chair" )
86 void PerspectiveVisAction::RoomAndChair()
90 room_visAtts.SetForceWireframe(
true);
95 G4Box (
"window",fWindowX,fWindowY,fWindowZ);
97 (
G4Box(
"window-x",fWindowX,fWindowY,fWindowZ),
99 G4Translate3D(-fRoomX - fWindowX, fWindowOffset, fWindowY + fWindowSillHeight));
101 (
G4Box(
"window-y1",fWindowX,fWindowY,fWindowZ),
103 G4Translate3D(0., -fRoomY - fWindowX, fWindowY + fWindowSillHeight) *
106 (
G4Box(
"window-y2",fWindowX,fWindowY,fWindowZ),
108 G4Translate3D(0., fRoomY + fWindowX, fWindowY + fWindowSillHeight) *
113 (
G4Box(
"door-frame",fDoorFrameX,fDoorFrameY,fDoorFrameZ),
115 G4Translate3D(-fRoomX - fDoorFrameX, fDoorFrameOffset, fDoorFrameZ));
117 (
G4Box(
"door",fDoorX,fDoorY,fDoorZ),
132 Chair(chair_visAtts, chair_transform);
135 void PerspectiveVisAction::Chair
141 (
G4Box(
"chair-back",fChairX, fChairThickness, fChairZ - fChairSeat),
143 G4Translate3D(0.,-fChairY + fChairThickness, fChairZ + fChairSeat));
145 (
G4Box(
"chair-seat",fChairX, fChairY, fChairThickness),
146 visAtts, transform *
G4TranslateZ3D(-fChairThickness + 2.* fChairSeat));
147 for (
int i = -1; i < 2; i+=2) {
148 for (
int j = -1; j < 2; j+=2) {
150 (
G4Box(
"chair-leg",fChairThickness,
152 fChairSeat - fChairThickness),
155 j * (fChairY - fChairThickness),
156 fChairSeat - fChairThickness));
161 void PerspectiveVisAction::ExtendedDraw
172 G4bool any =
false, A =
false,
X =
false,
Y =
false,
Z =
false;
173 if (fOptionString.
contains(
"a")) {A =
true; any =
true;}
174 if (fOptionString.
contains(
"x")) {
X =
true; any =
true;}
175 if (fOptionString.
contains(
"y")) {
Y =
true; any =
true;}
176 if (fOptionString.
contains(
"z")) {
Z =
true; any =
true;}
180 G4bool isAuxEdgeVisible =
false;
190 notLastEdge = polyhedron->
GetNextEdge(v1, v2, edgeFlag);
191 if (isAuxEdgeVisible || edgeFlag > 0) {
195 v21a.transform(transform);
199 (
Z && abs(v21a.
z()) >
200 sqrt(v21a.
x()*v21a.
x()+v21a.
y()*v21a.
y())) ||
201 (
X && abs(v21a.
x()) >
202 sqrt(v21a.
y()*v21a.
y()+v21a.
z()*v21a.
z())) ||
203 (
Y && abs(v21a.
y()) >
204 sqrt(v21a.
x()*v21a.
x()+v21a.
x()*v21a.
z()))) {
207 edge.push_back(v1 - extender * v21.
unit());
208 edge.push_back(v2 + extender * v21.
unit());
209 fpVisManager->Draw(edge, transform);
212 }
while (notLastEdge);
213 }
while (notLastFace);
217 fpVisManager->
Draw(solid, visAtts, transform);