MCPcopy Create free account
hub / github.com/Geant4/geant4 / AddGeometryOverlay

Method AddGeometryOverlay

source/visualization/Vtk/src/G4VtkViewer.cc:735–763  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

733}
734
735void G4VtkViewer::AddGeometryOverlay(const G4String& fileName, const G4double colour[3],
736 const G4double alpha, const G4String& representation,
737 const G4double scale[3], const G4double rotation[3],
738 const G4double translation[3])
739{
740 auto transformation = G4Transform3D::Identity;
741 auto scal = G4Scale3D(scale[0], scale[1], scale[2]);
742 auto rotx = G4RotateX3D(rotation[0]);
743 auto roty = G4RotateY3D(rotation[1]);
744 auto rotz = G4RotateZ3D(rotation[2]);
745 auto tran = G4Translate3D(translation[0], translation[1], translation[2]);
746
747 transformation = tran * rotz * roty * rotx * scal * transformation;
748
749 auto& fVtkSceneHandler = dynamic_cast<G4VtkSceneHandler&>(fSceneHandler);
750 G4VtkStore& st = fVtkSceneHandler.GetTransientStore();
751
752
753 G4VtkVisContext vc = G4VtkVisContext(this, nullptr, false, transformation);
754 if (representation == "w")
755 vc.fDrawingStyle = G4ViewParameters::wireframe;
756 else if (representation == "s")
757 vc.fDrawingStyle = G4ViewParameters::hlhsr;
758 vc.alpha = alpha;
759 vc.red = colour[0];
760 vc.green = colour[1];
761 vc.blue = colour[2];
762 st.AddNonG4ObjectPolydata(fileName, vc);
763}
764
765void G4VtkViewer::Print()
766{

Callers 1

SetNewValueMethod · 0.80

Calls 2

G4VtkVisContextClass · 0.50

Tested by

no test coverage detected