ParaView
Public Types | Public Member Functions | Related Functions
pqChartValue Class Reference

The pqChartValue class is used to store a number that can be one of three types: int, float, or double. More...

#include <pqChartValue.h>

List of all members.

Public Types

enum  ValueType { IntValue, FloatValue, DoubleValue }
enum  NotationType { Standard = 0, Exponential, Engineering, StandardOrExponential }

Public Member Functions

 pqChartValue ()
 Creates a chart value object.
 pqChartValue (const pqChartValue &value)
 Used to copy another chart value.
 pqChartValue (int value)
 Creates a chart value to store an integer.
 pqChartValue (float value)
 Creates a chart value to store a float.
 pqChartValue (double value)
 Creates a chart value to store a float.
 ~pqChartValue ()
ValueType getType () const
 Gets the type of value stored.
void convertTo (ValueType type)
 Converts the value stored to the specified type.
void setValue (int value)
 Stores an integer value.
void setValue (float value)
 Stores a float value.
void setValue (double value)
 Stores a double value.
int getIntValue () const
 Gets the value as an integer.
float getFloatValue () const
 Gets the value as a float.
double getDoubleValue () const
 Gets the value as a double.
QString getString (int precision=2, NotationType notation=pqChartValue::StandardOrExponential) const
 Gets a string representation of the value.
Operators
pqChartValueoperator= (const pqChartValue &value)
 Assigns the value from another chart value.
pqChartValueoperator= (int value)
 Assigns the value from an integer.
pqChartValueoperator= (float value)
 Assigns the value from a float.
pqChartValueoperator= (double value)
 Assigns the value from a double.
 operator int () const
 Casts the value to an integer.
 operator float () const
 Casts the value to a float.
 operator double () const
 Casts the value to a double.
pqChartValueoperator++ ()
 Increments the value.
pqChartValue operator++ (int post)
 Post-increments the value.
pqChartValueoperator-- ()
 Decrements the value.
pqChartValue operator-- (int post)
 Post-decrements the value.
pqChartValue operator+ (const pqChartValue &value) const
 Adds two chart values.
pqChartValue operator+ (int value) const
 Adds a chart value and an integer.
pqChartValue operator+ (float value) const
 Adds a chart value and a float.
pqChartValue operator+ (double value) const
 Adds a chart value and a double.
pqChartValue operator- (const pqChartValue &value) const
 Subtracts two chart values.
pqChartValue operator- (int value) const
 Subtracts a chart value and an integer.
pqChartValue operator- (float value) const
 Subtracts a chart value and a float.
pqChartValue operator- (double value) const
 Subtracts a chart value and a double.
pqChartValue operator* (const pqChartValue &value) const
 Multiplies two chart values.
pqChartValue operator* (int value) const
 Multiplies a chart value and an integer.
pqChartValue operator* (float value) const
 Multiplies a chart value and a float.
pqChartValue operator* (double value) const
 Multiplies a chart value and a double.
pqChartValue operator/ (const pqChartValue &value) const
 Divides two chart values.
pqChartValue operator/ (int value) const
 Divides a chart value and an integer.
pqChartValue operator/ (float value) const
 Divides a chart value and a float.
pqChartValue operator/ (double value) const
 Divides a chart value and a double.
pqChartValueoperator+= (const pqChartValue &value)
 Adds another value to this one and stores the result.
pqChartValueoperator+= (int value)
 Adds an integer to this value and stores the result.
pqChartValueoperator+= (float value)
 Adds a float to this value and stores the result.
pqChartValueoperator+= (double value)
 Adds a double to this value and stores the result.
pqChartValueoperator-= (const pqChartValue &value)
 Subtracts another value from this one and stores the result.
pqChartValueoperator-= (int value)
 Subtracts an integer from this value and stores the result.
pqChartValueoperator-= (float value)
 Subtracts a float from this value and stores the result.
pqChartValueoperator-= (double value)
 Subtracts a double from this value and stores the result.
pqChartValueoperator*= (const pqChartValue &value)
 Multiplies this value by another and stores the result.
pqChartValueoperator*= (int value)
 Multiplies this value by an integer and stores the result.
