rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvFilteredGraphic Class Reference

Graphic class. More...

#include <ilviews/graphics/filtgraph.h>

Inheritance diagram for IlvFilteredGraphic:
IlvGraphicHandle IlvGraphic

List of all members.

Public Types

enum  DisplayMode { DisplayFiltered, DisplayShowThrough }
 

This enumeration defines the possible values for the display mode.

More...
enum  RefreshMode { RefreshOnDemand, RefreshAlways }
 

This enumeration defines the possible values for the refresh mode.

More...

Public Member Functions

 IlvFilteredGraphic (IlvDisplay *display, IlvGraphic *object, const IlString &filter="", IlBoolean owner=((IlBoolean) 0))
 Constructor.
virtual ~IlvFilteredGraphic ()
 Destructor.
void applyTransform (const IlvTransformer *t)
 Applies a transformation.
void boundingBox (IlvRect &r, const IlvTransformer *t=0) const
 Retrieves the bounding box of the graphic object.
const char * className () const
 Returns the class name of an object.
void computeBitmapData (const IlvTransformer *t=0)
 Computes the filtered bitmap data.
virtual IlBoolean contains (const IlvPoint &p, const IlvPoint &tp, const IlvTransformer *t=0) const
 Checks whether a point is in the object.
virtual IlvGraphiccopy () const
 Copies this object.
