rwlogo

Rogue Wave Views
Graph Layout Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator
List of all members | Public Member Functions | Protected Member Functions
IlvGrapherAdapter Class Reference

An IlvGrapherAdapter encapsulates an IlvGrapher and provides a bridge between the API of the IlvGrapher and the API of the IlvGraphModel. More...

#include <ilviews/layout/gphadapt.h>

Inheritance diagram for IlvGrapherAdapter:
IlvGraphModel

Public Member Functions

 IlvGrapherAdapter (IlvGrapher *grapher)
 Creates a new grapher adapter for a given IlvGrapher. More...
 
virtual ~IlvGrapherAdapter ()
 Destructor.
 
void addLayer (IlvManagerLayer *layer)
 Adds a manager layer to the list of layers to be used during the layout. More...
 
void boundingBox (IlAny nodeOrLink, IlvRect &rect)
 Updates the rect argument with the bounding box of a node or a link in manager coordinates. More...
 
void ensureReshapeableLinks (IlvGraphLayout *layout)
 Ensures that all the links in the grapher can be reshaped to a polyline shape. More...
 
void ensureStraightLineLinks (IlvGraphLayout *layout)
 Ensures that all the links in the grapher can be reshaped to straight-line links. More...
 
IlvLayoutGraphicFiltergetFilter () const
 Returns the filter, if any. Returns 0 otherwise. More...
 
IlvMgrViewgetFirstManagerView () const
 Returns the first manager view attached to the encapsulated IlvGrapher if any, and null otherwise.
 
IlAny getFrom (IlAny link)
 Returns the origin node of a link. More...
 
IlvGraphergetGrapher () const
 Returns the IlvGrapher encapsulated by the adapter.
 
const IlArray & getLayers () const
 Returns an enumeration of the manager layers to be taken into account during the layout. More...
 
IlvPoint getLinkPointAt (IlAny link, IlUInt index)
 Returns the point of a link at a specified index. More...
 
IlvPointgetLinkPoints (IlAny link, IlUInt &count)
 Returns the points that define a link. More...
 
IlInt getLinkPointsCount (IlAny link)
 Returns the number of points of a link. More...
 
IlListgetLinks ()
 Returns an enumeration of the links. More...
 
IlListgetLinks (IlAny node)
 Returns an enumeration of all the links that have node as their origin or destination. More...
 
IlUInt getLinksCountOf (IlAny node)
 Returns the number of links adjacent to node. More...
 
IlListgetLinksFrom (IlAny node)
 Returns an enumeration of all the links that have node as their origin. More...
 
IlUInt getLinksFromCount (IlAny node)
 Returns the number of links that have node as their origin. More...
 
IlListgetLinksTo (IlAny node)
 Returns an enumeration of all the links that have node as their destination. More...
 
IlUInt getLinksToCount (IlAny node)
 Returns the number of links that have node as their origin. More...
 
IlUInt getLinkWidth (IlAny link)
 Returns the width of the link. More...
 
virtual const char * getMessage (const char *msg) const
 Returns the message string associated with the message identifier msg. More...
 
IlListgetNeighbors (IlAny node)
 Returns an enumeration of all the nodes that are the "neighbors" of node; in other words, the nodes that have a common link with node. More...
 
virtual IlListgetNodes ()
 Returns an enumeration of the nodes. More...
 
IlListgetNodesAndLinks ()
 Returns an enumeration of the nodes and links. More...
 
IlAny getOpposite (IlAny link, IlAny node)
 Returns the opposite node of a link.
 
IlAny getProperty (IlAny nodeOrLink, const char *key)
 Returns the value of a property. More...
 
IlvTransformergetReferenceTransformer ()
 Returns the transformer to be taken into account. More...
 
virtual IlvMgrViewgetReferenceView () const
 Returns the specified reference view (if any). More...
 
IlAny getTo (IlAny link)
 Returns the destination node of a link. More...
 
IlBoolean hasProperty (IlAny nodeOrLink, const char *key)
 Returns IlTrue if the property exists and IlFalse otherwise. More...
 