pqChartValueoperator*= (float value)
 Multiplies this value by a float and stores the result.
pqChartValueoperator*= (double value)
 Multiplies this value by a double and stores the result.
pqChartValueoperator/= (const pqChartValue &value)
 Divides this value by another and stores the result.
pqChartValueoperator/= (int value)
 Divides this value by an integer and stores the result.
pqChartValueoperator/= (float value)
 Divides this value by a float and stores the result.
pqChartValueoperator/= (double value)
 Divides this value by a double and stores the result.
bool operator== (const pqChartValue &value) const
 Compares this chart value to another one.
bool operator== (int value) const
 Compares this chart value to an integer.
bool operator== (float value) const
 Compares this chart value to a float.
bool operator== (double value) const
 Compares this chart value to a double.
bool operator!= (const pqChartValue &value) const
 Compares this chart value to another one.
bool operator!= (int value) const
 Compares this chart value to an integer.
bool operator!= (float value) const
 Compares this chart value to a float.
bool operator!= (double value) const
 Compares this chart value to a double.
bool operator> (const pqChartValue &value) const
 Compares this chart value to another one.
bool operator> (int value) const
 Compares this chart value to an integer.
bool operator> (float value) const
 Compares this chart value to a float.
bool operator> (double value) const
 Compares this chart value to a double.
bool operator< (const pqChartValue &value) const
 Compares this chart value to another one.
bool operator< (int value) const
 Compares this chart value to an integer.
bool operator< (float value) const
 Compares this chart value to a float.
bool operator< (double value) const
 Compares this chart value to a double.
bool operator>= (const pqChartValue &value) const
 Compares this chart value to another one.
bool operator>= (int value) const
 Compares this chart value to an integer.
bool operator>= (float value) const
 Compares this chart value to a float.
bool operator>= (double value) const
 Compares this chart value to a double.
bool operator<= (const pqChartValue &value) const
 Compares this chart value to another one.
bool operator<= (int value) const
 Compares this chart value to an integer.
bool operator<= (float value) const
 Compares this chart value to a float.
bool operator<= (double value) const
 Compares this chart value to a double.

Related Functions

(Note that these are not member functions.)

PQCOMPONENTS_EXPORT int operator+ (int value1, const pqChartValue &value2)
 Adds an integer and a chart value object.
PQCOMPONENTS_EXPORT float operator+ (float value1, const pqChartValue &value2)
 Adds a float and a chart value object.
PQCOMPONENTS_EXPORT double operator+ (double value1, const pqChartValue &value2)
 Adds a double and a chart value object.
PQCOMPONENTS_EXPORT int operator- (int value1, const pqChartValue &value2)
 Subtracts an integer and a chart value object.
PQCOMPONENTS_EXPORT float operator- (float value1, const pqChartValue &value2)
 Subtracts a float and a chart value object.
PQCOMPONENTS_EXPORT double operator- (double value1, const pqChartValue &value2)
 Subtracts a double and a chart value object.
PQCOMPONENTS_EXPORT int operator* (int value1, const pqChartValue &value2)
 Multiplies an integer and a chart value object.
PQCOMPONENTS_EXPORT float operator* (float value1, const pqChartValue &value2)
 Multiplies a float and a chart value object.
PQCOMPONENTS_EXPORT double operator* (double value1, const pqChartValue &value2)
 Multiplies a double and a chart value object.
PQCOMPONENTS_EXPORT int operator/ (int value1, const pqChartValue &value2)
 Divides an integer and a chart value object.
PQCOMPONENTS_EXPORT float operator/ (float value1, const pqChartValue &value2)
 Divides a float and a chart value object.
PQCOMPONENTS_EXPORT double operator/ (double value1, const pqChartValue &value2)
 Divides a double and a chart value object.
PQCOMPONENTS_EXPORT bool operator== (int value1, const pqChartValue &value2)
 Compares an integer and a chart value object.
PQCOMPONENTS_EXPORT bool operator== (float value1, const pqChartValue &value2)
 Compares a float and a chart value object.
