Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Group node encapsulating a graphic object. More...
#include <ilviews/protos/grphnode.h>
Public Member Functions | |
IlvGraphicNode (IlvGraphic *graphic, const char *name=0, IlBoolean transformed=IlFalse) | |
Creates a new graphic node holding the graphic object graphic. More... | |
void | apply (IlvGraphicNodeApplyFunc func, IlAny arg, IlBoolean redraw=IlTrue, IlBoolean local=IlFalse) |
Applies a change to a graphic node. More... | |
virtual IlBoolean | changeValue (const IlvValue &val) |
Changes the object's value. Both the name and the new value are contained in val. More... | |
virtual IlBoolean | changeValues (const IlvValue *values, IlUShort count) |
Changes several values of an object in a single call. The default implementation calls changeValue for all values. More... | |
virtual void | getAccessors (const IlSymbol *const **accessors, const IlvValueTypeClass *const **types, IlUInt &count) const |
Returns the names of all the accessors known by this object. More... | |
int | getBaseLayer () const |
Returns the base layer of the graphic node. More... | |
IlvContainer * | getContainer () const |
Returns the container to which the graphic object belongs, or 0 if it does not belong to a container. | |
virtual IlvGraphic * | getGraphic () const |
Returns the IlvGraphic object associated with this graphic node. | |
const char * | getInteractor () const |
Returns the name of the object interactor associated with the graphic object of this node. More... | |
int | getLayer () const |
Returns the manager layer to which the graphic object belongs, or -1 if the object is not in a manager. More... | |
IlvGraphic * | getManagedGraphic () const |
Returns the graphic object contained in the manager or the container. More... | |
IlvManager * | getManager () const |
Returns the manager to which the graphic object belongs, or 0 if it does not belong to a manager. | |
IlFloat | getMaxZoom () const |
Returns the maximum zoom level of the graphic node (see setFixedSize ). | |
IlFloat | getMinZoom () const |
Returns the minimum zoom level of the graphic node (see setFixedSize ). | |
virtual const char * | getName () const |
Returns the name of the group node. More... | |
IlvGraphic * | getProtoGraphic () const |
Returns the IlvProtoGraphic object that handles the group containing the node, or 0 if the group is not contained in an IlvProtoGraphic object. | |
IlvGroup * | getSubGroup () const |
Returns the subgroup contained in this node if the node contains an IlvSubGroup . Otherwise, it returns 0 . | |
IlBoolean | isFixedSize () const |
Returns the fixed size status of the node (see setFixedSize ). | |
IlBoolean | isHidden () const |
Returns the hidden state of the node. More... | |
IlBoolean | isNode () const |
Returns IlTrue if the graphic object associated with the graphic node is an IlvGrapher node. More... | |
void | isNode (IlBoolean isit) |
Specifies that the object is to be made an IlvGrapher node when the graphic object is placed in an IlvGrapher . More... | |
IlBoolean | isTransformed () const |
Returns IlTrue if the node uses a transformed graphic to draw its graphic object. More... | |
IlBoolean | isVisible () const |
Returns the visibility state of the graphic object in its manager. More... | |
virtual IlvValue & | queryValue (IlvValue &val) const |
Queries the value designated by value from the object. Both the value and the value type are stored in value. More... | |
void | reDraw () |
Redraws the graphic object associated with this node if it is contained in a manager. | |
void | setBaseLayer (int layer) |
Sets the base layer of the graphic node. More... | |
void | setFixedSize (IlBoolean isit) |
Controls the way the graphic node is displayed when the transformer of the view in which the group is displayed changes. More... | |
void | setHidden (IlBoolean hidden) |
Sets the hidden state of the node. More... | |
void | setInteractor (const char *name) |
Sets the name of the object interactor associated with the graphic object of this node. More... | |
void | setLayer (int layer) |
Moves the graphic object to the specified manager layer. More... | |
void | setMaxZoom (IlFloat zoom) |
Sets the maximum zoom level of the graphic node (see setFixedSize ). More... | |
void | setMinZoom (IlFloat zoom) |
Sets the minimum zoom level of the graphic node (see setFixedSize). More... | |
virtual void | setName (const char *name) |
Sets the name of the node. More... | |
void | setTransformed (IlBoolean transformed, IlBoolean editModeChanged=IlFalse) |
Makes the node a transformed graphic node. More... | |
void | setVisible (IlBoolean visible) |
Sets the visibility state of the graphic object in its manager. More... | |
Public Member Functions inherited from IlvGroupNode | |
IlvGroupNode (const char *name=0) | |
Creates a new group node with the provided name. More... | |
virtual IlvGroupNode * | copy () const =0 |
Returns a copy of the group node. More... | |
IlvGroup * | getGroup () const |
Returns the group containing this group node, or 0 if the node has not yet been added to a group. | |
const char * | getPath () |
Returns the fully qualified path name of the node with respect to its top level group. More... | |
virtual void | write (IlvGroupOutputFile &f) const |
Writes the group node to an IlvGroupOutputFile . More... | |
Public Member Functions inherited from IlvAccessible | |
virtual IlUInt | compareAllValues (const IlvAccessible *ref, IlvValueArray &diffs, IlBoolean any=IlFalse) const |
Compares two objects and returns the differing attributes. More... | |
virtual IlUInt | compareValues (const IlvAccessible *ref, IlvValue *values, IlUShort count, IlvValueArray &diffs) const |
Compares two objects and returns the differing attributes. More... | |
virtual IlBoolean | convertValues (IlvValue *v, IlUShort c, IlvDisplay *d) const |
Convert values to match the types defined by the object accessors. More... | |
IlUInt | getSubscriptions (IlvAccessible *subscriber, IlSymbol **&sourceValue, IlSymbol **&subscriberValue, IlvValueTypeClass **&type, IlvValueSubscriptionMode *&mode, IlvAccessible ***subscribers=0) const |
Returns alls subscriptions made by subscriber. More... | |
virtual const IlvValueTypeClass * | getValueType (const IlSymbol *s) const |
Returns the type of a given attribute. More... | |
virtual IlBoolean | isOutputValue (const IlSymbol *value) const |
Indicates whether value designates an accessor that can generate notifying values. More... | |
virtual IlvValue & | pullValue (IlvValue &v) const |
See below. | |
virtual void | pullValues (IlvValue *vals, IlUShort c) const |
Propagates value queries to the subscribers to this object. More... | |
virtual IlBoolean | pushValue (const IlvValue &v) const |
See below. | |
virtual IlBoolean | pushValues (const IlvValue *vals, IlUShort c) const |
Propagates value changes to the subscribers to this object. More... | |
virtual void | queryValues (IlvValue *v, IlUShort c) const |
Queries several values in a single call. The default implementation calls queryValue for each value. More... | |
virtual void | subscribe (IlvAccessible *subscriber, IlSymbol *sourceValue, IlSymbol *subscriberValue, IlvValueTypeClass *type, IlvValueSubscriptionMode mode=IlvValueSubscriptionChange) |
Subscribes the subscriber object to the value sourceValue of this object. More... | |
virtual void | unSubscribe (IlvAccessible *subscriber, IlSymbol *sourceValue=0, IlSymbol *subscriberValue=0) |
Cancels subscriptions previously made. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from IlvGroupNode | |
static IlvGroupNode * | read (IlvGroupInputFile &f, IlvDisplay *display) |
Reads a group node from an IlvGroupInputFile . More... | |
Group node encapsulating a graphic object.
Library: ilvproto
IlvGraphicNode
is a subclass of IlvGroupNode
designed to include Rogue Wave Views IlvGraphic
objects in groups.
The following table shows the accessors defined by the IlvGraphicNode
class, and their associated types. Note that these accessors can be applied to either a particular graphic node, or to a whole group. When a value is changed for a whole group, it is changed for all its individual subgroups and graphic nodes.
Accessor | Type | Description |
manager | IlAny | When used on a group, these values change or query the corresponding values for all the group nodes. |
layer | IlInt | When used on a group, these values change or query the corresponding values for all the group nodes. |
baseLayer | IlInt | Sets/gets the base layer of the graphic node or the group. |
visible | IlBoolean | When used on a group, these values change or query the corresponding values for all the group nodes. |
transformer | IlvTransformer | When used on a group, these values change or query the corresponding values for all the group nodes. |
x, y | IlInt | Sets/gets the position of the bounding box of all the graphic nodes contained in the group. When the x and/or y values are changed, all the graphic objects are moved together so that the new bounding box is at the designated position. |
width, height | IlUInt | Gets the size of the bounding box of all the graphic nodes contained in the group. These values cannot be changed: use the transformer value to change the size of a group. |
centerX, centerY | IlUInt | Gets the center of the group bounding box. |
interactor | IlAny | Sets/gets the interactor of the graphic object. |
IlvGraphicNode::IlvGraphicNode | ( | IlvGraphic * | graphic, |
const char * | name = 0 , |
||
IlBoolean | transformed = IlFalse |
||
) |
Creates a new graphic node holding the graphic object graphic.
graphic | Graphic object to encapsulate in a group node so that it will be handled by an IlvGroup . |
name | If non-null, it is stored as the node name. Otherwise, if the graphic object has a name, this name is used as the node name. Otherwise, the class name of the graphic object is used. |
transformed | If set to IlTrue , the graphic node will use a local transformer to draw the object. For details, see the setTransformed method. |
void IlvGraphicNode::apply | ( | IlvGraphicNodeApplyFunc | func, |
IlAny | arg, | ||
IlBoolean | redraw = IlTrue , |
||
IlBoolean | local = IlFalse |
||
) |
Applies a change to a graphic node.
This method calls the applyToObject
method of the container manager that includes the graphic object associated with the node. If redraw is IlTrue
, the object is redrawn. The func parameter has the following signature:
Changes the object's value. Both the name and the new value are contained in val.
v | The value to be set (both name and value). |
Reimplemented from IlvAccessible.
Changes several values of an object in a single call. The default implementation calls changeValue
for all values.
v | The changed values (both name and values). |
c | The number of values. |
Reimplemented from IlvAccessible.
|
virtual |
Returns the names of all the accessors known by this object.
Subclasses of IlvAccessible
must override this method by calling the static method DeclareAccessor
for each accessor handled by the subclass. The returned arrays are filled by the method and must not be freed.
a | Pointer to an array filled on return with the names of the accessors defined for the object. |
t | Pointer to an array filled on return with the type of each accessor. |
c | Number of accessors, set by the method. |
Implements IlvAccessible.
int IlvGraphicNode::getBaseLayer | ( | ) | const |
Returns the base layer of the graphic node.
const char* IlvGraphicNode::getInteractor | ( | ) | const |
Returns the name of the object interactor associated with the graphic object of this node.
int IlvGraphicNode::getLayer | ( | ) | const |
Returns the manager layer to which the graphic object belongs, or -1
if the object is not in a manager.
The layer index returned is the relative layer, that is, the manager layer minus the base layer (see setBaseLayer
).
IlvGraphic* IlvGraphicNode::getManagedGraphic | ( | ) | const |
Returns the graphic object contained in the manager or the container.
This graphic object is the one passed to the constructor, or to an IlvTransformedGraphic
containing the graphic object if the node is transformed.
|
virtual |
Returns the name of the group node.
If a name was explicitly specified when the node was created, or if the setName method was called, this name is returned. Otherwise, a subclass-dependent method is used to find a default node name.
Reimplemented from IlvGroupNode.
IlBoolean IlvGraphicNode::isHidden | ( | ) | const |
Returns the hidden state of the node.
Hidden nodes are visible during editing in Studio, but they are hidden in the final application.
IlBoolean IlvGraphicNode::isNode | ( | ) | const |
Returns IlTrue
if the graphic object associated with the graphic node is an IlvGrapher
node.
void IlvGraphicNode::isNode | ( | IlBoolean | isit | ) |
Specifies that the object is to be made an IlvGrapher
node when the graphic object is placed in an IlvGrapher
.
isit | If IlTrue , the graphic object associated with the graphic node will become an IlvGrapher node when it is added to an IlvGrapher . This means that the addNode method of the IlvGrapher will be called instead of the addObject method of the IlvManager . |
IlBoolean IlvGraphicNode::isTransformed | ( | ) | const |
Returns IlTrue
if the node uses a transformed graphic to draw its graphic object.
IlBoolean IlvGraphicNode::isVisible | ( | ) | const |
Returns the visibility state of the graphic object in its manager.
Queries the value designated by value from the object. Both the value and the value type are stored in value.
value | The queried value name. |
Reimplemented from IlvAccessible.
void IlvGraphicNode::setBaseLayer | ( | int | layer | ) |
Sets the base layer of the graphic node.
The base layer is used as an offset and is added to the node layer set by setLayer
when the graphic object is added to a manager. For example, you can move a whole group two layers up by adding 2 to its current base layer. The graphic nodes of the group will keep their relative layer positions.
layer | The layer used as the base layer. |
void IlvGraphicNode::setFixedSize | ( | IlBoolean | isit | ) |
Controls the way the graphic node is displayed when the transformer of the view in which the group is displayed changes.
If fixed is IlTrue
, the graphic node will zoom only between the zoom factors defined by the methods setMinZoom
and setMaxZoom
. If the scale factor of the view transformer is greater than the maximum zoom, the graphic node is displayed at the size corresponding to the maximum zoom. Similarly, if the scale factor of the view transformer is less than the minimum zoom, the node is displayed at the size corresponding to the minimum zoom. The position of the node, however, is always computed according to the actual view transformer. In other words, when you zoom in on a view, fixed size nodes keep the same size, but they move away from each other. When you zoom out, they move closer to each other. The positions of the node are computed based on the center of their group, so that the graphic nodes of a group always "stay together". If the minimum zoom is 0
, the node will stop zooming in at the maximum zoom, but it zooms out normally. Inversely, if the maximum zoom is 0
, the node stops zooming out at the minimum but it zooms in normally. If the minimum and maximum zoom are both 0
, the node does not zoom at all: it always keeps its untransformed size. If fixed is IlFalse
and the minimum or maximum zooms are not 0
, the graphic node disappears when the minimum or maximum zoom is exceeded, instead of keeping its size. If fixed is IlFalse
and the minimum and maximum zoom are both 0
, the node zooms normally, regardless of what the view transformer is (this is the default).
This behavior is effective only for transformed graphic nodes (that is, if setTransformer(IlTrue)
was called). You can call setFixedSize
, setMinZoom
, and setMaxZoom
for non-transformed nodes, but the node will behave as explained above only when setTransformed(IlTrue)
is called.
fixed | Indicates whether to use a fixed size transformation. |
void IlvGraphicNode::setHidden | ( | IlBoolean | hidden | ) |
Sets the hidden state of the node.
Hidden nodes are visible during editing in Studio, but they are hidden in the final application.
hidden | If IlTrue , the object will be shown in Studio but not in the programs that use the object. Otherwise, it will always be shown. |
void IlvGraphicNode::setInteractor | ( | const char * | name | ) |
Sets the name of the object interactor associated with the graphic object of this node.
name | Interactor name. |
void IlvGraphicNode::setLayer | ( | int | layer | ) |
Moves the graphic object to the specified manager layer.
If the graphic object has not yet been added to a manager, the layer value is stored until the manager is specified using setManager
, at which time the specified layer will be used. The layer index is considered a relative layer, that is, it will be added to the base layer when the object is added to a manager (see setBaseLayer
).
layer | The layer to place the graphic object in. |
void IlvGraphicNode::setMaxZoom | ( | IlFloat | zoom | ) |
Sets the maximum zoom level of the graphic node (see setFixedSize
).
1.0
is the default zoom level in all views. When the user zooms in on the view, the zoom level of the view increases beyond 1.0
. When the zoom level of the current view reaches the object zoom level, the visible size of the object no longer increases.
void IlvGraphicNode::setMinZoom | ( | IlFloat | zoom | ) |
Sets the minimum zoom level of the graphic node (see setFixedSize).
1.0
is the default zoom level in all views. When the user zooms out on the view, the zoom level of the view decreases below 1.0
. When the zoom level of the current view reaches the object zoom level, the visible size of the object no longer decreases.
zoom | Minimum zoom level. |
|
virtual |
Sets the name of the node.
A copy of name is stored in the node. This method can be overridden.
Reimplemented from IlvGroupNode.
Makes the node a transformed graphic node.
Transformed graphic nodes are used to ensure that groups can be arbitrarily resized without corrupting the geometry of the graphic objects they contain. In a transformed node, the graphic object added to the manager or the container is not the graphic passed to the constructor, but a transformed graphic object that references it.
transformed | Specifies whether the graphic object should be placed inside an IlvTransformedGraphic to avoid corrupting its coordinates when resizing it. |
editModeChanged | Used internally. |
void IlvGraphicNode::setVisible | ( | IlBoolean | visible | ) |
Sets the visibility state of the graphic object in its manager.
visible | If IlTrue , the object is made visible, otherwise, it is made invisible. |
© 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.