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

None Writing UIcommands with units, and G4BestUnit interface 

Forum: (Graphical) User Interfaces
Date: 22 Dec, 2010
From: Michael H. Kelsey <Michael H. Kelsey>

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

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   (Asai, Makoto - 23 Dec, 2010)
(_ 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: "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 ]