PQCOMPONENTS_EXPORT bool operator== (double value1, const pqChartValue &value2)
 Compares a double and a chart value object.
PQCOMPONENTS_EXPORT bool operator!= (int value1, const pqChartValue &value2)
 Compares an integer and a chart value object.
PQCOMPONENTS_EXPORT bool operator!= (float value1, const pqChartValue &value2)
 Compares a float and a chart value object.
PQCOMPONENTS_EXPORT bool operator!= (double value1, const pqChartValue &value2)
 Compares a double and a chart value object.
PQCOMPONENTS_EXPORT bool operator> (int value1, const pqChartValue &value2)
 Compares an integer and a chart value object.
PQCOMPONENTS_EXPORT bool operator> (float value1, const pqChartValue &value2)
 Compares a float and a chart value object.
PQCOMPONENTS_EXPORT bool operator> (double value1, const pqChartValue &value2)
 Compares a double and a chart value object.
PQCOMPONENTS_EXPORT bool operator< (int value1, const pqChartValue &value2)
 Compares an integer and a chart value object.
PQCOMPONENTS_EXPORT bool operator< (float value1, const pqChartValue &value2)
 Compares a float and a chart value object.
PQCOMPONENTS_EXPORT bool operator< (double value1, const pqChartValue &value2)
 Compares a double and a chart value object.
PQCOMPONENTS_EXPORT bool operator>= (int value1, const pqChartValue &value2)
 Compares an integer and a chart value object.
PQCOMPONENTS_EXPORT bool operator>= (float value1, const pqChartValue &value2)
 Compares a float and a chart value object.
PQCOMPONENTS_EXPORT bool operator>= (double value1, const pqChartValue &value2)
 Compares a double and a chart value object.
PQCOMPONENTS_EXPORT bool operator<= (int value1, const pqChartValue &value2)
 Compares an integer and a chart value object.
PQCOMPONENTS_EXPORT bool operator<= (float value1, const pqChartValue &value2)
 Compares a float and a chart value object.
PQCOMPONENTS_EXPORT bool operator<= (double value1, const pqChartValue &value2)
 Compares a double and a chart value object.

Detailed Description

The pqChartValue class is used to store a number that can be one of three types: int, float, or double.

This union of numeric types allows a chart to handle numeric data of different types without using a template. All the operators make it simple to use values of different types because the conversion is done under the covers. The increment and decrement operators are implemented using the machine floating point epsilon for non-integer types, which is useful when doing boolean operations on selection ranges.

Definition at line 63 of file pqChartValue.h.


Member Enumeration Documentation

Enumerator:
IntValue 
FloatValue 
DoubleValue 

Definition at line 66 of file pqChartValue.h.

Enumerator:
Standard 
Exponential 
Engineering 
StandardOrExponential 

Definition at line 72 of file pqChartValue.h.


Constructor & Destructor Documentation

pqChartValue::pqChartValue ( )

Creates a chart value object.

The value created is an integer type with a value of zero.

pqChartValue::pqChartValue ( const pqChartValue value)

Used to copy another chart value.

Parameters:
valueThe value to store.
pqChartValue::pqChartValue ( int  value)

Creates a chart value to store an integer.

Parameters:
valueThe value to store.
pqChartValue::pqChartValue ( float  value)

Creates a chart value to store a float.

Parameters:
valueThe value to store.
pqChartValue::pqChartValue ( double  value)

Creates a chart value to store a float.

Parameters:
valueThe value to store.
pqChartValue::~pqChartValue ( )

Member Function Documentation

ValueType pqChartValue::getType ( ) const [inline]

Gets the type of value stored.

Returns:
The type of value stored.

Definition at line 111 of file pqChartValue.h.

void pqChartValue::convertTo ( ValueType  type)

Converts the value stored to the specified type.

Parameters:
typeThe type to cast the value to.
void pqChartValue::setValue ( int  value)

Stores an integer value.

Parameters:
valueThe value to store.
void pqChartValue::setValue ( float  value)

Stores a float value.

Parameters:
valueThe value to store.
void pqChartValue::setValue ( double  value)

Stores a double value.

