47 fSceneHandler (sceneHandler),
50 fNeedKernelVisit (
true)
53 std::ostringstream ost;
124 (
const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& fullPath)
127 std::ostringstream oss;
128 for (
const auto& pvNodeId: fullPath) {
130 <<
' ' << pvNodeId.GetPhysicalVolume()->GetName()
131 <<
' ' << pvNodeId.GetCopyNo();
137 (
const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& fullPath,
142 std::ostringstream oss;
143 oss <<
"/vis/touchable/set/visibility ";
144 if (visibiity) oss <<
"true";
else oss <<
"false";
155 fVP.AddVisAttributesModifier
171 (
const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& fullPath,
176 std::ostringstream oss;
177 oss <<
"/vis/touchable/set/colour "
190 fVP.AddVisAttributesModifier
215 int stepPoints = 500;
228 std::vector <G4ThreeVector> viewVect;
235 for (
int i = 0; i < stepPoints; i++) {
236 float t = (float)i / (
float)stepPoints;
242 G4cout <<
"FLY CR("<< i <<
"):" << cameraPosition <<
G4endl;
243 viewVect.push_back(
G4ThreeVector (cameraPosition.
x(), cameraPosition.
y(), cameraPosition.
z()));
355 #ifdef G4MULTITHREADED
357 void G4VViewer::DoneWithMasterThread () {
361 void G4VViewer::MovingToMasterThread () {
365 void G4VViewer::SwitchToVisSubThread () {
369 void G4VViewer::DoneWithVisSubThread () {
373 void G4VViewer::MovingToVisSubThread () {
377 void G4VViewer::SwitchToMasterThread () {
384 os <<
"View " << v.
fName <<
":\n";
407 float b1 = .5 * ( -t3 + 2*t2 -
t);
408 float b2 = .5 * ( 3*t3 - 5*t2 + 2);
409 float b3 = .5 * (-3*t3 + 4*t2 +
t);
410 float b4 = .5 * ( t3 -
t2 );
412 return (p1*b1 + p2*b2 + p3*b3 + p4*b4);
418 delta_t = (float)1 / (
float)vp.size();
435 int p = (
int)(t / delta_t);
437 #define BOUNDS(pp) { if (pp < 0) pp = 0; else if (pp >= (int)vp.size()-1) pp = vp.size() - 1; }
438 int p0 = p - 1;
BOUNDS(p0);
440 int p2 = p + 1;
BOUNDS(p2);
441 int p3 = p + 2;
BOUNDS(p3);
443 float lt = (t - delta_t*(float)p) / delta_t;
445 return CatmullRom_Eq(lt, vp[p0], vp[p1], vp[p2], vp[p3]);