47fSceneHandler (sceneHandler),
50fNeedKernelVisit (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";
171(
const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& fullPath,
176 std::ostringstream oss;
177 oss <<
"/vis/touchable/set/colour "
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
357void G4VViewer::DoneWithMasterThread () {
361void G4VViewer::MovingToMasterThread () {
365void G4VViewer::SwitchToVisSubThread () {
369void G4VViewer::DoneWithVisSubThread () {
373void G4VViewer::MovingToVisSubThread () {
377void 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]);
std::ostream & operator<<(std::ostream &os, const G4VViewer &v)
HepGeom::Vector3D< G4double > G4Vector3D
G4GLOB_DLL std::ostream G4cout
G4double GetAlpha() const
G4double GetGreen() const
static G4ModelingParameters::PVNameCopyNoPath GetPVNameCopyNoPath(const std::vector< G4PhysicalVolumeNodeID > &)
G4String strip(G4int strip_Type=trailing, char c=' ')
G4int ApplyCommand(const char *aCommand)
static G4UImanager * GetUIpointer()
virtual void ProcessScene()
const G4String & GetName() const
void RemoveViewerFromList(G4VViewer *pView)
virtual void ClearStore()
G4Vector3D GetInterpolatedSplinePoint(float t)
G4Vector3D CatmullRom_Eq(float t, const G4Vector3D &p1, const G4Vector3D &p2, const G4Vector3D &p3, const G4Vector3D &p4)
void AddSplinePoint(const G4Vector3D &v)
void SetTouchable(const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath)
void SetName(const G4String &)
G4VSceneHandler & fSceneHandler
std::vector< G4ThreeVector > ComputeFlyThrough(G4Vector3D *)
G4ViewParameters fDefaultVP
void TouchableSetVisibility(const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, G4bool visibility)
virtual void FinishView()
G4VViewer(G4VSceneHandler &, G4int id, const G4String &name="")
void SetViewParameters(const G4ViewParameters &vp)
void TouchableSetColour(const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, const G4Colour &)
void AddVisAttributesModifier(const G4ModelingParameters::VisAttributesModifier &)
void SetColour(const G4Colour &)
void SetVisibility(G4bool=true)
const G4ViewParameters & GetDefaultViewParameters() const
static G4VisManager * GetInstance()