Parameters:
valueThe value to store.
int pqChartValue::getIntValue ( ) const

Gets the value as an integer.

If the value stored is not an integer, it will be cast to one.

Returns:
The value as an integer.
float pqChartValue::getFloatValue ( ) const

Gets the value as a float.

If the value stored is not a float, it will be cast to one.

Returns:
The value as a float.
double pqChartValue::getDoubleValue ( ) const

Gets the value as a double.

If the value stored is not a double, it will be cast to one.

Returns:
The value as a double.
QString pqChartValue::getString ( int  precision = 2,
NotationType  notation = pqChartValue::StandardOrExponential 
) const

Gets a string representation of the value.

If the value is a floating point type, the precision will determine how many decimal places will be printed. The number will be printed in exponential notation if it is shorter.

Parameters:
precisionThe floating point precision.
notationThe notation used to represent the value.
Returns:
A string representation of the value.
pqChartValue& pqChartValue::operator= ( const pqChartValue value)

Assigns the value from another chart value.

pqChartValue& pqChartValue::operator= ( int  value)

Assigns the value from an integer.

pqChartValue& pqChartValue::operator= ( float  value)

Assigns the value from a float.

pqChartValue& pqChartValue::operator= ( double  value)

Assigns the value from a double.

pqChartValue::operator int ( ) const [inline]

Casts the value to an integer.

Definition at line 193 of file pqChartValue.h.

pqChartValue::operator float ( ) const [inline]

Casts the value to a float.

Definition at line 196 of file pqChartValue.h.

pqChartValue::operator double ( ) const [inline]

Casts the value to a double.

Definition at line 199 of file pqChartValue.h.

pqChartValue& pqChartValue::operator++ ( )

Increments the value.

If the value is not an integer type, the value is increased by the machine epsilon for the type.

pqChartValue pqChartValue::operator++ ( int  post)

Post-increments the value.

If the value is not an integer type, the value is increased by the machine epsilon for the type.

Parameters:
postA placeholder to determine the operator.
pqChartValue& pqChartValue::operator-- ( )

Decrements the value.

If the value is not an integer type, the value is decreased by the machine epsilon for the type.

pqChartValue pqChartValue::operator-- ( int  post)

Post-decrements the value.

If the value is not an integer type, the value is decreased by the machine epsilon for the type.

Parameters:
postA placeholder to determine the operator.
pqChartValue pqChartValue::operator+ ( const pqChartValue value) const

Adds two chart values.

pqChartValue pqChartValue::operator+ ( int  value) const

Adds a chart value and an integer.

pqChartValue pqChartValue::operator+ ( float  value) const

Adds a chart value and a float.

pqChartValue pqChartValue::operator+ ( double  value) const

Adds a chart value and a double.

pqChartValue pqChartValue::operator- ( const pqChartValue value) const

Subtracts two chart values.

pqChartValue pqChartValue::operator- ( int  value) const

Subtracts a chart value and an integer.

pqChartValue pqChartValue::operator- ( float  value) const

Subtracts a chart value and a float.

pqChartValue pqChartValue::operator- ( double  value) const

Subtracts a chart value and a double.

pqChartValue pqChartValue::operator* ( const pqChartValue value) const

Multiplies two chart values.

pqChartValue pqChartValue::operator* ( int  value) const

Multiplies a chart value and an integer.

pqChartValue pqChartValue::operator* ( float  value) const

Multiplies a chart value and a float.

pqChartValue pqChartValue::operator* ( double  value) const

Multiplies a chart value and a double.

pqChartValue pqChartValue::operator/ ( const pqChartValue value) const

Divides two chart values.

pqChartValue pqChartValue::operator/ ( int  value) const

Divides a chart value and an integer.

pqChartValue pqChartValue::operator/ ( float  value) const

Divides a chart value and a float.

pqChartValue pqChartValue::operator/ ( double  value) const

Divides a chart value and a double.

pqChartValue& pqChartValue::operator+= ( const pqChartValue value)

Adds another value to this one and stores the result.

pqChartValue& pqChartValue::operator+= ( int  value)

Adds an integer to this value and stores the result.