IlBoolean isLink (IlAny obj)
 Returns IlTrue if an object is a valid link and IlFalse otherwise. More...
 
IlBoolean isLinkBetween (IlAny node1, IlAny node2)
 Tests whether a link exists between two nodes.
 
IlBoolean isNode (IlAny obj)
 Returns IlTrue if an object is a valid node and IlFalse otherwise. More...
 
void moveNode (IlAny node, IlInt x, IlInt y, IlBoolean reDraw)
 Changes the position of the specified node. The x and y coordinates correspond to the top-left corner of the rectangle that defines the node. More...
 
IlBoolean removeAllLayers ()
 Removes all manager layers from the list of layers to be used during the layout. More...
 
IlBoolean removeLayer (IlvManagerLayer *layer)
 Removes a manager layer from the list of layers to be used during the layout. More...
 
void reshapeLink (IlAny link, IlvPoint fromPoint, IlvPoint *points, IlUInt startIndex, IlUInt length, IlvPoint toPoint, IlBoolean reDraw)
 Reshapes all the points of a link, including the connection points on the origin and destination nodes. More...
 
void setFilter (IlvLayoutGraphicFilter *filter)
 Allows you to specify a filter on the nodes and links. More...
 
void setProperty (IlAny nodeOrLink, const char *key, IlAny value)
 Sets the value of a property for a node or a link. More...
 
void setReferenceTransformer (IlvTransformer *t)
 Allows you to specify the reference transformer. More...
 
virtual void setReferenceView (IlvMgrView *view=0)
 Allows you to specify the reference manager view. More...
 
- Public Member Functions inherited from IlvGraphModel
 IlvGraphModel ()
 Creates a new IlvGraphModel.
 
void geometryChanged (IlBoolean)
 Notifies the graph model that the geometry of the graph has changed (nodes or links were moved or reshaped). More...
 
virtual IlUInt getLinksCount ()
 Returns the number of links. More...
 
virtual IlUInt getNodeDegree (IlAny node)
 Returns the degree of a node, that is, the number of neighbors that the node has. More...
 
virtual IlUInt getNodesCount ()
 Returns the number of nodes. More...
 
const char * getUniqueName (const char *=0)
 Method to be used everywhere in the package to choose names for properties that must be unique for a given graph model instance.
 
void structureChanged (IlBoolean)
 Notifies the graph-model-event listeners that the topology of the graph has changed (nodes or links were added or removed). More...
 

Protected Member Functions

void afterAnimationStep ()
 Notifies the grapher adapter that a layout animation step has finished. More...
 
void afterLayout (IlvGraphLayout *layout, IlvGraphLayoutReport *layoutReport, IlBoolean reDraw)
 Notifies the grapher adapter that a layout session has finished. More...
 
void beforeAnimationStep ()
 Notifies the grapher adapter that a layout animation step has been started. More...
 
void beforeLayout (IlvGraphLayout *layout, IlBoolean redraw)
 Notifies the grapher adapter that a layout session has been started. More...
 

Detailed Description

An IlvGrapherAdapter encapsulates an IlvGrapher and provides a bridge between the API of the IlvGrapher and the API of the IlvGraphModel.

Library: ilvlayout

IlvGrapherAdapter is a concrete subclass of IlvGraphModel that allows an IlvGrapher to be laid out using the layout algorithms provided in Rogue Wave Views. It provides an implementation for all the abstract methods of IlvGraphModel. It also provides overridden implementations of some non-abstract methods of IlvGraphModel in order to improve the efficiency by taking advantage of the particularities of the IlvGrapher.

If an application uses the class IlvGrapher, the grapher can be attached directly to the layout instance without explicitly using a graph model (see the method IlvGraphLayout::attach(IlvGrapher*)). In this case, an IlvGrapherAdapter will be internally created. This adapter can be retrieved using the method IlvGraphLayout::getGraphModel(), which will return an instance of IlvGrapherAdapter.

