Message: Range checking with UIcommand parameters -- expressions? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Range checking with UIcommand parameters -- expressions? 

Forum: (Graphical) User Interfaces
Date: 13 Jan, 2011
From: Michael H. Kelsey <Michael H. Kelsey>

The documentation for G4UIcommand::SetRange() is a bit sparse (Application Developers' Book, sec. 7.2.2):

'Define a range of the parameter(s). Use C++ notation, e.g., "x > 0 && x < 10", with variable name(s) defined by the SetParameterName() method. For the case of a G4ThreeVector, you can set the relation between parameters, e.g., "x > y".'

Where could I find a list of what expressions are or are not allowed?

In particular, I was hoping to apply a computational limit on a parameter, to restrict my geometry to even-sided polygons only:

  SidePanelsCmd->SetRange("N>3 && N%2==0");

That is normal "C++ notation," but fails at runtime because "%" is not allowed. I can impose the limit in the SetSidePanels() function itself, which is what the Messenger will call, but it seems more appropriate to use the range-checking.

  -- Michael Kelsey

 Add Message Add Message
to: "Range checking with UIcommand parameters -- expressions?"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]