pqChartValue& pqChartValue::operator+= ( float  value)

Adds a float to this value and stores the result.

pqChartValue& pqChartValue::operator+= ( double  value)

Adds a double to this value and stores the result.

pqChartValue& pqChartValue::operator-= ( const pqChartValue value)

Subtracts another value from this one and stores the result.

pqChartValue& pqChartValue::operator-= ( int  value)

Subtracts an integer from this value and stores the result.

pqChartValue& pqChartValue::operator-= ( float  value)

Subtracts a float from this value and stores the result.

pqChartValue& pqChartValue::operator-= ( double  value)

Subtracts a double from this value and stores the result.

pqChartValue& pqChartValue::operator*= ( const pqChartValue value)

Multiplies this value by another and stores the result.

pqChartValue& pqChartValue::operator*= ( int  value)

Multiplies this value by an integer and stores the result.

pqChartValue& pqChartValue::operator*= ( float  value)

Multiplies this value by a float and stores the result.

pqChartValue& pqChartValue::operator*= ( double  value)

Multiplies this value by a double and stores the result.

pqChartValue& pqChartValue::operator/= ( const pqChartValue value)

Divides this value by another and stores the result.

pqChartValue& pqChartValue::operator/= ( int  value)

Divides this value by an integer and stores the result.

pqChartValue& pqChartValue::operator/= ( float  value)

Divides this value by a float and stores the result.

pqChartValue& pqChartValue::operator/= ( double  value)

Divides this value by a double and stores the result.

bool pqChartValue::operator== ( const pqChartValue value) const

Compares this chart value to another one.

bool pqChartValue::operator== ( int  value) const

Compares this chart value to an integer.

bool pqChartValue::operator== ( float  value) const

Compares this chart value to a float.

bool pqChartValue::operator== ( double  value) const

Compares this chart value to a double.

bool pqChartValue::operator!= ( const pqChartValue value) const

Compares this chart value to another one.

bool pqChartValue::operator!= ( int  value) const

Compares this chart value to an integer.

bool pqChartValue::operator!= ( float  value) const

Compares this chart value to a float.

bool pqChartValue::operator!= ( double  value) const

Compares this chart value to a double.

bool pqChartValue::operator> ( const pqChartValue value) const

Compares this chart value to another one.

bool pqChartValue::operator> ( int  value) const

Compares this chart value to an integer.

bool pqChartValue::operator> ( float  value) const

Compares this chart value to a float.

bool pqChartValue::operator> ( double  value) const

Compares this chart value to a double.

bool pqChartValue::operator< ( const pqChartValue value) const

Compares this chart value to another one.

bool pqChartValue::operator< ( int  value) const

Compares this chart value to an integer.

bool pqChartValue::operator< ( float  value) const

Compares this chart value to a float.

bool pqChartValue::operator< ( double  value) const

Compares this chart value to a double.

bool pqChartValue::operator>= ( const pqChartValue value) const

Compares this chart value to another one.

bool pqChartValue::operator>= ( int  value) const

Compares this chart value to an integer.

bool pqChartValue::operator>= ( float  value) const

Compares this chart value to a float.

bool pqChartValue::operator>= ( double  value) const

Compares this chart value to a double.

bool pqChartValue::operator<= ( const pqChartValue value) const

Compares this chart value to another one.

bool pqChartValue::operator<= ( int  value) const

Compares this chart value to an integer.

bool pqChartValue::operator<= ( float  value) const

Compares this chart value to a float.

bool pqChartValue::operator<= ( double  value) const

Compares this chart value to a double.


Friends And Related Function Documentation

PQCOMPONENTS_EXPORT int operator+ ( int  value1,
const pqChartValue value2 
) [related]

Adds an integer and a chart value object.

PQCOMPONENTS_EXPORT float operator+ ( float  value1,
const pqChartValue value2 
) [related]

Adds a float and a chart value object.

PQCOMPONENTS_EXPORT double operator+ ( double  value1,
const pqChartValue value2 
) [related]

Adds a double and a chart value object.

PQCOMPONENTS_EXPORT int operator- ( int  value1,
const pqChartValue value2 
) [related]