Constructor & Destructor Documentation

IlvGrapherAdapter::IlvGrapherAdapter ( IlvGrapher grapher)

Creates a new grapher adapter for a given IlvGrapher.

Parameters
grapherThe Rogue Wave Views grapher.

Member Function Documentation

void IlvGrapherAdapter::addLayer ( IlvManagerLayer layer)

Adds a manager layer to the list of layers to be used during the layout.

If you do not call this method, all the layers of the grapher are taken into account. Note that, in this case, getLayers() returns an empty array.

Parameters
layerThe layer to be added.
Returns
IlTrue if the layer is in the list of layers to be used; IlFalse if the layer is not in the list of layers or if the list of layers is empty.
See Also
removeLayer()
removeAllLayers()
getLayers().
void IlvGrapherAdapter::afterAnimationStep ( )
protectedvirtual

Notifies the grapher adapter that a layout animation step has finished.

If appropriate, this method is called by the layout algorithm after each animation step. The method redraws all the views of the grapher.

See Also
beforeAnimationStep().

Reimplemented from IlvGraphModel.

void IlvGrapherAdapter::afterLayout ( IlvGraphLayout layout,
IlvGraphLayoutReport layoutReport,
IlBoolean  reDraw 
)
protectedvirtual

Notifies the grapher adapter that a layout session has finished.

This method is always called by IlvGraphLayout::performLayout() after the method IlvGraphLayout::layout() has finished.

Note
You can detect if the layout was performed successfully using the test layoutReport->getCode() == IlvGraphLayoutReport::LayoutDone.

The method IlvGrapher::reDraw() is called on the encapsulated grapher if the argument reDraw is IlTrue.

Parameters
layoutThe layout instance origin of the notification.
layoutReportThe layout report.
reDrawIf IlTrue, all the views of the encapsulated grapher are redrawn.
See Also
beforeLayout().

Reimplemented from IlvGraphModel.

void IlvGrapherAdapter::beforeAnimationStep ( )
protectedvirtual

Notifies the grapher adapter that a layout animation step has been started.

If appropriate, this method is called by the layout algorithm before each animation step.

See Also
afterAnimationStep().

Reimplemented from IlvGraphModel.

void IlvGrapherAdapter::beforeLayout ( IlvGraphLayout layout,
IlBoolean  redraw 
)
protectedvirtual

Notifies the grapher adapter that a layout session has been started.

This method is always called by IlvGraphLayout::performLayout() before the call to the method IlvGraphLayout::layout().

The default implementation of the method does nothing.

Parameters
layoutThe layout instance origin of the notification.
redrawIf IlTrue, the layout algorithm will call, after the layout, the method afterLayout() with the redraw argument at IlTrue.
See Also
afterLayout().

Reimplemented from IlvGraphModel.

void IlvGrapherAdapter::boundingBox ( IlAny  nodeOrLink,
IlvRect rect 
)
virtual

Updates the rect argument with the bounding box of a node or a link in manager coordinates.

If the object is zoomable, it returns the bounding box in manager coordinates by calling IlvGraphic::boundingBox(IlvRect&). For nonzoomable objects, it computes the bounding box according to the current transformer (see the method getReferenceTransformer()) and returns a rectangle obtained by applying the inverse transformation to the rectangle.

Parameters
nodeOrLinkThe node or link for which we want the bounding box.
rectThe rectangle that will be updated.

Implements IlvGraphModel.

void IlvGrapherAdapter::ensureReshapeableLinks ( IlvGraphLayout layout)
virtual

Ensures that all the links in the grapher can be reshaped to a polyline shape.

This method is called by layout algorithms that need to reshape the links. See also the method IlvGraphLayout::isLinkReplacementAllowed().

The method replaces all the links of the grapher that cannot be reshaped to a polyline shape with a new link of type IlvPolylineLinkImage, without any intermediate points. The following link classes are replaced:

If a link is replaced, the following attributes of the old link are copied to the new link:

  • orientation,
  • foreground color,
  • line width,
  • line join,
  • maximum line width,
  • end cap,
  • line style.
