ndm
0.2.8
|
Axis object in n-dimensional space. More...
#include <Axis.hh>
Public Types | |
enum | EMode { kAligned = 0 , kFixed = 1 } |
Mode for axis. | |
Public Member Functions | |
Axis (double min=0.0, double max=1.0, EMode mode=kAligned, double delta=1) | |
virtual | ~Axis () |
void | print () const |
Prints axis info. More... | |
void | find (double v, double &min, double &max, std::string &path, int levelrequest=-1, int levelmax=100) |
Find bin and print info for given value. More... | |
void | expand (char direction='>', int power=1) |
Expand range. More... | |
void | shrink (char direction='>', int power=1) |
Shrink range. More... | |
void | min (double m) |
Sets user defined minimum. | |
void | max (double m) |
Sets user defined maximum. | |
void | is_bin (bool b) |
Sets user defined maximum. | |
void | minmax (double min, double max) |
Sets user defined minimum and maximum. More... | |
void | level (unsigned int l) |
Sets level. | |
double | min () const |
Returns user defined minimum. | |
double | max () const |
Returns user defined maximum. | |
bool | is_bin () const |
Returns user defined maximum. | |
double | maxb () const |
Returns internal maximum. | |
double | maxb_user () const |
Returns internal maximum2. | |
void | info (std::string i) |
Sets info string. | |
std::string | info () const |
Returns info string. | |
double | to_user (double v) const |
Convert interal to user format. | |
double | to_internal (double v) const |
Convert user to internal format. | |
unsigned int | level () const |
Returns level. | |
void | split (std::vector< double > &mins, int level) |
Private Member Functions | |
int | decimels_right (double num, double mult=10, double min=0.01, double max=0.99) |
int | decimels_left (double num, double mult=10, double min=0.01) |
void | find (double &v, int &levelrequest, int &levelmax, int ¤tlevel, double &min, double &max, std::string &path) |
void | modify_range (char direction='>', int power=1) |
void | recalculate_range () |
Private Attributes | |
double | mMin {0.0} |
User defined minimum. | |
double | mMax {1.0} |
User defined maximum. | |
bool | mIsBin {false} |
Min max is in bin/user format. | |
EMode | mMode {kAligned} |
Axis mode. | |
double | mMaxB {1} |
Internal maximum. | |
double | mShift {0} |
Shift to the internal min/max parameters. | |
double | mMultiply {1} |
Multiply to the internal min/max parameters. | |
unsigned int | mLevel {0} |
Level of division. | |
double | mMinDelta {1} |
Minimal delta of axis range. | |
std::string | mInfo {} |
Some additional info for axis. | |
NDM::Axis::Axis | ( | double | min = 0.0 , |
double | max = 1.0 , |
||
EMode | mode = kAligned , |
||
double | delta = 1 |
||
) |
|
private |
Calculate number of decimels on left side of dot
Definition at line 245 of file Axis.cc.
References min().
Referenced by recalculate_range().
|
private |
Calculate number of decimels on rigth side of dot
Definition at line 225 of file Axis.cc.
Referenced by recalculate_range().
void NDM::Axis::expand | ( | char | direction = '>' , |
int | power = 1 |
||
) |
Expand range.
Expand range by 2^power to left '<' or right '>' direction
Definition at line 156 of file Axis.cc.
References modify_range().
|
private |
void NDM::Axis::find | ( | double | v, |
double & | min, | ||
double & | max, | ||
std::string & | path, | ||
int | levelrequest = -1 , |
||
int | levelmax = 100 |
||
) |
void NDM::Axis::minmax | ( | double | min, |
double | max | ||
) |
|
private |
void NDM::Axis::print | ( | ) | const |
|
private |
Recalculate range correctly
Definition at line 33 of file Axis.cc.
References decimels_left(), decimels_right(), maxb_user(), mMax, mMaxB, mMin, mMode, mMultiply, and mShift.
Referenced by Axis(), and modify_range().
void NDM::Axis::shrink | ( | char | direction = '>' , |
int | power = 1 |
||
) |
Shrink range.
Shrink range by 2^power to left '<' or right '>' direction
Definition at line 164 of file Axis.cc.
References modify_range().
void NDM::Axis::split | ( | std::vector< double > & | mins, |
int | level | ||
) |
Returns list of minimums for specific level
Definition at line 266 of file Axis.cc.
References level(), mMax, mMaxB, to_internal(), and to_user().
Referenced by NDM::Space::points().