Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Default selection object for graphic objects. More...
#include <ilviews/graphics/select.h>
Public Member Functions | |
virtual 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. | |
virtual void | computeRegion (IlvRegion &r, const IlvTransformer *t=0) const |
Returns the region covered by the object. | |
virtual IlvGraphic * | copy () const |
Copies this object. | |
virtual IlvDirection | direction (const IlvPoint &p, const IlvTransformer *t=0) const |
Returns the direction associated to a given point. | |
virtual void | draw (IlvPort *dst, const IlvTransformer *t, const IlvRegion *clip=0) const |
Draws the graphic object. | |
virtual IlvClassInfo * | getClassInfo () const |
Gets class information. | |
virtual IlBoolean | getHandleLocation (IlUInt idx, IlvPoint &p, const IlvTransformer *t) const |
Returns the location of a given selection handle. | |
virtual IlUInt | getHandlesCount (const IlvTransformer *t=0) const |
Returns the number of selection handles. | |
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 IlUInt | whichHandle (const IlvPoint &p, const IlvTransformer *t=0) const |
Returns the selection handle containing a given point. | |
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 IlvClassInfo * | HasProperty (const IlSymbol *key, IlBoolean p=((IlBoolean) 0)) |
Checks for the existence of a property for this object's class hierarchy. | |
static IlvGraphic * | read (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. |
Default selection object for graphic objects.
Library: views
IlvReshapeSelection
instances draw eight selection handles around the bounding box of a selected object. These handles are used to resize the selected object in a given direction. The figure below shows the IlvDirection
value for each of the handles.
IlvGraphicHandle
.
- IlvDrawSelection -
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.
key | The key to be associated. | |
value | The value to be associated. |
Reimplemented from IlvDrawSelection.
virtual void IlvReshapeSelection::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
.
bbox | The bounding box to be set. | |
t | A transformer value or 0 if there is no transformation. |
Reimplemented from IlvDrawSelection.
const char* IlvReshapeSelection::className | ( | ) | const |
Returns the class name of an object.
This method is equivalent to getClassInfo()->getClassName()
.
IlvRectangle
object, the className function returns "IlvRectangle"
. Reimplemented from IlvDrawSelection.
virtual void IlvReshapeSelection::computeRegion | ( | IlvRegion & | r, | |
const IlvTransformer * | t = 0 | |||
) | const [virtual] |
Returns the region covered by the object.
This method returns in region the region that covers the selection object if it is displayed with the transformer t. The default implementation fills the region with the rectangles returned by the IlvDrawSelection::getHandleRect
method for each selection handle.
r | The returned region. | |
t | The transformer applied to this object. |
Reimplemented from IlvDrawSelection.
virtual IlvGraphic* IlvReshapeSelection::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.
IlvPredefinedIOMembers
. Implements IlvGraphic.
virtual IlvDirection IlvReshapeSelection::direction | ( | const IlvPoint & | p, | |
const IlvTransformer * | t = 0 | |||
) | const [virtual] |
Returns the direction associated to a given point.
Returns the direction associated to the selection handles containing the point p. This method is used to assign a resizing behavior to selection handles. The default implementation returns IlvBadPosition
.
p | The considered point. | |
t | The transformer applied to this object. |
IlvBadPosition
if p doesn't lie in any of the selection handle. IlvReshapeSelection
. Reimplemented from IlvDrawSelection.
virtual void IlvReshapeSelection::draw | ( | IlvPort * | dst, | |
const IlvTransformer * | t, | |||
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.
dst | The destination port. | |
t | The transformer value. If 0, no transformation is performed. | |
clip | The clipping region, or 0 if none. |
Reimplemented from IlvDrawSelection.
virtual IlvClassInfo* IlvReshapeSelection::getClassInfo | ( | ) | const [virtual] |
Gets class information.
Returns a pointer to the IlvClassInfo
object associated with this object's class.
Reimplemented from IlvDrawSelection.
virtual IlBoolean IlvReshapeSelection::getHandleLocation | ( | IlUInt | idx, | |
IlvPoint & | p, | |||
const IlvTransformer * | t | |||
) | const [virtual] |
Returns the location of a given selection handle.
This method must be redefined in subclasses.
idx | The index of the considered handle. | |
p | The returned point. | |
t | The transformer applied to the object. |
IlTrue
if idx is a valid index and IlFalse
otherwise. Implements IlvDrawSelection.
virtual IlUInt IlvReshapeSelection::getHandlesCount | ( | const IlvTransformer * | t = 0 |
) | const [virtual] |
Returns the number of selection handles.
This method must be redefined in subclasses.
t | The transformer applied to the object. |
Implements IlvDrawSelection.
static IlAny IlvReshapeSelection::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.
key | The key with which the property value is associated. | |
checkSuperClass | IlTrue specifies iterative search on superclasses. |
0
. Reimplemented from IlvDrawSelection.
static const IlvClassInfo* IlvReshapeSelection::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.
key | The key with which the property value is associated. | |
checkSuperClass | IlTrue specifies iterative search on superclasses. |
0
. Reimplemented from IlvDrawSelection.
IlBoolean IlvReshapeSelection::isSubtypeOf | ( | const IlvClassInfo * | classInfo | ) | const |
Checks whether this object's class is a subclass.
This method is equivalent to getClassInfo()->isSubtypeOf(classInfo)
.
classInfo | The name of a class on which the object's class is tested. |
IlTrue
or IlFalse
, depending on whether or not this object's class is a subclass of the class indicated by classInfo. Reimplemented from IlvDrawSelection.
IlBoolean IlvReshapeSelection::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)
.
parentClass | A string representing the parent class. |
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 IlvDrawSelection.
static IlvGraphic* IlvReshapeSelection::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); }
file | The name of the file to be read from. | |
palette | The name of the palette for the object. |
DeclareTypeInfoRO
, DeclareTypeInfo
, IlvPredefinedIOMembers
. read
method is not capitalized like other static methods so that it is consistent with the write
method. Reimplemented from IlvGraphic.
Removes a property from this object's class.
This static function removes the indicated property to the class of this object.
key | The key property to be removed. |
IlTrue
if the key property was actually found, or IlFalse
otherwise. Reimplemented from IlvDrawSelection.
static IlBoolean IlvReshapeSelection::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.
key | The key to be replaced. | |
value | The value to be replaced. |
IlTrue
if the key property was actually found, or IlFalse
otherwise. Reimplemented from IlvDrawSelection.
virtual IlUInt IlvReshapeSelection::whichHandle | ( | const IlvPoint & | p, | |
const IlvTransformer * | t = 0 | |||
) | const [virtual] |
Returns the selection handle containing a given point.
p | The considered point. | |
t | The transformer applied to the object. |
IlvBadIndex
if it does not lie in any of the handle. Reimplemented from IlvDrawSelection.
© 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.