Parameters
layoutThe layout algorithm that needs reshapeable links.
See Also
ensureStraightLineLinks()
IlvGraphLayout::isLinkReplacementAllowed()
IlvGraphLayout::isLinkConnectorReplacementAllowed().

Reimplemented from IlvGraphModel.

void IlvGrapherAdapter::ensureStraightLineLinks ( IlvGraphLayout layout)
virtual

Ensures that all the links in the grapher can be reshaped to straight-line links.

This method is called by layout algorithms that need straight-line links. See also the method IlvGraphLayout::isLinkReplacementAllowed().

The method replaces all the links of the grapher that cannot be reshaped to a straight-line shape with new links of type IlvPolylineLinkImage without any intermediate points. The following link classes are replaced:

If a link is replaced, the following attributes of the old link are copied to the new link:

  • orientation,
  • foreground color,
  • line width,
  • line join,
  • maximum line width,
  • end cap,
  • line style.

The method also removes any link connectors of type IlvGrapherPin from the nodes.

Parameters
layoutThe layout algorithm that needs straight-line links.
See Also
ensureReshapeableLinks()
IlvGraphLayout::isLinkReplacementAllowed()
IlvGraphLayout::isLinkConnectorReplacementAllowed().

Reimplemented from IlvGraphModel.

IlvLayoutGraphicFilter* IlvGrapherAdapter::getFilter ( ) const

Returns the filter, if any. Returns 0 otherwise.

See Also
setFilter(IlvLayoutGraphicFilter*).
IlAny IlvGrapherAdapter::getFrom ( IlAny  link)
virtual

Returns the origin node of a link.

See Also
getTo(IlAny).

Implements IlvGraphModel.

const IlArray& IlvGrapherAdapter::getLayers ( ) const

Returns an enumeration of the manager layers to be taken into account during the layout.

If you do not specify any layers using the method addLayer(IlvManagerLayer*), all layers in the encapsulated IlvGrapher are used. In this case, this method returns an empty array.

Returns
An enumeration of the manager layers (IlvManagerLayer instances) to be taken into account during the layout. Returns an empty array if the list of layers to be used is empty.
See Also
addLayer()
removeLayer()
removeAllLayers().
IlvPoint IlvGrapherAdapter::getLinkPointAt ( IlAny  link,
IlUInt  index 
)
virtual

Returns the point of a link at a specified index.

Parameters
linkThe link.
indexThe index in the points array.

Reimplemented from IlvGraphModel.

IlvPoint* IlvGrapherAdapter::getLinkPoints ( IlAny  link,
IlUInt count 
)
virtual

Returns the points that define a link.

Parameters
linkThe link.
countThe number of points is set in this argument.

Implements IlvGraphModel.

IlInt IlvGrapherAdapter::getLinkPointsCount ( IlAny  link)
virtual

Returns the number of points of a link.

Parameters
linkThe link for which we want to know the number of points.

Implements IlvGraphModel.

IlList* IlvGrapherAdapter::getLinks ( )
virtual

Returns an enumeration of the links.

It calls the method IlvGrapher::getObjects() on the encapsulated grapher and skips all the elements that are not links.

Note that, because the nodes and the links are not stored separately in the IlvGrapher, browsing all elements returned by this method is no more efficient than browsing them using the enumeration returned by the method getNodesAndLinks().

Note
You have to destroy the returned list.

Implements IlvGraphModel.

IlList* IlvGrapherAdapter::getLinks ( IlAny  node)
virtual

Returns an enumeration of all the links that have node as their origin or destination.

Parameters
nodeThe node.
Note
You have to destroy the returned list.

Reimplemented from IlvGraphModel.

IlUInt IlvGrapherAdapter::getLinksCountOf ( IlAny  node)
virtual

Returns the number of links adjacent to node.

Parameters
nodeThe node.
See Also
getLinks(IlAny)
getLinksFromCount()
getLinksToCount().

