48 fSceneHandler (sceneHandler),
51 fNeedKernelVisit (true)
54 std::ostringstream ost;
125 (
const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& fullPath)
128 std::ostringstream oss;
129 for (
const auto& pvNodeId: fullPath) {
131 <<
' ' << pvNodeId.GetPhysicalVolume()->GetName()
132 <<
' ' << pvNodeId.GetCopyNo();
138 (
const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& fullPath,
143 std::ostringstream oss;
144 oss <<
"/vis/touchable/set/visibility ";
145 if (visibiity) oss <<
"true";
else oss <<
"false";
156 fVP.AddVisAttributesModifier
172 (
const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& fullPath,
177 std::ostringstream oss;
178 oss <<
"/vis/touchable/set/colour "
191 fVP.AddVisAttributesModifier
216 int stepPoints = 500;
229 std::vector <G4ThreeVector> viewVect;
236 for (
int i = 0; i < stepPoints; i++) {
237 float t = (float)i / (
float)stepPoints;
243 G4cout <<
"FLY CR("<< i <<
"):" << cameraPosition <<
G4endl;
244 viewVect.push_back(
G4ThreeVector (cameraPosition.x(), cameraPosition.y(), cameraPosition.z()));
356 #ifdef G4MULTITHREADED
358 void G4VViewer::DoneWithMasterThread () {
362 void G4VViewer::MovingToMasterThread () {
366 void G4VViewer::SwitchToVisSubThread () {
370 void G4VViewer::DoneWithVisSubThread () {
374 void G4VViewer::MovingToVisSubThread () {
378 void G4VViewer::SwitchToMasterThread () {
385 os <<
"View " << v.
fName <<
":\n";
408 float b1 = .5 * ( -t3 + 2*t2 - t);
409 float b2 = .5 * ( 3*t3 - 5*t2 + 2);
410 float b3 = .5 * (-3*t3 + 4*t2 + t);
411 float b4 = .5 * ( t3 - t2 );
413 return (p1*b1 + p2*b2 + p3*b3 + p4*b4);
419 delta_t = (float)1 / (
float)vp.size();
436 int p = (int)(t / delta_t);
438 #define BOUNDS(pp) { if (pp < 0) pp = 0; else if (pp >= (int)vp.size()-1) pp = vp.size() - 1; }
439 int p0 = p - 1;
BOUNDS(p0);
441 int p2 = p + 1;
BOUNDS(p2);
442 int p3 = p + 2;
BOUNDS(p3);
444 float lt = (t - delta_t*(float)p) / delta_t;
446 return CatmullRom_Eq(lt, vp[p0], vp[p1], vp[p2], vp[p3]);
void SetName(const G4String &)
virtual void ClearStore()
void SetColour(const G4Colour &)
G4double GetAlpha() const
CLHEP::Hep3Vector G4ThreeVector
std::vector< ExP01TrackerHit * > a
G4String strip(G4int strip_Type=trailing, char c=' ')
void RemoveViewerFromList(G4VViewer *pView)
const G4String & GetName() const
void SetViewParameters(const G4ViewParameters &vp)
HepGeom::Vector3D< G4double > G4Vector3D
const char * name(G4int ptype)
void TouchableSetVisibility(const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, G4bool visibility)
G4ViewParameters fDefaultVP
G4VViewer(G4VSceneHandler &, G4int id, const G4String &name="")
std::ostream & operator<<(std::ostream &os, const G4VViewer &v)
static G4UImanager * GetUIpointer()
void TouchableSetColour(const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, const G4Colour &)
const G4ViewParameters & GetDefaultViewParameters() const
G4GLOB_DLL std::ostream G4cout
void SetVisibility(G4bool=true)
G4double GetGreen() const
static G4VisManager * GetInstance()
void SetTouchable(const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath)
G4Vector3D GetInterpolatedSplinePoint(float t)
virtual void ProcessScene()
G4Vector3D CatmullRom_Eq(float t, const G4Vector3D &p1, const G4Vector3D &p2, const G4Vector3D &p3, const G4Vector3D &p4)
std::vector< G4ThreeVector > ComputeFlyThrough(G4Vector3D *)
G4VSceneHandler & fSceneHandler
G4int ApplyCommand(const char *aCommand)
void AddSplinePoint(const G4Vector3D &v)
virtual void FinishView()