Rogue Wave Views
Prototypes Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions
IlvGraphicNode Class Reference

Group node encapsulating a graphic object. More...

#include <ilviews/protos/grphnode.h>

Inheritance diagram for IlvGraphicNode:
IlvGroupNode IlvAccessible IlvValueInterface

Public Member Functions

 IlvGraphicNode (IlvGraphic *graphic, const char *name=0, IlBoolean transformed=IlFalse)
 Creates a new graphic node holding a graphic object. 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...
 
IlvContainergetContainer () const
 Returns the container to which the graphic object belongs, or 0 if it does not belong to a container.
 
virtual IlvGraphicgetGraphic () 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...
 
IlvGraphicgetManagedGraphic () const
 Returns the graphic object contained in the manager or the container. More...
 
IlvManagergetManager () 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. More...
 
virtual const char * getName () const
 Returns the name of the group node. More...
 
IlvGraphicgetProtoGraphic () const
 Returns the IlvProtoGraphic object that handles the group containing the node, or 0 if the group is not contained in an IlvProtoGraphic object.
 
IlvGroupgetSubGroup () 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. More...
 
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 IlvValuequeryValue (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 fixed)
 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. 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 IlvGroupNodecopy () const =0
 Returns a copy of the group node. More...
 
IlvGroupgetGroup () 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 IlvValueTypeClassgetValueType (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 IlvValuepullValue (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 IlvGroupNoderead (IlvGroupInputFile &f, IlvDisplay *display)
 Reads a group node from an IlvGroupInputFile. More...
 
- Static Public Member Functions inherited from IlvAccessible
static void DeclareAccessor (const IlSymbol *attr, IlvValueTypeClass *type, const IlSymbol *const **accessors, const IlvValueTypeClass *const **types, IlUInt &count, IlBoolean checkDuplicates=IlFalse, IlAny accessorList=0)
 
static const IlvValueTypeClassGetType (IlSymbol *name)
 Returns the type instance from a name. More...
 
static IlBoolean StringToValue (const char *s, IlSymbol *type, IlvValue &v, IlvDisplay *display)
 Converts the character string s to an IlvValue with the type type. More...
 
static IlBoolean StringToValue (const char *s, const IlvValueTypeClass *typeClass, IlvValue &v, IlvDisplay *d)
 Converts the character string s to an IlvValue with the type type. More...
 
static IlBoolean ValuesAreEqual (IlvValue &v1, IlvValue &v2, IlBoolean compareNames=IlTrue)
 Compares two values. More...
 

Detailed Description

Group node encapsulating a graphic object.

Library: ilvproto

IlvGraphicNode is a subclass of IlvGroupNode designed to include Rogue Wave Views IlvGraphic objects in groups.

Accessors

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.

Constructor & Destructor Documentation

§ IlvGraphicNode()

IlvGraphicNode::IlvGraphicNode ( IlvGraphic graphic,
const char *  name = 0,
IlBoolean  transformed = IlFalse 
)

Creates a new graphic node holding a graphic object.

Parameters
graphicGraphic object to encapsulate in a group node so that it will be handled by an IlvGroup.
nameIf 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.
transformedIf set to IlTrue, the graphic node will use a local transformer to draw the object. For details, see the setTransformed() method.

Member Function Documentation

§ apply()

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:

typedef void (*IlvGraphicNodeApplyFunc)(IlvGraphic* obj,
IlAny arg,
IlvGraphic* transformedObj);

§ changeValue()

virtual IlBoolean IlvGraphicNode::changeValue ( const IlvValue v)
virtual

Changes the object's value. Both the name and the new value are contained in val.

Parameters
vThe value to be set (both name and value).
Returns
Whether the object considered the operation successful or not.

Reimplemented from IlvAccessible.

§ changeValues()

virtual IlBoolean IlvGraphicNode::changeValues ( const IlvValue v,
IlUShort  c 
)
virtual

Changes several values of an object in a single call. The default implementation calls changeValue() for all values.

Parameters
vThe changed values (both name and values).
cThe number of values.
Returns
Whether the object considered the operation successful or not.

Reimplemented from IlvAccessible.

§ getAccessors()

virtual void IlvGraphicNode::getAccessors ( const IlSymbol *const **  a,
const IlvValueTypeClass *const **  t,
IlUInt c 
) const
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.

Parameters
aPointer to an array filled on return with the names of the accessors defined for the object.
tPointer to an array filled on return with the type of each accessor.
cNumber of accessors, set by the method.

Implements IlvAccessible.

§ getBaseLayer()

int IlvGraphicNode::getBaseLayer ( ) const

Returns the base layer of the graphic node.

Returns
The index of the base layer.

§ getInteractor()

const char* IlvGraphicNode::getInteractor ( ) const

Returns the name of the object interactor associated with the graphic object of this node.

See also
IlvInteractor, IlvGraphic::setInteractor(), IlvGraphic::getDefaultInteractor().

§ getLayer()

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()).

§ getManagedGraphic()

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.

§ getMinZoom()

IlFloat IlvGraphicNode::getMinZoom ( ) const

Returns the minimum zoom level of the graphic node.

See also
setFixedSize().

§ getName()

virtual const char* IlvGraphicNode::getName ( ) const
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.

Returns
Name of the group node.

Reimplemented from IlvGroupNode.

§ isFixedSize()

IlBoolean IlvGraphicNode::isFixedSize ( ) const

Returns the fixed size status of the node.

See also
setFixedSize().

§ isHidden()

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.

§ isNode() [1/2]

IlBoolean IlvGraphicNode::isNode ( ) const

Returns IlTrue if the graphic object associated with the graphic node is an IlvGrapher node.

See also
IlvGrapher, IlvGrapher::addNode().

§ isNode() [2/2]

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.

Parameters
isitIf 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.
See also
IlvGrapher, IlvProtoGrapher, IlvGrapherNode.

§ isTransformed()

IlBoolean IlvGraphicNode::isTransformed ( ) const

Returns IlTrue if the node uses a transformed graphic to draw its graphic object.

See also
setTransformed().

§ isVisible()

IlBoolean IlvGraphicNode::isVisible ( ) const

Returns the visibility state of the graphic object in its manager.

See also
IlvManager::setVisible().

§ queryValue()

virtual IlvValue& IlvGraphicNode::queryValue ( IlvValue value) const
virtual

Queries the value designated by value from the object. Both the value and the value type are stored in value.

Parameters
valueThe queried value name.
Returns
The value passed in argument, set to the object value.

Reimplemented from IlvAccessible.

§ setBaseLayer()

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.

Parameters
layerThe layer used as the base layer.

§ setFixedSize()

void IlvGraphicNode::setFixedSize ( IlBoolean  fixed)

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.

Parameters
fixedIndicates whether to use a fixed size transformation.

§ setHidden()

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.

Parameters
hiddenIf IlTrue, the object will be shown in Studio but not in the programs that use the object. Otherwise, it will always be shown.

§ setInteractor()

void IlvGraphicNode::setInteractor ( const char *  name)

Sets the name of the object interactor associated with the graphic object of this node.

Parameters
nameInteractor name.
See also
IlvInteractor, IlvGraphic::setInteractor(), IlvGraphic::getDefaultInteractor().

§ setLayer()

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()).

Parameters
layerThe layer to place the graphic object in.

§ setMaxZoom()

void IlvGraphicNode::setMaxZoom ( IlFloat  zoom)

Sets the maximum zoom level of the graphic node.

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.

See also
setFixedSize().

§ setMinZoom()

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.

Parameters
zoomMinimum zoom level.

§ setName()

virtual void IlvGraphicNode::setName ( const char *  name)
virtual

Sets the name of the node.

A copy of name is stored in the node. This method can be overridden.

Reimplemented from IlvGroupNode.

§ setTransformed()

void IlvGraphicNode::setTransformed ( IlBoolean  transformed,
IlBoolean  editModeChanged = IlFalse 
)

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.

Parameters
transformedSpecifies whether the graphic object should be placed inside an IlvTransformedGraphic to avoid corrupting its coordinates when resizing it.
editModeChangedUsed internally.

§ setVisible()

void IlvGraphicNode::setVisible ( IlBoolean  visible)

Sets the visibility state of the graphic object in its manager.

Parameters
visibleIf IlTrue, the object is made visible, otherwise, it is made invisible.

© Copyright 2017, 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.