Reimplemented from IlvGraphModel.

IlList* IlvGrapherAdapter::getLinksFrom ( IlAny  node)
virtual

Returns an enumeration of all the links that have node as their origin.

Parameters
nodeThe node.
Note
You have to destroy the returned list.

Implements IlvGraphModel.

IlUInt IlvGrapherAdapter::getLinksFromCount ( IlAny  node)
virtual

Returns the number of links that have node as their origin.

Parameters
nodeThe node.

Reimplemented from IlvGraphModel.

IlList* IlvGrapherAdapter::getLinksTo ( IlAny  node)
virtual

Returns an enumeration of all the links that have node as their destination.

The method may return an empty list if there are no links.

Parameters
nodeThe node.
Note
You have to destroy the returned list.

Implements IlvGraphModel.

IlUInt IlvGrapherAdapter::getLinksToCount ( IlAny  node)
virtual

Returns the number of links that have node as their origin.

Parameters
nodeThe node.

Reimplemented from IlvGraphModel.

IlUInt IlvGrapherAdapter::getLinkWidth ( IlAny  link)
virtual

Returns the width of the link.

Parameters
linkThe link for which we want to know the width.

Reimplemented from IlvGraphModel.

virtual const char* IlvGrapherAdapter::getMessage ( const char *  msg) const
virtual

Returns the message string associated with the message identifier msg.

Parameters
msgThe message identifier searched for.

Implements IlvGraphModel.

IlList* IlvGrapherAdapter::getNeighbors ( IlAny  node)
virtual

Returns an enumeration of all the nodes that are the "neighbors" of node; in other words, the nodes that have a common link with node.

Parameters
nodeThe node.

Note that a neighbor node will be contained in the enumeration the same number of times as the number of links between node and this neighbor.

Note
You have to destroy the returned list.

Reimplemented from IlvGraphModel.

virtual IlList* IlvGrapherAdapter::getNodes ( )
virtual

Returns an enumeration of the nodes.

It calls the method IlvGrapher::getObjects() on the encapsulated grapher and skips all the elements that are not nodes.

Note that, because the nodes and the links are not stored separately in the IlvGrapher, browsing all elements returned by this method is no more efficient than browsing them using the enumeration returned by the method getNodesAndLinks().

Note
You have to destroy the returned list.

Implements IlvGraphModel.

IlList* IlvGrapherAdapter::getNodesAndLinks ( )
virtual

Returns an enumeration of the nodes and links.

Note that graphic objects that are stored by the encapsulated grapher but are not nodes or links are not skipped by this enumeration. Use the methods isNode(IlAny) and isLink(IlAny) to skip them.

Note
You have to destroy the returned list.
See Also
getNodes()
getLinks().

Reimplemented from IlvGraphModel.

IlAny IlvGrapherAdapter::getProperty ( IlAny  nodeOrLink,
const char *  key 
)
virtual

Returns the value of a property.

The method returns 0 if the property does not exist.

Parameters
nodeOrLinkThe node or link for which the property is to be set
keyThe key string for the property
See Also
setProperty().

Reimplemented from IlvGraphModel.

IlvTransformer* IlvGrapherAdapter::getReferenceTransformer ( )

Returns the transformer to be taken into account.

This method returns the transformer specified using setReferenceTransformer(IlvTransformer*) if this transformer is not equal to 0.
Otherwise, it returns the current transformer of the manager view specified using setReferenceView(IlvMgrView*) (if any).
Otherwise, it returns the current transformer of the first manager view attached to the grapher (as returned by the method IlvManager::getViews()).
Otherwise, it returns an identity transformer.

See Also
setReferenceTransformer(IlvTransformer*)
getReferenceView().
Note
You should not modify the transformer returned by this method.
virtual IlvMgrView* IlvGrapherAdapter::getReferenceView ( ) const
virtual

Returns the specified reference view (if any).

See Also
setReferenceView()
setReferenceTransformer(IlvTransformer*).
IlAny IlvGrapherAdapter::getTo ( IlAny  link)
virtual