void draw (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Draws the graphic object.
virtual IlvClassInfogetClassInfo () const
 Gets class information.
DisplayMode getDisplayMode () const
 Returns the display mode.
IlvFilterFlowgetFilterFlow () const
 Returns the filter flow used.
const IlStringgetFilterName () const
 Returns the name of the filter used.
const IlvBitmapDatagetInternalBitmapData () const
 Returns the internal filtered bitmap data.
IlvColorgetInternalColor () const
 Returns the color used internally to compute the mask from the object.
IlUInt getMaximumSize () const
 Returns the maximum dimension of the internal bitmap.
RefreshMode getRefreshMode () const
 Returns the refresh mode.
virtual IlBoolean inside (const IlvRegion &tregion, const IlvTransformer *t=0) const
 Determines whether an object with transformation applied is inside the bounding box.
virtual IlBoolean intersects (const IlvRegion &tregion, const IlvTransformer *t=0) const
 Checks whether a region intersects the bounding box with transformation applied.
void invalidate ()
 Marks the internal filtered graphic as invalid.
virtual void invert (IlBoolean temp=((IlBoolean) 0))
 Highlights the object.
IlBoolean isInvalid () const
 Returns whether the internal filtered graphic is invalid.
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 setAntialiasingMode (IlvAntialiasingMode mode)
 Sets the anti-aliasing mode of the object.
virtual void setArcMode (IlvArcMode m)
 Sets the arc mode of the object.
virtual void setBackground (IlvColor *c)
 Sets the background color of the object.
virtual void setColorPattern (IlvColorPattern *b)
 Sets the color pattern of the object.
void setDisplayMode (DisplayMode mode)
 Sets the display mode.
virtual void setFillRule (IlvFillRule m)
 Sets the fill rule of the object.
virtual void setFillStyle (IlvFillStyle f)
 Sets the fill style of the object.
void setFilterFlow (IlvFilterFlow *flow)
 Sets the filter flow used.
void setFilterName (const IlString &filter)
 Sets the filter name to be used.
virtual void setFont (IlvFont *f)
 Sets the font of the object.
virtual void setForeground (IlvColor *c)
 Sets the foreground color of the object.
virtual void setGradientPattern (IlvGradientPattern *g)
 Sets the gradient pattern of the object.
void setInternalColor (IlvColor *color)
 Sets the color used internally to compute the mask from the object.
virtual void setLineStyle (IlvLineStyle *style)
 Sets the line style of the object.
virtual void setLineWidth (IlUShort width)
 Sets the line width of the object.
void setMaximumSize (IlUInt size)
 Sets the maximum dimension of the internal bitmap.
virtual void setMode (IlvDrawMode m)
 Sets the drawing mode of the object temporarily.
virtual void setOverwrite (IlBoolean overwrite)
 Sets an overwrite mode that modifies how the drawing member functions operate.
virtual void setPalette (IlvPalette *pal)
 Sets the palette of the object.
virtual void setPattern (IlvPattern *p)
 Sets the pattern of the object.
void setRefreshMode (RefreshMode mode)
 Sets the refresh mode.
virtual void write (IlvOutputFile &) const
 Writes an object description to a file.
virtual IlBoolean zoomable () const
 Checks whether this object is zoomable.

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

This section explains the concept of filtered objects. An IlvFilteredGraphic object is used to reference an IlvGraphic object. The IlvFilteredGraphic renders internally the referenced object, and then applies a bitmap filter on it.

See also:
IlvBitmapFilter, IlvGraphicHandle

Member Enumeration Documentation

This enumeration defines the possible values for the display mode.

See also:
IlvFilteredGraphic::setDisplayMode, IlvFilteredGraphic::getDisplayMode
Enumerator:
DisplayFiltered 

The filtered graphic is displayed. This mode is the default display mode.

DisplayShowThrough 

The referenced graphic is displayed.

This enumeration defines the possible values for the refresh mode.

See also:
IlvFilteredGraphic::setRefreshMode, IlvFilteredGraphic::getRefreshMode
Enumerator:
RefreshOnDemand 

The filtered graphic is recomputed only if requested.

RefreshAlways 

The filtered graphic is recomputed for each transformation request. This is the default refresh mode.


Constructor & Destructor Documentation

IlvFilteredGraphic::IlvFilteredGraphic ( IlvDisplay display,
IlvGraphic object,
const IlString filter = "",
IlBoolean  owner = ((IlBoolean) 0) 
)

Constructor.

Initializes a new IlvFilteredGraphic.

Parameters:
display The display.
object The referenced object.
filter The name of the filter flow to apply.
owner Must be set to IlTrue to make the handle object the owner of the referenced object.
virtual IlvFilteredGraphic::~IlvFilteredGraphic (  )  [virtual]

Destructor.

The destructor releases all the memory used by the instance. It unlocks the filter.


Member Function Documentation

static void IlvFilteredGraphic::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 IlvGraphicHandle.

void IlvFilteredGraphic::applyTransform ( const IlvTransformer t  )  [virtual]

Applies a transformation.

Parameters:
t The transformer that is applied to the referenced graphic object by calling its IlvGraphic::applyTransform member function.

Reimplemented from IlvGraphicHandle.

void IlvFilteredGraphic::boundingBox ( IlvRect bbox,
const IlvTransformer t = 0 
) const [virtual]

Retrieves the bounding box of the graphic object.

Sets bbox, the rectangle reference parameter, to be the bounding box of the object. Since the object can appear within a transformed environment (for example, in a multiview editor), an IlvTransformer object occurs as an optional parameter in order to compute the bounding box in the coordinate system of the transformed environment. When there is no transformation, t is set to 0.

Parameters:
bbox The bounding box to be set.
t A transformer value or 0 if there is no transformation.

Reimplemented from IlvGraphicHandle.

const char* IlvFilteredGraphic::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 IlvGraphicHandle.

void IlvFilteredGraphic::computeBitmapData ( const IlvTransformer t = 0  ) 

Computes the filtered bitmap data.

Parameters:
t The transformer to use.
virtual IlBoolean IlvFilteredGraphic::contains ( const IlvPoint p,
const IlvPoint tp,
const IlvTransformer t = 0 
) const [virtual]

Checks whether a point is in the object.

Checks whether the coordinates are located in the shape of this object. A transformation parameter allows you to use the view's coordinate system for this test.

Parameters:
p The point to be tested.
tp The transformed point obtained by applying the transformer t to the point p.
t A transformer value, or 0 if there is no transformation.
Returns:
IlTrue when the point p lies inside the outline of the object.

Reimplemented from IlvGraphicHandle.

virtual IlvGraphic* IlvFilteredGraphic::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 IlvGraphicHandle.

void IlvFilteredGraphic::draw ( IlvPort dst,
const IlvTransformer t = 0,
const IlvRegion clip = 0 
) const [virtual]

Draws the graphic object.

Draws the object in the given IlvPort using the transformer t which might have the value 0. The clip parameter, which can also be 0, represents the clipping region relative to the transformed object.

Parameters:
dst The destination port.
t The transformer value. If 0, no transformation is performed.
clip The clipping region, or 0 if none.

Reimplemented from IlvGraphicHandle.

virtual IlvClassInfo* IlvFilteredGraphic::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 IlvGraphicHandle.

DisplayMode IlvFilteredGraphic::getDisplayMode (  )  const

Returns the display mode.

Returns:
The display mode.
IlvFilterFlow* IlvFilteredGraphic::getFilterFlow (  )  const

Returns the filter flow used.

Returns:
The filter flow used.
const IlString& IlvFilteredGraphic::getFilterName (  )  const

Returns the name of the filter used.

Returns:
The name of the filter used.
const IlvBitmapData* IlvFilteredGraphic::getInternalBitmapData (  )  const

Returns the internal filtered bitmap data.

Returns:
The internal filtered bitmap data.
IlvColor* IlvFilteredGraphic::getInternalColor (  )  const

Returns the color used internally to compute the mask from the object.

Returns:
The internal color.
IlUInt IlvFilteredGraphic::getMaximumSize (  )  const

Returns the maximum dimension of the internal bitmap.

Returns:
The maximum dimension.
static IlAny IlvFilteredGraphic::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 IlvGraphicHandle.

RefreshMode IlvFilteredGraphic::getRefreshMode (  )  const

Returns the refresh mode.

Returns:
The refresh mode.
static const IlvClassInfo* IlvFilteredGraphic::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 IlvGraphicHandle.

virtual IlBoolean IlvFilteredGraphic::inside ( const IlvRegion r,
const IlvTransformer t = 0 
) const [virtual]

Determines whether an object with transformation applied is inside the bounding box.

Determines whether an object with transformation applied is inside the bounding box.

Parameters:
r The region to be tested.
t A transformer value, or 0 if there is no transformation.
Returns:
IlTrue when the object, drawn with the transformer t, covers completely the region r. This virtual member function returns IlFalse when this is not the case. That means that it returns IlTrue if all rectangles that define the region completely lie inside the object.

Reimplemented from IlvGraphicHandle.

virtual IlBoolean IlvFilteredGraphic::intersects ( const IlvRegion r,
const IlvTransformer t = 0 
) const [virtual]

Checks whether a region intersects the bounding box with transformation applied.

Checks whether a region intersects the bounding box with transformation applied.

Parameters:
r The region to be tested.
t A transformer value, or 0 if there is no transformation.
Returns:
IlTrue when the region r overlaps the transformed object (if t is not 0) and IlFalse when this is not the case.

Reimplemented from IlvGraphicHandle.

virtual void IlvFilteredGraphic::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 IlvGraphicHandle.

IlBoolean IlvFilteredGraphic::isInvalid (  )  const

Returns whether the internal filtered graphic is invalid.

Returns:
IlTrue if the internal filtered graphic is invalid.
IlBoolean IlvFilteredGraphic::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 IlvGraphicHandle.

IlBoolean IlvFilteredGraphic::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 IlvGraphicHandle.

static IlvGraphic* IlvFilteredGraphic::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 IlvGraphicHandle.

static IlBoolean IlvFilteredGraphic::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 IlvGraphicHandle.

static IlBoolean IlvFilteredGraphic::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 IlvGraphicHandle.

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

Sets the anti-aliasing mode of the object.

Parameters:
mode The new anti-aliasing mode.

Reimplemented from IlvGraphicHandle.

virtual void IlvFilteredGraphic::setArcMode ( IlvArcMode  mode  )  [virtual]

Sets the arc mode of the object.

Parameters:
mode The new arc mode.

Reimplemented from IlvGraphicHandle.

virtual void IlvFilteredGraphic::setBackground ( IlvColor background  )  [virtual]

Sets the background color of the object.

Sets the background color of the object.

Parameters:
background The new background color.

Reimplemented from IlvGraphicHandle.

virtual void IlvFilteredGraphic::setColorPattern ( IlvColorPattern pattern  )  [virtual]

Sets the color pattern of the object.

Sets the color pattern of the object.

Parameters:
pattern The new color pattern.

Reimplemented from IlvGraphicHandle.

void IlvFilteredGraphic::setDisplayMode ( DisplayMode  mode  ) 

Sets the display mode.

Parameters:
mode The new display mode.
See also:
DisplayMode.
virtual void IlvFilteredGraphic::setFillRule ( IlvFillRule  rule  )  [virtual]

Sets the fill rule of the object.

Parameters:
rule The new fill rule.

Reimplemented from IlvGraphicHandle.

virtual void IlvFilteredGraphic::setFillStyle ( IlvFillStyle  style  )  [virtual]

Sets the fill style of the object.

Parameters:
style The new fill style.

Reimplemented from IlvGraphicHandle.

void IlvFilteredGraphic::setFilterFlow ( IlvFilterFlow flow  ) 

Sets the filter flow used.

Parameters:
flow The new filter flow.
void IlvFilteredGraphic::setFilterName ( const IlString filter  ) 

Sets the filter name to be used.

Parameters:
filter The new name of the filter.
virtual void IlvFilteredGraphic::setFont ( IlvFont font  )  [virtual]

Sets the font of the object.

Parameters:
font The new font.

Reimplemented from IlvGraphicHandle.

virtual void IlvFilteredGraphic::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 IlvGraphicHandle.

virtual void IlvFilteredGraphic::setGradientPattern ( IlvGradientPattern pattern  )  [virtual]

Sets the gradient pattern of the object.

Sets the gradient pattern of the object.

Parameters:
pattern The new gradient pattern.

Reimplemented from IlvGraphicHandle.

void IlvFilteredGraphic::setInternalColor ( IlvColor color  ) 

Sets the color used internally to compute the mask from the object.

Parameters:
color The new color.
virtual void IlvFilteredGraphic::setLineStyle ( IlvLineStyle style  )  [virtual]

Sets the line style of the object.

Parameters:
style The new line style.

Reimplemented from IlvGraphicHandle.

virtual void IlvFilteredGraphic::setLineWidth ( IlUShort  width  )  [virtual]

Sets the line width of the object.

Parameters:
width The new line width.

Reimplemented from IlvGraphicHandle.

void IlvFilteredGraphic::setMaximumSize ( IlUInt  size  ) 

Sets the maximum dimension of the internal bitmap.

Parameters:
size The maximum dimension.
virtual void IlvFilteredGraphic::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 IlvGraphicHandle.

virtual void IlvFilteredGraphic::setOverwrite ( IlBoolean  over  )  [virtual]

Sets an overwrite mode that modifies how the drawing member functions operate.

Modifies the way the drawing member functions operate. The information is passed to the palette of the graphic object (see the IlvPalette::setOverwrite method for more details).

Parameters:
over If IlFalse, sets selective hidden drawing operations.

Reimplemented from IlvGraphicHandle.

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

Sets the palette of the object.

Each of the graphic properties of this object is then taken from this IlvPalette instance.

Parameters:
palette The palette to be set.

Reimplemented from IlvGraphicHandle.

virtual void IlvFilteredGraphic::setPattern ( IlvPattern pattern  )  [virtual]

Sets the pattern of the object.

Sets the pattern of the object.

Parameters:
pattern The new pattern.

Reimplemented from IlvGraphicHandle.

void IlvFilteredGraphic::setRefreshMode ( RefreshMode  mode  ) 

Sets the refresh mode.

Parameters:
mode The new refresh mode.
See also:
RefreshMode.
virtual void IlvFilteredGraphic::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 IlvGraphicHandle.

virtual IlBoolean IlvFilteredGraphic::zoomable (  )  const [virtual]

Checks whether this object is zoomable.

Returns:
IlTrue if the graphic object can be zoomed, and IlFalse otherwise. See the member functions IsZoomAllowed and AllowZoom below.

Reimplemented from IlvGraphicHandle.

 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.