Message: RE: Writing UIcommands with units, and G4BestUnit interface Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None RE: Writing UIcommands with units, and G4BestUnit interface 

Forum: (Graphical) User Interfaces
Re: None Writing UIcommands with units, and G4BestUnit interface (Michael H. Kelsey)
Date: 23 Dec, 2010
From: Makoto Asai <Makoto Asai>

http://www-geant4.kek.jp/lxr/source/intercoms/include/G4UIcommand.hh#L105


> -----Original Message-----
> From: Michael H. Kelsey [mailto:kelsey@slac.stanford.edu]
> Sent: Wednesday, December 22, 2010 10:11 PM
> To: userinterface-g4hn
> Subject: Writing UIcommands with units, and G4BestUnit interface
> 
> 
> *** Discussion title: (Graphical) User Interfaces
> 
> I'm trying to write a G4UIcommand subclass which can fill a
> std::vector<> with a variable number of doubles, and with a unit at the
> end. I've got things mostly set up (by doing lots of irritating copying
> from .cc files), including a function which checks whether the last
> token the user entered is a unit string or not.
> 
> Now I've run into a problem. I would like to implement the
> "ConvertToStringWithBestUnit" function. For this, I need to know the
> scale factor and the string for the unit, _by itself_.
> 
> The G4BestUnit functor takes a double and unit-class as input, and
> returns only a string containing the formatted double and unit name. Is
> there any way to get just the unit, without the number attached?
> 
> -- Michael Kelsey
> 
> -------------------------------------------------------------
> Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or
> unsubscribe) at:
> http://hypernews.slac.stanford.edu/HyperNews/geant4/get/userinterface/7
> 9.html

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Writing UIcommands with units, and G4BestUnit interface   (Mike Kelsey - 23 Dec, 2010)
(_ None: RE: Writing UIcommands with units, and G4BestUnit interface   (Asai, Makoto - 23 Dec, 2010)
(_ None: Re: Writing UIcommands with units, and G4BestUnit interface   (Mike Kelsey - 23 Dec, 2010)
 Add Message Add Message
to: "RE: Writing UIcommands with units, and G4BestUnit interface"

 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 ]