Returns the destination node of a link.

See Also
getFrom(IlAny).

Implements IlvGraphModel.

IlBoolean IlvGrapherAdapter::hasProperty ( IlAny  nodeOrLink,
const char *  key 
)
virtual

Returns IlTrue if the property exists and IlFalse otherwise.

Parameters
nodeOrLinkThe node or link for which the property is to be set.
keyThe key string for the property.
See Also
setProperty(IlAny, const char*, IlAny)
getProperty(IlAny, const char*).

Reimplemented from IlvGraphModel.

IlBoolean IlvGrapherAdapter::isLink ( IlAny  obj)
virtual

Returns IlTrue if an object is a valid link and IlFalse otherwise.

An object is not valid in one of the following cases:

  • It is not a link that belongs to the encapsulated grapher.
  • It is rejected by the filter (if any).
  • It is not on a specified layer (if any).
Parameters
objThe object to test.

Implements IlvGraphModel.

IlBoolean IlvGrapherAdapter::isNode ( IlAny  obj)
virtual

Returns IlTrue if an object is a valid node and IlFalse otherwise.

An object is not valid in one of the following cases:

  • It is not a node that belongs to the encapsulated grapher.
  • It is rejected by the filter (if any).
  • It is not on a specified layer (if any).
Parameters
objThe object to test.

Implements IlvGraphModel.

void IlvGrapherAdapter::moveNode ( IlAny  node,
IlInt  x,
IlInt  y,
IlBoolean  reDraw 
)
virtual

Changes the position of the specified node. The x and y coordinates correspond to the top-left corner of the rectangle that defines the node.

Parameters
nodeThe node.
xThe new x-position.
yThe new y-position.
reDrawIf IlTrue, the node is redrawn.
See Also
boundingBox(IlAny, IlvRect&).

Implements IlvGraphModel.

IlBoolean IlvGrapherAdapter::removeAllLayers ( )

Removes all manager layers from the list of layers to be used during the layout.

All layers will be taken into account. Note that, in this case, getLayers() returns an empty array.

Returns
IlFalse if there are no layers to be removed and IlTrue otherwise.
See Also
addLayer()
removeLayer()
getLayers().
IlBoolean IlvGrapherAdapter::removeLayer ( IlvManagerLayer layer)

Removes a manager layer from the list of layers to be used during the layout.

Parameters
layerThe layer to be removed.
Returns
IlTrue if the layer is in the list of layers to be used; IlFalse if the layer is not in the list of layers or if the list of layers is empty.
See Also
addLayer()
removeAllLayers()
getLayers().
void IlvGrapherAdapter::reshapeLink ( IlAny  link,
IlvPoint  fromPoint,
IlvPoint points,
IlUInt  startIndex,
IlUInt  length,
IlvPoint  toPoint,
IlBoolean  reDraw 
)
virtual

Reshapes all the points of a link, including the connection points on the origin and destination nodes.

If the new shape of the link must be a straight line, without any intermediate points, call the method with 0 for the points argument. In this case, the values of the arguments startIndex and length are ignored.

Note that the effect of this method depends on the type of the link. For the following link types the reshaping of the intermediate points has no effect:

Parameters
linkThe link to be reshaped
fromPointThe connection point of the link on the origin node. If 0, the connection point is not moved.
pointsThe intermediate points of the link (ordered from origin node to destination node). If 0, all the intermediate points of the link are removed.
startIndexThe start position in the array of points.
lengthThe number of intermediate points.
toPointThe connection point of the link on the destination node. If 0, the connection point is not moved.
reDrawIf IlTrue, the link is redrawn.
See Also
ensureStraightLineLinks()
ensureReshapeableLinks().

Implements IlvGraphModel.

void IlvGrapherAdapter::setFilter ( IlvLayoutGraphicFilter filter)

Allows you to specify a filter on the nodes and links.

Using a filter allows you to perform the layout on a part of a grapher. To do this, methods such as getNodes(), getLinks(), getNeighbors(), and so on return enumerations of only the nodes or links that are accepted by the filter (if any).

