Added DbU::physicalToGrid method.

This commit is contained in:
Jean-Paul Chaput 2011-02-24 10:00:46 +00:00
parent 61328d9c4c
commit 562cca23c7
3 changed files with 6 additions and 12 deletions

View File

@ -77,6 +77,7 @@ namespace Hurricane {
static inline Unit db ( long value ); static inline Unit db ( long value );
static inline Unit grid ( double value ); static inline Unit grid ( double value );
static inline Unit lambda ( double value ); static inline Unit lambda ( double value );
static inline Unit physicalToDbu ( double value, UnitPower p );
// Precision & Resolution Managment. // Precision & Resolution Managment.
static unsigned int getPrecision (); static unsigned int getPrecision ();
static unsigned int getMaximalPrecision (); static unsigned int getMaximalPrecision ();
@ -135,6 +136,7 @@ namespace Hurricane {
inline DbU::Unit DbU::db ( long value ) { return value; } inline DbU::Unit DbU::db ( long value ) { return value; }
inline DbU::Unit DbU::grid ( double value ) { return (long)rint( value/_resolution ); } inline DbU::Unit DbU::grid ( double value ) { return (long)rint( value/_resolution ); }
inline DbU::Unit DbU::lambda ( double value ) { return grid(value*_gridsPerLambda); } inline DbU::Unit DbU::lambda ( double value ) { return grid(value*_gridsPerLambda); }
inline DbU::Unit DbU::physicalToDbu ( double value, UnitPower p ) { return (long)rint((value*getUnitPower(p))/_physicalsPerGrid); }
inline long DbU::getDb ( DbU::Unit u ) { return u; } inline long DbU::getDb ( DbU::Unit u ) { return u; }
inline double DbU::getGrid ( DbU::Unit u ) { return _resolution*(double)u; } inline double DbU::getGrid ( DbU::Unit u ) { return _resolution*(double)u; }
inline double DbU::getGrid ( double u ) { return _resolution*u; } inline double DbU::getGrid ( double u ) { return _resolution*u; }

View File

@ -9,17 +9,13 @@
// $Id$ // $Id$
// //
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
// | |
// | C O R I O L I S | // | C O R I O L I S |
// | V L S I B a c k e n d D a t a - B a s e | // | V L S I B a c k e n d D a t a - B a s e |
// | | // | |
// | Author : Jean-Paul CHAPUT | // | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Module : "./hurricane/viewer/Script.cpp" | // | C++ Module : "./hurricane/viewer/Script.cpp" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+

View File

@ -2,14 +2,13 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved // Copyright (c) UPMC/LIP6 2008-2011, All Rights Reserved
// //
// =================================================================== // ===================================================================
// //
// $Id$ // $Id$
// //
// x-----------------------------------------------------------------x // +-----------------------------------------------------------------+
// | |
// | H U R R I C A N E | // | H U R R I C A N E |
// | V L S I B a c k e n d D a t a - B a s e | // | V L S I B a c k e n d D a t a - B a s e |
// | | // | |
@ -17,10 +16,7 @@
// | E-mail : Jean-Paul.Chaput@lip6.fr | // | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Header : "./hurricane/viewer/Script.h" | // | C++ Header : "./hurricane/viewer/Script.h" |
// | *************************************************************** | // +-----------------------------------------------------------------+
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
# ifndef __ISOBAR_SCRIPT__ # ifndef __ISOBAR_SCRIPT__