rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvReliefGauge Class Reference

Graphic class. More...

#include <ilviews/graphics/gauge.h>

Inheritance diagram for IlvReliefGauge:
IlvRectangularGauge IlvGauge IlvSimpleGraphic IlvGraphic

List of all members.

Public Member Functions

 IlvReliefGauge (IlvDisplay *display, const IlvRect &drawrect, IlFloat min=0, IlFloat max=100, IlFloat value=50, IlvDirection direction=IlvVertical, IlUShort thickness=4, IlBoolean showBox=((IlBoolean) 1), IlvPalette *palette=0)
 Constructor.
virtual void bboxRange (IlFloat v1, IlFloat v2, IlvRect &rect, const IlvTransformer *t=0) const
 Returns the rectangle to update when the value of the gauge changes.
const char * className () const
 Returns the class name of an object.
virtual IlvGraphiccopy () const
 Copies this object.
virtual void drawValue (IlvPort *, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Performs the drawing representing the current value of the gauge.
virtual IlvClassInfogetClassInfo () const
 Gets class information.
IlUShort getThickness () const
 Gets the thickness of the gauge slider.
virtual void invert (IlBoolean=((IlBoolean) 0))
 Highlights the object.
IlBoolean isSubtypeOf (const IlvClassInfo *c) const
 Checks whether this object's class is a subclass.
IlBoolean isSubtypeOf (const char *t) const
 Checks whether this object's class is a subclass of a given parent class.
virtual void setAlpha (IlvIntensity alpha)
 Sets the alpha value of the object.
virtual void setAntialiasingMode (IlvAntialiasingMode mode)
 Sets the anti-aliasing mode of the object.
virtual void setForeground (IlvColor *)
 Sets the foreground color of the object.
virtual void setMode (IlvDrawMode)
 Sets the drawing mode of the object temporarily.
virtual void setPalette (IlvPalette *)
 Sets the internal palette to the given palette value.
void setThickness (IlUShort thickness)
 Sets the thickness of the gauge.
virtual void write (IlvOutputFile &) const
 Writes an object description to a file.

Static Public Member Functions

static void AddProperty (const IlSymbol *k, IlAny v)
 Adds a property to this object's class.
static IlAny GetProperty (const IlSymbol *key, IlBoolean p=((IlBoolean) 0))
 Retrieves the property value associated with the key in this object's class.
static const IlvClassInfoHasProperty (const IlSymbol *key, IlBoolean p=((IlBoolean) 0))
 Checks for the existence of a property for this object's class hierarchy.
static IlvGraphicread (IlvInputFile &, IlvPalette *pal)
 Reads an object description from a file.
static IlBoolean RemoveProperty (const IlSymbol *key)
 Removes a property from this object's class.
static IlBoolean ReplaceProperty (const IlSymbol *k, IlAny v)
 Replaces a property in this object's class.

Detailed Description

Graphic class.

Library: views

A relief gauge is a slider gauge (see IlvSliderGauge) where the moving part has a three-dimensional appearance.

relfgaug.gif


IlvReliefGauge

See also:
IlvCircularGauge, IlvSliderGauge.

Constructor & Destructor Documentation

IlvReliefGauge::IlvReliefGauge ( IlvDisplay display,
const IlvRect drawrect,
IlFloat  min = 0,
IlFloat  max = 100,
IlFloat  value = 50,
IlvDirection  direction = IlvVertical,
IlUShort  thickness = 4,
IlBoolean  showBox = ((IlBoolean) 1),
IlvPalette palette = 0 
)

Constructor.

Parameters:
display The display instance.
drawrect Specifies the size of the graphic object.
min The minimum value of the gauge.
max The maximum value of the gauge.
value The current value of the gauge.
direction Indicates the direction of the gauge: it can be set to any of the four directions (IlvBottom, IlvTop, IlvLeft, IlvRight), indicating the position of the minimum value representation, or to IlvVertical (equivalent to IlvLeft) or IlvHorizontal (equivalent to IlvBottom).
thickness The initial thickness of the gauge slider.
showBox Indicates, by the value IlTrue, that the border of the rectangle is drawn; or by IlFalse that it is not.
palette The palette used to draw the graphic object.

Member Function Documentation

static void IlvReliefGauge::AddProperty ( const IlSymbol key,
IlAny  value 
) [static]

Adds a property to this object's class.

This static function associates the given value with the given key for the class of this object only.

Parameters:
key The key to be associated.
value The value to be associated.

Reimplemented from IlvRectangularGauge.

virtual void IlvReliefGauge::bboxRange ( IlFloat  v1,
IlFloat  v2,
IlvRect rect,
const IlvTransformer t = 0 
) const [virtual]

Returns the rectangle to update when the value of the gauge changes.

Returns:
The rectangular region to be updated if the value of the gauge was changing from v1 to v2.
Parameters:
v1 Initial value of the gauge.
v2 Future value of the gauge.
rect Used to return the rectangle to update.
t The transformer. If it is specified, the graphic object is considered to be drawn through a transformation and the returned rectangle is expressed in the transformed coordinate system.

Reimplemented from IlvRectangularGauge.

const char* IlvReliefGauge::className (  )  const

Returns the class name of an object.

This method is equivalent to getClassInfo()->getClassName().

Returns:
The class name of the object. For example, for an IlvRectangle object, the className function returns "IlvRectangle".

Reimplemented from IlvRectangularGauge.

virtual IlvGraphic* IlvReliefGauge::copy (  )  const [virtual]

Copies this object.

Allocates and returns a copy of this object. If the object is composite, the implementation of this member function makes a copy of the object's components.

Returns:
A copy of the object.
See also:
IlvPredefinedIOMembers.

Reimplemented from IlvRectangularGauge.

virtual void IlvReliefGauge::drawValue ( IlvPort ,
const IlvTransformer t = 0,
const IlvRegion clip = 0 
) const [virtual]

Performs the drawing representing the current value of the gauge.

Called by the member function draw and interactors that connect to it. Draws the part of the gauge that indicates its value (such as the hand of a watch).

Parameters:
dst The destination port.
t The transformer to apply to the drawing.
clip The clipping region.

Reimplemented from IlvRectangularGauge.

virtual IlvClassInfo* IlvReliefGauge::getClassInfo (  )  const [virtual]

Gets class information.

Returns a pointer to the IlvClassInfo object associated with this object's class.

Returns:
A pointer to the class information object of the class of this object.

Reimplemented from IlvRectangularGauge.

static IlAny IlvReliefGauge::GetProperty ( const IlSymbol key,
IlBoolean  checkSuperClass = ((IlBoolean) 0) 
) [static]

Retrieves the property value associated with the key in this object's class.

Retrieves the property value associated with the property name key. If the property cannot be found in the class of this object, and if checkSuperClass is set to IlTrue, then the function operates iteratively on each superclass until the property is found. If the property cannot be found, then 0 is returned.

Parameters:
key The key with which the property value is associated.
checkSuperClass IlTrue specifies iterative search on superclasses.
Returns:
The property value associated with the proper name key, or 0.

Reimplemented from IlvRectangularGauge.

IlUShort IlvReliefGauge::getThickness (  )  const

Gets the thickness of the gauge slider.

Returns:
The thickness of the gauge slider.
static const IlvClassInfo* IlvReliefGauge::HasProperty ( const IlSymbol key,
IlBoolean  checkSuperClass = ((IlBoolean) 0) 
) [static]

Checks for the existence of a property for this object's class hierarchy.

Retrieves a pointer to the IlvClassInfo that indicates a class where the key property exists. If the returned value is non-0, then this property actually exists for this class. If this is not the case and if checkSuperClass is set to IlTrue, then the function operates iteratively on each superclass until a match is found. If the property cannot be found, then 0 is returned.

Parameters:
key The key with which the property value is associated.
checkSuperClass IlTrue specifies iterative search on superclasses.
Returns:
A pointer to the ClassInfo that indicates a class where the key property exists, or 0.

Reimplemented from IlvRectangularGauge.

virtual void IlvReliefGauge::invert ( IlBoolean  temp = ((IlBoolean) 0)  )  [virtual]

Highlights the object.

Highlights the object. It is implemented as swapping the foreground and background colors of the object, but can have other implementations in derived subclasses. The parameter temp controls the way you toggle between the background and the foreground. If temp is omitted or is IlFalse, then a new palette is computed by calling the IlvDisplay::getPalette() method. If temp is IlTrue, the object palette is inverted, and thus all the objects referencing this palette will be affected.

Parameters:
temp If IlTrue, highlights the object.

Reimplemented from IlvGauge.

IlBoolean IlvReliefGauge::isSubtypeOf ( const IlvClassInfo classInfo  )  const

Checks whether this object's class is a subclass.

This method is equivalent to getClassInfo()->isSubtypeOf(classInfo).

Parameters:
classInfo The name of a class on which the object's class is tested.
Returns:
Either IlTrue or IlFalse, depending on whether or not this object's class is a subclass of the class indicated by classInfo.

Reimplemented from IlvRectangularGauge.

IlBoolean IlvReliefGauge::isSubtypeOf ( const char *  parentClass  )  const

Checks whether this object's class is a subclass of a given parent class.

This method is equivalent to getClassInfo()->isSubtypeOf(parentClass).

Parameters:
parentClass A string representing the parent class.
Returns:
Either IlTrue or IlFalse, depending on whether or not this object's class inherits parentClass attributes. The parentClass parameter should be a string representing the class name of an IlvGraphic subclass. A call to this member function for a given class instance returns IlTrue if given the name of its class.

Reimplemented from IlvRectangularGauge.

static IlvGraphic* IlvReliefGauge::read ( IlvInputFile file,
IlvPalette palette 
) [static]

Reads an object description from a file.

Reads an object description from the file input, given the palette graphic attributes. It reads the information that was saved by the member function write to be able to create a new instance of this object. Usually, because of the availability of the constructor that expects an IlvInputFile, read should be equivalent to:

 IlvGraphic*
 MyClass::read(IlvInputFile& file, IlvPalette* palette)
 {
     return new MyClass(file, palette);
 }

In the following example, the static member function read of the IlvLabel class could have the following form:

 IlvGraphic*
 IlvLabel::read(IlvInputFile& file, IlvPalette* pal)
 {
     IlvPoint pos;
     file.getStream() >> pos;     // Read the position field
     return new IlvLabel(pal->getDisplay(), pos,
     IlvReadString(file.getStream()), pal);
 }
Parameters:
file The name of the file to be read from.
palette The name of the palette for the object.
See also:
DeclareTypeInfoRO, DeclareTypeInfo, IlvPredefinedIOMembers.
Warning:
[note] The read method is not capitalized like other static methods so that it is consistent with the write method.

Reimplemented from IlvRectangularGauge.

static IlBoolean IlvReliefGauge::RemoveProperty ( const IlSymbol key  )  [static]

Removes a property from this object's class.

This static function removes the indicated property to the class of this object.

Parameters:
key The key property to be removed.
Returns:
IlTrue if the key property was actually found, or IlFalse otherwise.

Reimplemented from IlvRectangularGauge.

static IlBoolean IlvReliefGauge::ReplaceProperty ( const IlSymbol key,
IlAny  value 
) [static]

Replaces a property in this object's class.

This static function replaces the indicated property value to the class of this object.

Parameters:
key The key to be replaced.
value The value to be replaced.
Returns:
IlTrue if the key property was actually found, or IlFalse otherwise.

Reimplemented from IlvRectangularGauge.

virtual void IlvReliefGauge::setAlpha ( IlvIntensity  alpha  )  [virtual]

Sets the alpha value of the object.

Parameters:
alpha The new alpha value.

Reimplemented from IlvGauge.

virtual void IlvReliefGauge::setAntialiasingMode ( IlvAntialiasingMode  mode  )  [virtual]

Sets the anti-aliasing mode of the object.

Parameters:
mode The new anti-aliasing mode.

Reimplemented from IlvGauge.

virtual void IlvReliefGauge::setForeground ( IlvColor foreground  )  [virtual]

Sets the foreground color of the object.

Sets the foreground color of the object.

Parameters:
foreground The new foreground color.

Reimplemented from IlvGauge.

virtual void IlvReliefGauge::setMode ( IlvDrawMode  mode  )  [virtual]

Sets the drawing mode of the object temporarily.

Changing the IlvDrawMode attribute of an object is considered a temporary operation. You have to set the mode to its default value when you no longer need another mode different from the value IlvModeSet. The drawing mode information is passed to the palette of the graphic object (see the IlvPalette::setOverwrite method for more details).

Parameters:
mode The drawing mode to be set.

Reimplemented from IlvGauge.

virtual void IlvReliefGauge::setPalette ( IlvPalette palette  )  [virtual]

Sets the internal palette to the given palette value.

Sets the internal palette to the given palette value. The previous palette is unlocked, and palette is locked.

Parameters:
palette The new palette of this object.

Reimplemented from IlvGauge.

void IlvReliefGauge::setThickness ( IlUShort  thickness  ) 

Sets the thickness of the gauge.

Parameters:
thickness The new thickness of the gauge slider.
virtual void IlvReliefGauge::write ( IlvOutputFile output  )  const [virtual]

Writes an object description to a file.

Writes out, in a file, the object description. This description contains all the information necessary to create an exact copy of this object by means of the member function read. Information concerning any IlvPalette object attached to this object is written out by the object containers. All other information, such as the position and size of the object, is written out by this virtual member function.
For example, suppose we have an IlvLabel class that implements a graphic object drawn as a text string at a given position. It maintains its position in an internal IlvPoint field called _position and its textual content in an internal character array field called _text. The only information we need to save is the contents of those fields. So, the member function write of such an object should have the following form:

 void
 IlvLabel::write(IlvOutputFile& file) const
 {
     // Save the position field
     file.getStream() << IlvSpc() << _position;
     // Save the text field
     IlvWriteString(file.getStream(), _text);
 }
Parameters:
output The the output file to be written to.
See also:
DeclareTypeInfo.

Reimplemented from IlvRectangularGauge.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.