48fSceneHandler (sceneHandler),
51fNeedKernelVisit (true)
54 std::ostringstream ost;
125(
const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& fullPath)
128 std::ostringstream oss;
130 for (
const auto& pvNodeId: fullPath) {
131 const auto& pv = pvNodeId.GetPhysicalVolume();
132 auto iterator = find(pvStore->begin(),pvStore->end(),pv);
133 if (iterator == pvStore->end()) {
135 ed <<
"Volume no longer in physical volume store.";
139 <<
' ' << pvNodeId.GetPhysicalVolume()->GetName()
140 <<
' ' << pvNodeId.GetCopyNo();
147(
const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& fullPath,
152 std::ostringstream oss;
153 oss <<
"/vis/touchable/set/visibility ";
154 if (visibiity) oss <<
"true";
else oss <<
"false";
181(
const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>& fullPath,
186 std::ostringstream oss;
187 oss <<
"/vis/touchable/set/colour "
225 int stepPoints = 500;
238 std::vector <G4ThreeVector> viewVect;
245 for (
int i = 0; i < stepPoints; i++) {
246 float t = (float)i / (
float)stepPoints;
252 G4cout <<
"FLY CR("<< i <<
"):" << cameraPosition <<
G4endl;
253 viewVect.push_back(
G4ThreeVector (cameraPosition.
x(), cameraPosition.
y(), cameraPosition.
z()));
365#ifdef G4MULTITHREADED
367void G4VViewer::DoneWithMasterThread () {
371void G4VViewer::MovingToMasterThread () {
375void G4VViewer::SwitchToVisSubThread () {
379void G4VViewer::DoneWithVisSubThread () {
383void G4VViewer::MovingToVisSubThread () {
387void G4VViewer::SwitchToMasterThread () {
394 os <<
"View " << v.
fName <<
":\n";
417 float b1 = .5 * ( -t3 + 2*t2 - t);
418 float b2 = .5 * ( 3*t3 - 5*t2 + 2);
419 float b3 = .5 * (-3*t3 + 4*t2 + t);
420 float b4 = .5 * ( t3 - t2 );
422 return (p1*b1 + p2*b2 + p3*b3 + p4*b4);
428 delta_t = (float)1 / (
float)vp.size();
445 int p = (int)(t / delta_t);
447#define BOUNDS(pp) { if (pp < 0) pp = 0; else if (pp >= (int)vp.size()-1) pp = vp.size() - 1; }
448 int p0 = p - 1;
BOUNDS(p0);
450 int p2 = p + 1;
BOUNDS(p2);
451 int p3 = p + 2;
BOUNDS(p3);
453 float lt = (t - delta_t*(float)p) / delta_t;
455 return CatmullRom_Eq(lt, vp[p0], vp[p1], vp[p2], vp[p3]);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
HepGeom::Vector3D< G4double > G4Vector3D
G4GLOB_DLL std::ostream G4cout
G4double GetAlpha() const
G4double GetGreen() const
static G4ModelingParameters::PVNameCopyNoPath GetPVNameCopyNoPath(const std::vector< G4PhysicalVolumeNodeID > &)
static G4PhysicalVolumeStore * GetInstance()
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()
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
const char * name(G4int ptype)
void strip(G4String &str, char c=' ')
Remove leading and trailing characters from string.