Subtracts an integer and a chart value object.

PQCOMPONENTS_EXPORT float operator- ( float  value1,
const pqChartValue value2 
) [related]

Subtracts a float and a chart value object.

PQCOMPONENTS_EXPORT double operator- ( double  value1,
const pqChartValue value2 
) [related]

Subtracts a double and a chart value object.

PQCOMPONENTS_EXPORT int operator* ( int  value1,
const pqChartValue value2 
) [related]

Multiplies an integer and a chart value object.

PQCOMPONENTS_EXPORT float operator* ( float  value1,
const pqChartValue value2 
) [related]

Multiplies a float and a chart value object.

PQCOMPONENTS_EXPORT double operator* ( double  value1,
const pqChartValue value2 
) [related]

Multiplies a double and a chart value object.

PQCOMPONENTS_EXPORT int operator/ ( int  value1,
const pqChartValue value2 
) [related]

Divides an integer and a chart value object.

PQCOMPONENTS_EXPORT float operator/ ( float  value1,
const pqChartValue value2 
) [related]

Divides a float and a chart value object.

PQCOMPONENTS_EXPORT double operator/ ( double  value1,
const pqChartValue value2 
) [related]

Divides a double and a chart value object.

PQCOMPONENTS_EXPORT bool operator== ( int  value1,
const pqChartValue value2 
) [related]

Compares an integer and a chart value object.

PQCOMPONENTS_EXPORT bool operator== ( float  value1,
const pqChartValue value2 
) [related]

Compares a float and a chart value object.

PQCOMPONENTS_EXPORT bool operator== ( double  value1,
const pqChartValue value2 
) [related]

Compares a double and a chart value object.

PQCOMPONENTS_EXPORT bool operator!= ( int  value1,
const pqChartValue value2 
) [related]

Compares an integer and a chart value object.

PQCOMPONENTS_EXPORT bool operator!= ( float  value1,
const pqChartValue value2 
) [related]

Compares a float and a chart value object.

PQCOMPONENTS_EXPORT bool operator!= ( double  value1,
const pqChartValue value2 
) [related]

Compares a double and a chart value object.

PQCOMPONENTS_EXPORT bool operator> ( int  value1,
const pqChartValue value2 
) [related]

Compares an integer and a chart value object.

PQCOMPONENTS_EXPORT bool operator> ( float  value1,
const pqChartValue value2 
) [related]

Compares a float and a chart value object.

PQCOMPONENTS_EXPORT bool operator> ( double  value1,
const pqChartValue value2 
) [related]

Compares a double and a chart value object.

PQCOMPONENTS_EXPORT bool operator< ( int  value1,
const pqChartValue value2 
) [related]

Compares an integer and a chart value object.

PQCOMPONENTS_EXPORT bool operator< ( float  value1,
const pqChartValue value2 
) [related]

Compares a float and a chart value object.

PQCOMPONENTS_EXPORT bool operator< ( double  value1,
const pqChartValue value2 
) [related]

Compares a double and a chart value object.

PQCOMPONENTS_EXPORT bool operator>= ( int  value1,
const pqChartValue value2 
) [related]

Compares an integer and a chart value object.

PQCOMPONENTS_EXPORT bool operator>= ( float  value1,
const pqChartValue value2 
) [related]

Compares a float and a chart value object.

PQCOMPONENTS_EXPORT bool operator>= ( double  value1,
const pqChartValue value2 
) [related]

Compares a double and a chart value object.

PQCOMPONENTS_EXPORT bool operator<= ( int  value1,
const pqChartValue value2 
) [related]

Compares an integer and a chart value object.

PQCOMPONENTS_EXPORT bool operator<= ( float  value1,
const pqChartValue value2 
) [related]

Compares a float and a chart value object.

PQCOMPONENTS_EXPORT bool operator<= ( double  value1,
const pqChartValue value2 
) [related]

Compares a double and a chart value object.


Member Data Documentation

Definition at line 405 of file pqChartValue.h.

Definition at line 406 of file pqChartValue.h.

Definition at line 407 of file pqChartValue.h.


The documentation for this class was generated from the following file: