63 std::ostringstream oss;
64 oss << x/uv <<
" " << y/uv <<
" " << unitName;
75 std::istringstream is(paramString);
95 (
"Accepts (a) RGB triplet. e.g., \".3 .4 .5\", or"
96 "\n (b) string such as \"white\", \"black\", \"grey\", \"red\"...or"
97 "\n (c) an additional number for opacity, e.g., \".3 .4 .5 .6\""
98 "\n or \"grey ! ! .6\" (note \"!\"'s for unused parameters).");
119 const size_t iPos0 = 0;
120 if (std::isalpha(redOrString[iPos0])) {
126 G4cout <<
"WARNING: Colour \"" << redOrString
127 <<
"\" not found. Defaulting to " << colour
140 std::istringstream iss(redOrString);
145 G4cout <<
"WARNING: String \"" << redOrString
146 <<
"\" cannot be parsed. Defaulting to " << colour
151 colour =
G4Colour(red,green,blue,opacity);
172 <<
"\n Unit \"" << unit <<
"\" not defined"
179 <<
"\n Unit \"" << unit <<
"\" not a unit of " << category;
180 if (category ==
"Volumic Mass")
G4cerr <<
" (density)";
196 G4cout <<
"WARNING: Scene pointer is null."
203 if (!pSceneHandler) {
205 G4cout <<
"WARNING: Scene handler not found." <<
G4endl;
214 if (pScene == pSceneHandler->
GetScene()) {
228 "ERROR: No current viewer - \"/vis/viewer/list\" to see possibilities."
242 "WARNING: For some reason, possibly mentioned above, it has not been"
243 "\n possible to add to the scene."
258 if (sceneHandler && sceneHandler->
GetScene()) {
264 G4cout <<
"Issue /vis/viewer/refresh or flush to see effect."
273 std::vector<G4ViewParameters> viewVector,
274 const G4int nInterpolationPoints,
275 const G4int waitTimePerPointmilliseconds,
278 const G4int safety = viewVector.size()*nInterpolationPoints;
279 G4int safetyCount = 0;
286 if (exportString ==
"export" &&
292 if (waitTimePerPointmilliseconds > 0)
293 std::this_thread::sleep_for(std::chrono::milliseconds(waitTimePerPointmilliseconds));
294 }
while (safetyCount++ < safety);
301 const G4int nInterpolationPoints,
302 const G4int waitTimePerPointmilliseconds,
305 std::vector<G4ViewParameters> viewVector;
306 viewVector.push_back(oldVP);
307 viewVector.push_back(oldVP);
308 viewVector.push_back(newVP);
309 viewVector.push_back(newVP);
314 nInterpolationPoints,
315 waitTimePerPointmilliseconds,
322 if (fromCmd && toCmd) {
324 for (
G4int i = startLine; i < nGuideEntries; ++i) {
334 if (fromCmd && toCmd) {
336 for (
G4int i = 0; i < nParEntries; ++i) {
349 if (halfX > 0. && halfY > 0. && halfZ > 0.) {
350 const G4Box box(
"vis_extent",halfX,halfY,halfZ);
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
static G4bool GetColour(const G4String &key, G4Colour &result)
G4bool contains(const std::string &) const
std::size_t GetParameterEntries() const
const G4String & GetGuidanceLine(G4int i) const
G4UIparameter * GetParameter(G4int i) const
static G4double ValueOf(const char *unitName)
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
std::size_t GetGuidanceEntries() const
G4int ApplyCommand(const char *aCommand)
static G4UImanager * GetUIpointer()
static G4bool IsUnitDefined(const G4String &)
static G4double GetValueOf(const G4String &)
static G4String GetCategory(const G4String &)
G4Scene * GetScene() const
const G4String & GetName() const
const G4ViewParameters & GetViewParameters() const
void SetViewParameters(const G4ViewParameters &vp)
G4VSceneHandler * GetSceneHandler() const
static G4double fCurrentTextSize
void G4VisCommandsSceneAddUnsuccessful(G4VisManager::Verbosity verbosity)
static G4Colour fCurrentTextColour
void CheckSceneAndNotifyHandlers(G4Scene *=nullptr)
static std::vector< G4PhysicalVolumesSearchScene::Findings > fCurrrentPVFindingsForField
void ConvertToColour(G4Colour &colour, const G4String &redOrString, G4double green, G4double blue, G4double opacity)
static G4VisManager * fpVisManager
static G4VisExtent fCurrentExtentForField
void DrawExtent(const G4VisExtent &)
void InterpolateToNewView(G4VViewer *currentViewer, const G4ViewParameters &oldVP, const G4ViewParameters &newVP, const G4int nInterpolationPoints=50, const G4int waitTimePerPointmilliseconds=20, const G4String exportString="")
static G4bool ConvertToDoublePair(const G4String ¶mString, G4double &xval, G4double &yval)
void RefreshIfRequired(G4VViewer *viewer)
void SetViewParameters(G4VViewer *viewer, const G4ViewParameters &viewParams)
const G4String & ConvertToColourGuidance()
void CopyParametersFrom(const G4UIcommand *fromCmd, G4UIcommand *toCmd)
static G4int fCurrentArrow3DLineSegmentsPerCircle
static G4PhysicalVolumeModel::TouchableProperties fCurrentTouchableProperties
G4bool ProvideValueOfUnit(const G4String &where, const G4String &unit, const G4String &category, G4double &value)
static G4Text::Layout fCurrentTextLayout
static G4double fCurrentLineWidth
static G4String ConvertToString(G4double x, G4double y, const char *unitName)
static G4Colour fCurrentColour
void CopyGuidanceFrom(const G4UIcommand *fromCmd, G4UIcommand *toCmd, G4int startLine=0)
void InterpolateViews(G4VViewer *currentViewer, std::vector< G4ViewParameters > viewVector, const G4int nInterpolationPoints=50, const G4int waitTimePerPointmilliseconds=20, const G4String exportString="")
static G4ViewParameters * CatmullRomCubicSplineInterpolation(const std::vector< G4ViewParameters > &views, G4int nInterpolationPoints=50)
G4bool IsAutoRefresh() const
const G4Point3D & GetExtentCenter() const
void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())
static Verbosity GetVerbosity()