rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Prototypes Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvGraphicNode Class Reference

Group node encapsulating a graphic object. More...

#include <ilviews/protos/grphnode.h>

Inheritance diagram for IlvGraphicNode:
IlvGroupNode IlvAccessible

List of all members.

Public Member Functions

 IlvGraphicNode (IlvGraphic *graphic, const char *name=0, IlBoolean transformed=IlFalse)
 Creates a new graphic node holding the graphic object graphic.
void apply (IlvGraphicNodeApplyFunc func, IlAny arg, IlBoolean redraw=IlTrue, IlBoolean local=IlFalse)
 Applies a change to a graphic node.
virtual IlBoolean changeValue (const IlvValue &val)
 Changes the object's value. Both the name and the new value are contained in val.
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.
virtual IlvGroupNodecopy () const
 Returns a copy of the group node.
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.
int getBaseLayer () const
 Returns the base layer of the graphic node.
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.
int getLayer () const
 Returns the manager layer to which the graphic object belongs, or -1 if the object is not in a manager.
IlvGraphicgetManagedGraphic () const
 Returns the graphic object contained in the manager or the container.
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 (see setFixedSize).
virtual const char * getName () const
 Returns the name of the group node.
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 (see setFixedSize).
IlBoolean isHidden () const
 Returns the hidden state of the node.
void isNode (IlBoolean isit)
 Specifies that the object is to be made an IlvGrapher node when the graphic object is placed in an IlvGrapher.
IlBoolean isNode () const
 Returns IlTrue if the graphic object associated with the graphic node is an IlvGrapher node.
IlBoolean isTransformed () const
 Returns IlTrue if the node uses a transformed graphic to draw its graphic object.
IlBoolean isVisible () const
 Returns the visibility state of the graphic object in its manager.
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.
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.
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.
void setHidden (IlBoolean hidden)
 Sets the hidden state of the node.
void setInteractor (const char *name)
 Sets the name of the object interactor associated with the graphic object of this node.
void setLayer (int layer)
 Moves the graphic object to the specified manager layer.
void setMaxZoom (IlFloat zoom)
 Sets the maximum zoom level of the graphic node (see setFixedSize).
void setMinZoom (IlFloat zoom)
 Sets the minimum zoom level of the graphic node (see setFixedSize).
virtual void setName (const char *name)
 Sets the name of the node.
void setTransformed (IlBoolean transformed, IlBoolean editModeChanged=IlFalse)
 Makes the node a transformed graphic node.
void setVisible (IlBoolean visible)
 Sets the visibility state of the graphic object in its manager.
virtual void write (IlvGroupOutputFile &) const
 Writes the group node to an IlvGroupOutputFile.

Static Public Member Functions

static IlvGroupNoderead (IlvGroupInputFile &, IlvDisplay *)
 Reads a group node from an IlvGroupInputFile.

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 ( IlvGraphic graphic,
const char *  name = 0,
IlBoolean  transformed = IlFalse 
)

Creates a new graphic node holding the graphic object graphic.

Parameters:
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.

Member Function Documentation

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);
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:
v The value to be set (both name and value).
Returns:
Whether the object considered the operation successful or not.

Reimplemented from IlvAccessible.

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:
v The changed values (both name and values).
c The number of values.
Returns:
Whether the object considered the operation successful or not.

Reimplemented from IlvAccessible.

virtual IlvGroupNode* IlvGraphicNode::copy (  )  const [virtual]

Returns a copy of the group node.

Should be implemented by subclasses. Whether the data they hold is shared is left to the implementation.

Returns:
A copy of the group node.

Implements IlvGroupNode.

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:
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.

Returns:
The index of the base layer.
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.
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 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.

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.

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:
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.
See also:
IlvGrapher, IlvProtoGrapher, IlvGrapherNode.
IlBoolean IlvGraphicNode::isNode (  )  const

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

See also:
IlvGrapher, IlvGrapher::addNode.
IlBoolean IlvGraphicNode::isTransformed (  )  const

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

See also:
setTransformed
IlBoolean IlvGraphicNode::isVisible (  )  const

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

See also:
IlvManager::setVisible
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:
value The queried value name.
Returns:
The value passed in argument, set to the object value.

Reimplemented from IlvAccessible.

static IlvGroupNode* IlvGraphicNode::read ( IlvGroupInputFile f,
IlvDisplay display 
) [static]

Reads a group node from an IlvGroupInputFile.

Parameters:
f Group input file allowing the information describing the group to be read.
display Display used to initialize graphic objects contained in the group node.
Returns:
A group node if read was successful, and 0 otherwise.

Reimplemented from IlvGroupNode.

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:
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.

Parameters:
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.

Parameters:
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.

Parameters:
name Interactor name.
See also:
IlvInteractor, IlvGraphic::setInteractor, IlvGraphic::getDefaultInteractor.
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:
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.

Parameters:
zoom Minimum zoom level.
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.

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:
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.

Parameters:
visible If IlTrue, the object is made visible, otherwise, it is made invisible.
virtual void IlvGraphicNode::write ( IlvGroupOutputFile f  )  const [virtual]

Writes the group node to an IlvGroupOutputFile.

Must be overridden by subclasses to save specific information.

Parameters:
f Group output file holding reference information on the group being read.

Reimplemented from IlvGroupNode.

 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.