To remove the filter, call this method with an argument equal to 0.

Parameters
filterThe new filter.
See Also
getFilter().
Note
Using a filter may not be the most efficient way to lay out a small part of a large graph. You may prefer to build a new graph corresponding to this small part on the fly and perform the layout on the new graph.
void IlvGrapherAdapter::setProperty ( IlAny  nodeOrLink,
const char *  key,
IlAny  value 
)
virtual

Sets the value of a property for a node or a link.

If value is equal to 0, the property is removed. Otherwise, the property value is set to value.

Parameters
nodeOrLinkThe node or link for which the property is to be set.
keyThe key string for the property.
valueThe new value of the property.
See Also
getProperty().

Reimplemented from IlvGraphModel.

void IlvGrapherAdapter::setReferenceTransformer ( IlvTransformer t)

Allows you to specify the reference transformer.

The reference transformer is the transformer (see the class IlvTransformer) that is taken into account by the IlvGrapherAdapter when computing the geometry of the graph.

If the encapsulated grapher contains only zoomable nodes and links (see IlvGraphic::zoomable()), you never need to call this method. In this case, the layout computes the geometry of the graph on the basis of the bounding boxes of the objects in manager coordinates. The geometry will stay valid for any transformer.

If the encapsulated grapher contains at least one nonzoomable object, the geometry of the graph becomes dependent on the transformer that is used to draw the graph. Therefore, you need to specify the transformer with which you want the layout to be performed. Usually, this transformer is the current transformer used to display the result of the layout.

In most cases, it is not necessary to call this method because the transformer to be taken into account is chosen using a set of default rules (see getReferenceTransformer()). If it is called, the transformer specified using this method is returned by the method getReferenceTransformer(), overriding the default rules for choosing the transformer.

The only cases when you may need to call this method are the following:

  • The IlvGrapher contains nonzoomable objects and more than one manager view is attached to the grapher.
  • The IlvGrapher contains nonzoomable objects and no manager view is attached to the grapher.

In both cases, because of the nonzoomable objects, the layout cannot be correctly computed independently of the transformer used for drawing the graph. Also, the default rule for choosing the current transformer of the first manager view as the reference transformer cannot be applied.

If a grapher containing nonzoomable objects is displayed simultaneously in several views, you can use the method setReferenceView(IlvMgrView*) to indicate the view for which you want the layout to correspond exactly to the geometry of the graph.

If you specified a transformer but want to reset this setting and go back to the default behavior, call the method with an argument equal to 0.

Parameters
tThe transformer that becomes the reference.

Note that if this method is overridden, you must call setReferenceTransformer(IlvTransformer*) of the super class in order to notify the grapher adapter that the reference transformer has changed.

Note also that a call to the method setReferenceView(IlvMgrView*) overrides the effect of a call to the method setReferenceTransformer(IlvTransformer*).

Similarly, a call to the method setReferenceTransformer(IlvTransformer*) overrides the effect of a call to the method setReferenceView(IlvMgrView*).

Note
This method make a copy of the transformer passed as argument.
See Also
getReferenceTransformer()
setReferenceView(IlvMgrView*).
virtual void IlvGrapherAdapter::setReferenceView ( IlvMgrView view = 0)
virtual

Allows you to specify the reference manager view.

The reference view is the view connected to the manager whose current transformer is used as a reference transformer (see method getReferenceTransformer()).

Usually, the view argument is the manager view that is used for displaying the graph, but this is not mandatory.

Call this method with an argument equal to 0 to reset the setting.

Parameters
viewThe view set as the reference.
Note
A call to the method setReferenceTransformer(IlvTransformer*) overrides the effect of a call to the method setReferenceView(IlvMgrView*). Similarly, a call to the method setReferenceView(IlvMgrView*) overrides the effect of a call to the method setReferenceTransformer(IlvTransformer*).
See Also
getReferenceView()
setReferenceTransformer(IlvTransformer*).

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