Views
Manager Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions
IlvManager Class Reference

Manager class. More...

#include <ilviews/manager/manager.h>

Inheritance diagram for IlvManager:
IlvValueInterface IlvGadgetManager

Public Member Functions

 IlvManager (IlvDisplay *display, int layers=2, IlBoolean useacc=IlTrue, IlUShort maxInList=IlvMaxObjectsInList, IlUShort maxInNode=IlvMaxObjectsInList)
 Initializes a new instance of IlvManager. More...
 
virtual ~IlvManager ()
 Destructor. More...
 
IlvMgrViewgetView (const IlvView *v) const
 Returns the IlvMrgView of a manager view. More...
 
IlBoolean removeView (IlvMgrView *v)
 Removes the IlvMrgView from the manager. More...
 
Applying Functions to Located Objects
void applyInside (int layer, IlvApplyObject func, IlAny arg, const IlvRect &rect, const IlvTransformer *t=0, IlBoolean redraw=IlTrue)
 Applies a user function to objects of a layer located in a rectangle. More...
 
void applyIntersects (int layer, IlvApplyObject func, IlAny arg, const IlvRect &rect, const IlvTransformer *t=0, IlBoolean redraw=IlTrue)
 Applies a user function to objects of a layer intersecting a rectangle. More...
 
void applyInside (IlvApplyObject func, IlAny arg, const IlvRect &rect, const IlvTransformer *t=0, IlBoolean redraw=IlTrue)
 Applies a user function to graphic objects located in a rectangle. More...
 
void applyIntersects (IlvApplyObject func, IlAny arg, const IlvRect &rect, const IlvTransformer *t=0, IlBoolean redraw=IlTrue)
 Applies a user function to graphic objects intersecting a rectangle. More...
 
Applying Functions to Objects
IlBoolean isInApply () const
 Indicates if an applyTo...() method is being executed. More...
 
virtual void applyToObjects (IlUInt count, IlvGraphic *const *objects, IlvApplyObject func, IlAny arg, IlBoolean redraw=IlTrue)
 Applies a user function to a set of graphic objects. More...
 
virtual void applyToObjects (IlUInt count, IlvGraphic *const *objects, IlvApplyFunction func, IlAny arg, IlBoolean redraw=IlTrue)
 Applies a user function to a set of graphic objects. More...
 
virtual void applyToObjects (int layer, IlvApplyObject func, IlAny arg, IlBoolean redraw=IlTrue)
 Applies a user function to all graphic objects of a manager layer. More...
 
virtual void applyToObjects (int layer, IlvApplyFunction func, IlAny arg, IlBoolean redraw=IlTrue)
 Applies a user function to the graphic objects of a manager layer. More...
 
virtual void applyToObject (IlvGraphic *object, IlvApplyObject func, IlAny arg, IlBoolean redraw=IlTrue)
 Applies a user function to a graphic object. More...
 
Associating an Interactor with an Object or View
virtual IlBoolean dispatchToObjects (IlvEvent &, IlvView *)
 Dispatches an event to the appropriate graphic objects. More...
 
IlvManagerObjectInteractorgetObjectInteractor (const IlvGraphic *object) const
 The object interactor associated with a graphic object. More...
 
IlBoolean setObjectInteractor (IlvGraphic *object, IlvManagerObjectInteractor *i)
 Sets an object interactor on a graphic object. More...
 
void setInteractor (IlvManagerViewInteractor *i, const IlvView *view=0)
 Sets a view interactor on a manager view. More...
 
void removeInteractor (const IlvView *view)
 Removes the view interactor from a manager view. More...
 
IlvManagerViewInteractorgetInteractor (const IlvView *view) const
 Returns the view interactor associated with a manager view. More...
 
Callback Management
void registerCallback (const char *callbackName, IlvGraphicCallback callback)
 Registers a callback and its name. More...
 
void unregisterCallback (const char *callbackName)
 Removes the callback function registered with the specified name from the callback list. More...
 
Cutting and Pasting
virtual char * cut (IlUInt &count)
 Saves the selected graphic objects in a string and then deletes them. More...
 
virtual char * copy (IlUInt &count)
 Saves all the selected graphic objects in a string. More...
 
virtual void paste (const IlvView *view, const char *str, IlvPoint &location)
 Reads graphic objects from a string. More...
 
void cutToClipboard ()
 Saves the selected graphic objects in the clipboard and deletes them. More...
 
void copyToClipboard ()
 Saves the selected graphic objects in the clipboard. More...
 
void pasteFromClipboard (const IlvView *view, IlvPoint &location)
 Reads graphic objects from the clipboard and adds them to the manager. More...
 
Draw, Redraw and Group Objects
virtual IlvGraphicSetgroup (IlUInt count, IlvGraphic *const *objects)
 Groups several graphic objects. More...
 
virtual void unGroup (IlvGraphic *object, IlBoolean undoCommand=IlTrue)
 Ungroups the graphic objects of a graphic set. More...
 
virtual void eraseRegion (IlvView *view, const IlvRegion &region) const
 Erases a region of a manager view. More...
 
virtual void draw (IlvView *view, IlBoolean erase, const IlvRegion *clip=0) const
 Draws the graphic objects of the manager in a manager view. More...
 
void draw (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *region=0, const IlvRegion *clip=0) const
 Draws the contents of a manager in a destination port. More...
 
void draw (int layer, IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *region=0, const IlvRegion *clip=0) const
 Draws the contents of a manager layer in a destination port. More...
 
void draw () const
 Draws the contents of the manager. More...
 
void reDraw () const
 Erases all manager views and draws the contents of the manager. More...
 
void reDraw (const IlvGraphic *object, IlBoolean erase=IlTrue) const
 Draws a graphic object in all manager views. More...
 
void reDraw (IlUInt count, const IlvGraphic *const *objects, IlBoolean erase=IlTrue) const
 Draws a set of graphic objects in all manager views. More...
 
void bufferedDraw (IlvView *view, const IlvRect &rect) const
 Redraws a rectangular area of a manager view by means of a temporary pixmap. More...
 
void bufferedDraw (IlvView *view, const IlvRegion &region) const
 Redraws a region of a manager view by means of a temporary pixmap. More...
 
void bufferedDraw (IlvView *view, const IlvGraphic *object) const
 Draws a graphic object in a manager view by means of a temporary pixmap. More...
 
General Purpose Methods
const char * getName () const
 Returns the name of the manager. More...
 
virtual void setName (const char *name)
 Sets the name of the manager. More...
 
IlvDisplaygetDisplay () const
 Returns the display. More...
 
IlvPalettegetPalette () const
 Returns the manager palette. More...
 
IlBoolean isModified () const
 Indicates whether the manager contents have been modified. More...
 
void setModified (IlBoolean value)
 Sets the modification status of the manager. More...
 
IlUInt getCardinal () const
 Returns the number of graphic objects. More...
 
virtual IlvGraphic *const * getObjects (IlUInt &count) const
 Returns the graphic objects stored in the manager. More...
 
virtual IlvGraphic *const * getObjects (int layer, IlUInt &count) const
 Returns the graphic objects stored in a manager layer. More...
 
virtual IlvGraphiclastContains (const IlvPoint &p, const IlvView *view) const
 Returns the graphic object containing a given point. More...
 
IlvGraphiclastContains (int layer, const IlvPoint &p, const IlvView *view) const
 Returns the graphic object containing a given point in a layer. More...
 
IlvGraphicfilteredLastContains (const IlvPoint &p, const IlvView *view, const IlvGraphicFilter &f) const
 Returns the graphic object containing a given point. More...
 
IlvGraphicfilteredLastContains (int layer, const IlvPoint &p, const IlvView *view, const IlvGraphicFilter &f) const
 Returns the graphic object containing a given point in a layer. More...
 
IlvGraphic *const * allContains (const IlvPoint &p, const IlvView *view, IlUInt &count) const
 Returns all graphic objects containing a given point. More...
 
IlvGraphic *const * allContains (int layer, const IlvPoint &p, const IlvView *view, IlUInt &count) const
 Returns all graphic objects containing a given point in a layer. More...
 
IlvGraphicfirstIntersects (const IlvRegion &tr, const IlvTransformer *t) const
 Returns the first object intersecting a region. More...
 
IlvGraphicfirstIntersects (int layer, const IlvRegion &tr, const IlvTransformer *t) const
 Returns the first object of a layer intersecting a region. More...
 
IlvGraphic *const * allInside (IlUInt &count, const IlvRect &rect, const IlvTransformer *t=0) const
 Returns all graphic objects located in a rectangle. More...
 
IlvGraphic *const * allIntersects (IlUInt &count, const IlvRect &rect, const IlvTransformer *t=0) const
 Returns all graphic objects intersecting a rectangle. More...
 
IlvGraphic *const * allIntersects (int layer, IlUInt &count, const IlvRect &rect, const IlvTransformer *t=0) const
 Returns all graphic objects of a layer intersecting a rectangle. More...
 
IlvGraphic *const * allInside (int layer, IlUInt &count, const IlvRect &rect, const IlvTransformer *t=0) const
 Returns all graphic objects of a layer located in a rectangle. More...
 
IlUInt getCardinal (int layer) const
 Returns the number of graphic objects in a layer. More...
 
virtual void contentsChanged ()
 Called automatically by the manager each time objects are created, removed, moved, or resized in the manager. More...
 
void setCleanFunction (IlvApplyObject func)
 Sets a function to be called when an object is removed from the manager. More...
 
void computeBBox (IlvRect &bbox, const IlvTransformer *t=0) const
 Computes the bounding box of all the objects stored in all the visible layers. More...
 
void computeBBox (IlvRect &bbox, const IlvView *view) const
 Computes the bounding box of all the objects. More...
 
Grid Management
IlvManagerGridgetGrid (const IlvView *view) const
 Returns the manager grid associated with a manager view. More...
 
void setGrid (IlvView *const view, IlvManagerGrid *grid)
 Sets a manager grid on a manager view. More...
 
void snapToGrid (const IlvView *view, IlvPoint &p) const
 Moves a given point to the closest grid point on a manager view. More...
 
IlBoolean transformThroughGrid (const IlvView *view, IlvPoint &p) const
 Transforms and moves a given point on a manager view to the closest grid point in the manager coordinate system. More...
 
Input and Output Methods
virtual IlvManagerInputFilecreateInputFile (std::istream &stream)
 Creates an IlvManagerInputFile from an input stream. More...
 
virtual IlvManagerOutputFilecreateOutputFile (std::ostream &stream) const
 Creates an IlvManagerOutputFile from an output stream. More...
 
virtual void save (std::ostream &stream) const
 Saves all the graphic objects in an output stream. More...
 
virtual void read (std::istream &stream)
 Reads a set of graphic objects from the specified input stream. More...
 
virtual void read (const char *filename)
 Loads a Rogue Wave Views data file. More...
 
Managing Accelerators
IlBoolean installEventHook (const IlvManagerEventHook *hook)
 Installs an event hook on the manager. More...
 
IlvManagerEventHookremoveEventHook (const IlvManagerEventHook *hook)
 Removes and returns an event hook installed on the manager. More...
 
virtual IlBoolean shortCut (IlvEvent &event, IlvView *view)
 Dispatches an incoming event to manager accelerators. More...
 
void addAccelerator (IlvManagerAcceleratorAction f, IlvEventType type, IlUShort buttonOrKey=0, IlUShort modifiers=0, IlAny userArg=0, IlUShort optModifiers=0)
 Adds an accelerator to the manager. More...
 
void removeAccelerator (IlvEventType type, IlUShort buttonOrKey=0, IlUShort modifiers=0)
 Removes the accelerator matching the event description. More...
 
IlBoolean getAccelerator (IlvManagerAcceleratorAction *f, IlAny *userArg, IlvEventType type, IlUShort buttonOrKey=0, IlUShort modifiers=0)
 Gets an accelerator action matching an event description. More...
 
void removeAccelerators ()
 Removes all accelerators. More...
 
Managing Double Buffering
IlBoolean setDoubleBuffering (const IlvView *view, IlBoolean useDblBuffering)
 Enables or disables double buffering for a manager view. More...
 
virtual void setBackground (IlvView *view, IlvColor *color, IlvBitmap *bitmap=0)
 Sets the background of a manager view. More...
 
IlBoolean isDoubleBuffering (const IlvView *view) const
 Indicates whether double buffering is used for a manager view. More...
 
Managing Object Layers
IlBoolean isVisible (int layer) const
 Indicates whether a layer is considered visible by the manager. More...
 
void setVisible (int layer, IlBoolean visible)
 Sets the visibility of a layer for the manager. More...
 
IlBoolean isVisible (const IlvView *view, int layer) const
 Indicates the visibility of a layer in a manager view. More...
 
void setVisible (const IlvView *view, int layer, IlBoolean visible)
 Sets the visibility of a layer for a manager view. More...
 
IlBoolean isSelectable (int layer) const
 Indicates if a manager layer allows the selection of its graphic objects. More...
 
void setSelectable (int layer, IlBoolean selectable)
 Enables or disables the selection of graphic objects in a manager layer. More...
 
virtual void pop (IlvGraphic *object, IlBoolean redraw=IlTrue)
 Moves a graphic object higher in the drawing stacking order. More...
 
virtual void push (IlvGraphic *object, IlBoolean redraw=IlTrue)
 Moves a graphic object lower in the drawing stacking order. More...
 
IlvManagerLayergetManagerLayer (const IlvGraphic *object) const
 Returns the IlvManagerLayer instance of a graphic object. More...
 
int getLayer (const IlvGraphic *object) const
 Returns the manager layer containing a given graphic object. More...
 
void setLayer (IlvGraphic *object, int layer, IlBoolean redraw=IlTrue)
 Moves a graphic object to a given manager layer. More...
 
int getNumLayers () const
 Returns the number of manager layers. More...
 
void setNumLayers (int numLayers)
 Sets the number of manager layers. More...
 
void swapLayers (int layer1, int layer2, IlBoolean redraw=IlTrue)
 Swaps the contents of two manager layers. More...
 
void addLayer (int position=-1, IlUShort maxInList=IlvMaxObjectsInList, IlUShort maxInNode=IlvMaxObjectsInList)
 Adds a layer to the manager. More...
 
void removeLayer (int layer=-1)
 Removes a layer from the manager. More...
 
int addLayer (IlvManagerLayer *layer, int position=-1)
 Adds a layer to the manager. More...
 
IlvManagerLayergetManagerLayer (int index) const
 Returns the IlvManagerLayer instance from its index. More...
 
int getLayerIndex (const IlvManagerLayer *layer) const
 Returns the index of a manager layer instance. More...
 
Managing Selections
IlvMakeSelection setMakeSelection (IlvMakeSelection func)
 Sets the function that creates a selection object for a graphic object. More...
 
IlBoolean installSelectionHook (const IlvManagerSelectionHook *hook)
 Sets a selection hook on the manager. More...
 
IlvManagerSelectionHookremoveSelectionHook (const IlvManagerSelectionHook *hook)
 Removes the selection hook from the manager, if it is installed. More...
 
void applyToSelections (IlvApplyObject func, IlAny arg, IlBoolean redraw=IlTrue)
 Applies a user function to the selected graphic objects. More...
 
IlUInt numberOfSelections () const
 Returns the number of selected graphic objects. More...
 
virtual void deSelectAll (IlBoolean redraw=IlTrue)
 Deselects the selected graphic objects. More...
 
virtual void selectAll (IlBoolean redraw=IlTrue)
 Selects all the objects of the manager. More...
 
IlvGraphic *const * getSelections (IlUInt &count) const
 Returns the selected graphic objects. More...
 
IlvDrawSelectiongetSelection (const IlvGraphic *object) const
 Returns the selection object of a graphic object. More...
 
IlvGraphic *const * sortObjects (IlvGraphic *const *objs, IlUInt count) const
 Sorts a set of object. More...
 
virtual void setSelected (IlvGraphic *object, IlBoolean selected=IlTrue, IlBoolean redraw=IlTrue)
 Selects or deselects a graphic object. More...
 
IlBoolean isSelected (const IlvGraphic *obj) const
 Indicates if a graphic object is selected. More...
 
virtual void duplicate (IlvPos dx=0, IlvPos dy=0)
 Duplicates the selected graphic objects. More...
 
virtual void deleteSelections (IlBoolean redraw=IlTrue)
 Removes the selected objects from the manager and deletes them if undo is disabled. More...
 
Managing SmartSets
IlvSmartSetgetSmartSet (const char *name) const
 Gets a smartset by its name. More...
 
virtual IlBoolean addSmartSet (IlvSmartSet *set, IlBoolean redraw=IlTrue)
 Adds a smartset to the manager. More...
 
virtual IlBoolean removeSmartSet (IlvSmartSet *set)
 Removes a smartset from the manager. More...
 
virtual IlvSmartSetduplicateSmartSet (IlvSmartSet *set, IlvPos dx=0, IlvPos dy=0)
 Makes a copy of a smartset. More...
 
Managing Undo
IlBoolean isUndoEnabled () const
 Indicates whether the manager lets you undo commands. More...
 
void setUndoEnabled (IlBoolean enable)
 Enables or disables the possibility of undoing commands in the manager. More...
 
void forgetUndo ()
 Resets the undo command queue. More...
 
virtual void repeat ()
 Executes again the last command.
 
virtual void reDo (IlBoolean unused)
 Executes again the last canceled command. More...
 
virtual void unDo ()
 Cancels the most recent command, leaving manager objects as they were before the previous command was applied.
 
virtual void addCommand (IlvCommand *command)
 Appends a new command to the command queue. More...
 
IlvCommandHistorygetCommandHistory () const
 Returns the object which handles the stack of commands. More...
 
Managing View Hooks
void installViewHook (const IlvManagerViewHook *hook)
 Adds a view hook to the manager. More...
 
void removeViewHook (const IlvManagerViewHook *hook)
 Removes a view hook from the manager. More...
 
IlvManagerViewHook *const * getViewHooks (const IlvView *view, IlUInt &count) const
 Gets the view hooks of a manager view. More...
 
Manipulating Objects
virtual void translateObject (IlvGraphic *object, IlvPos dx, IlvPos dy, IlBoolean redraw=IlTrue)
 Translates a graphic object. More...
 
void moveObject (IlvGraphic *object, IlvPos x, IlvPos y, IlBoolean redraw=IlTrue)
 Moves a graphic object. More...
 
virtual void reshapeObject (IlvGraphic *object, const IlvRect &bbox, IlBoolean redraw=IlTrue)
 Resizes a graphic object to fit in a rectangle. More...
 
Object Alignment
virtual void align (IlvPosition alignment, IlBoolean redraw=IlTrue)
 Aligns the selected objects. More...
 
virtual void makeColumn (IlvDim spacing=0, IlBoolean redraw=IlTrue)
 Arranges the selected graphic objects in a column. More...
 
virtual void makeRow (IlvDim spacing=0, IlBoolean redraw=IlTrue)
 Arranges the selected graphic objects in a row. More...
 
virtual void sameWidth (IlBoolean redraw=IlTrue)
 Resizes the selected graphic objects to the same width. More...
 
virtual void sameHeight (IlBoolean redraw=IlTrue)
 Resizes the selected graphic objects to the same height. More...
 
Object Creation Interactors
IlvPalettegetCreatorPalette () const
 Gets the default palette used to create graphic objects interactively. More...
 
void setCreatorPalette (IlvPalette *palette)
 Sets the default palette used to create new graphic objects interactively. More...
 
int getInsertionLayer () const
 Gets the default layer used to store the graphic objects created interactively. More...
 
void setInsertionLayer (int layer=-1)
 Sets the layer where new objects created interactively using the predefined interactors will be stored. More...
 
Optimizing Drawing Tasks
void initReDraws ()
 Initializes the manager so that calls to invalidateRegion() can begin. More...
 
void invalidateRegion (const IlvGraphic *object)
 Invalidates the bounding box of a graphic object. More...
 
void invalidateRegion (const IlvRect &rect)
 Invalidates a rectangle. More...
 
void invalidateRegion (const IlvView *view, const IlvRect &rect)
 Invalidates a rectangle in a manager view. More...
 
void invalidateRegion (const IlvRegionUpdater &updater, const IlvGraphic *g=0)
 Updates the invalidated region. More...
 
void reDrawViews (IlBoolean erase=IlTrue)
 Draws the invalidated regions. More...
 
void abortReDraws ()
 Resets the invalidated regions. More...
 
virtual void flushRedraw ()
 Performs the actual redraw of invalid regions. More...
 
void disableRedrawTask ()
 Deactivates the lazy redraw mechanism. More...
 
IlvReDrawMode getReDrawMode () const
 Returns the redraw mode of the manager. More...
 
void setReDrawMode (IlvReDrawMode reDrawMode)
 Sets the redraw mode of the manager. More...
 
IlBoolean isInvalidating () const
 Indicates whether the manager is in a phase of invalidating regions. More...
 
Tag Management
IlvGraphic *const * getTaggedObjects (const IlSymbol *tag, IlUInt &count) const
 Returns the graphic objects associated with a given tag. More...
 
void setTaggedObjectsSelected (const IlSymbol *tag, IlBoolean selected=IlTrue, IlBoolean redraw=IlTrue)
 Selects or deselects the graphic objects associated with a given tag. More...
 
void removeTaggedObjects (const IlSymbol *tag, IlBoolean redraw=IlTrue)
 Removes graphic objects associated with a given tag. More...
 
void applyToTaggedObjects (const IlSymbol *tag, IlvApplyObject func, IlAny arg, IlBoolean redraw=IlTrue)
 Applies a user function to all graphic objects associated with a given tag. More...
 

Binding Views to a Manager

virtual void addView (IlvView *view)
 Adds a view to the manager. More...
 
virtual IlBoolean removeView (IlvView *view)
 Removes a view from the manager view list. More...
 
IlvView ** getViews (IlUInt &count) const
 Returns the array of views associated with the manager. More...
 
IlvViewgetFirstView () const
 Returns the first view associated with the manager. More...
 
IlvTransformergetTransformer (const IlvView *view) const
 Returns the transformer associated with a manager view. More...
 
virtual void setTransformer (const IlvView *view, IlvTransformer *t=0)
 Sets a transformer to a manager view. More...
 
virtual void addTransformer (const IlvView *view, IlvTransformer *t=0)
 Composes a manager view transformer with another transformer. More...
 
void translateView (const IlvView *view, IlvPos dx, IlvPos dy, IlBoolean redraw=IlTrue)
 Scroll the contents of a manager. More...
 
void zoomView (const IlvView *view, const IlvPoint &point, IlFloat scalex, IlFloat scaley, IlBoolean redraw=IlTrue)
 Zoom the contents of a manager view. More...
 
void rotateView (const IlvView *view, const IlvPoint &point, IlFloat angle, IlBoolean redraw=IlTrue)
 Rotates the contents of a manager view. More...
 
void fitTransformerToContents (const IlvView *view, IlBoolean redraw=IlTrue, IlBoolean ratio=IlFalse)
 Rescales the contents of a manager view to fit in the view. More...
 
void fitToContents (IlvView *view)
 Resizes a manager view to fit the bounding box of the graphic objects. More...
 
IlBoolean isKeepingAspectRatio (const IlvView *view) const
 Indicates whether a manager view preserves the x/y ratio. More...
 
void setKeepingAspectRatio (const IlvView *view, IlBoolean ratio=IlTrue, IlBoolean redraw=IlTrue) const
 Sets or unsets the automatic preservation of the x/y ratio in a manager view. More...
 
void ensureVisible (IlvView *view, const IlvPoint &point)
 Translates the contents of a manager view in order to make a given location visible. More...
 
void ensureVisible (IlvView *view, const IlvRect &rect)
 Translates the contents of a manager view in order to make a given rectangle visible. More...
 
static IlvManagerGet (const IlvView *view)
 Returns the manager connected to the specified view, if any. More...
 

Object Properties

virtual void addObject (IlvGraphic *object, IlBoolean redraw=IlTrue, int layer=-1)
 Adds an object to the manager. More...
 
virtual void addObject (const char *name, IlvGraphic *object, IlBoolean redraw=IlTrue, int layer=-1)
 Adds a graphic object to a manager, and then names the object. More...
 
virtual IlBoolean removeObject (IlvGraphic *object, IlBoolean redraw=IlTrue, IlBoolean destroyIt=IlTrue)
 Removes a graphic object from the manager set. More...
 
IlvDrawSelectionwhichSelection (const IlvPoint &p, const IlvView *view) const
 Returns the selection object located at the given location. More...
 
IlBoolean isVisible (const IlvGraphic *object) const
 Indicates whether a graphic object is visible. More...
 
IlBoolean isVisible (const IlvGraphic *graphic, IlvView *view) const
 Indicates whether a graphic object is visible in a manager view. More...
 
void setVisible (IlvGraphic *object, IlBoolean visible, IlBoolean redraw=IlFalse)
 Sets the visibility of a graphic object in the manager to visible. More...
 
const char * getObjectName (const IlvGraphic *object) const
 Returns the name of a graphic object. More...
 
virtual IlBoolean setObjectName (IlvGraphic *object, const char *name)
 Sets the name of a graphic object in the manager. More...
 
IlvGraphicgetObject (const char *name) const
 Gets a graphic object by its name. More...
 
virtual IlBoolean isSelectable (const IlvGraphic *obj) const
 Indicates if a graphic object can be selected. More...
 
virtual void setSelectable (IlvGraphic *object, IlBoolean selectable)
 Sets a graphic object as selectable or not selectable. More...
 
IlBoolean isMoveable (const IlvGraphic *object) const
 Indicates if a graphic object can be moved. More...
 
void setMoveable (IlvGraphic *object, IlBoolean moveable)
 Sets the moveability of a graphic object. More...
 
IlBoolean isResizeable (const IlvGraphic *object) const
 Indicates if a graphic object can be resized. More...
 
void setResizeable (IlvGraphic *object, IlBoolean resizable)
 Sets a graphic object as resizable or not resizable. More...
 
IlBoolean isEditable (const IlvGraphic *object) const
 Indicates whether a graphic object can be edited. More...
 
void setEditable (IlvGraphic *object, IlBoolean editable)
 Indicates whether a graphic object can be edited. More...
 
IlBoolean isManaged (const IlvGraphic *object) const
 Indicates whether a graphic object is stored by the manager. More...
 
IlBoolean isASelection (const IlvGraphic *object) const
 Indicates if a graphic object is a selection object. More...
 
virtual void deleteAll (IlBoolean destroy, IlBoolean redraw)
 Removes all the graphic objects from the manager. More...
 
virtual void deleteAll (int layer, IlBoolean destroy, IlBoolean redraw)
 Removes all the objects stored in a specified layer of the manager. More...
 
static IlvManagergetManager (const IlvGraphic *object)
 Gets the manager holding a given graphic object. More...
 

Detailed Description

Manager class.

Library: ilvmgr

An IlvManager holds and manages a set of graphic objects. These objects can appear in superimposed layers.
The display can take place in one or several views of the IlvView class. A graphic transformation can be associated with each view. Consequently, you can display any portion of the total space in which your graphic objects are located, with appropriate scales for each view.

The manager can associate an IlvManagerViewInteractor object for each view, an object which processes events intended for that particular view. If the manager has not associated an interactor object with a view, each event is handled by the interactor object associated with the graphic object that received the event. The interactor object belongs to the IlvManagerObjectInteractor class.

In certain situations, the best solution is to establish a generic action for all the objects associated with a single event sequence. For example, double clicking an object pops up an additional information panel. To do this, Rogue Wave Views allows you to associate direct actions with events. These actions, which are neither bound to the view nor to the object that was clicked on, are called accelerators.

If your display device has touch-screen capability, the IlvManager allows you to use it to pan, zoom or rotate the associated views using regular multi-touch gestures. If you do not want this, you can set the environment variable ILVTOUCHSCREENNAVIGATION or the display resource touchScreenNavigation to false. This will disable this default behavior for every window of your application.
You can also set the display resource touchScreenNavigation specifically for your views class or identifier, and/or your manager class or name.

The IlvManager class has been designed to allow a large number of graphic objects to be handled. In such cases, storing objects in a linear list or an array may cause some performance problems when objects must be retrieved from their location (refresh, selection, and so on). Most of the time, the manager stores the graphic object in a complex structure organized according to the geometry of the objects, so that they can by found quickly. Because this structure must always be kept synchronized with the state of the objects, the manager must always be informed when the geometry of an object is modified. This is why operations on graphic object (such as move, resize, rotate, and so on) must not be done by direct calls to graphic object member functions but must be done through the control of the manager. This is done by using IlvManager member functions called applyTo...(). These functions encapsulate a user function and allow the manager to keep its data structure coherent.

IlvManager also handles many utility functions for the views and objects under its control.

In the following member function descriptions, the term invalidated region means a region of the screen that needs to be updated.

See also
IlvApplyObject, IlvContainer, IlvGadgetManager, IlvGetContentsChangedUpdate(), IlvGetOptimizeMode(), IlvGrapher, IlvIndexedSet, IlvManagerAccelerator, IlvManagerAcceleratorAction, IlvManagerCommand, IlvManagerEventHook, IlvManagerGrid, IlvManagerLayer, IlvManagerSelectionHook, IlvManagerViewHook, IlvManagerObjectInteractor, IlvManagerObserver, IlvManagerViewInteractor, IlvManagerInputFile, IlvManagerOutputFile, IlvMgrView, IlvSetContentsChangedUpdate(), IlvSetOptimizeMode().

Accessors\nAccessors provide a scriptable and uniform way to inspect and modify an object by using its base class methods <tt>IlvValueInterface::queryValue()</tt>, <tt>IlvValueInterface::queryValues()</tt>, <tt>IlvValueInterface::changeValue()</tt>, <tt>IlvValueInterface::changeValues()</tt>.\n\n\nThis class inherits the accessors of its superclass \c IlvValueInterface and adds the following ones:

Data accessors

Name Type Equivalent methods
cardinal UInt getCardinal()
layerCardinal UInt getNumLayers()
insertionLayer Int getInsertionLayer()

Method accessors

Name Return type Equivalent methods
getObject(String name) Object getObject(const char* name) const
addObject(Object object, Int layer) Void addObject(IlvGraphic* object, IlBoolean, int layer)
removeObject(Object object, Boolean destroy) Void removeObject(IlvGraphic* object, IlBoolean, IlBoolean destroy)
deleteAll() Void deleteAll()
getFirstView() Object getFirstView()
addView(Object view) Void addView(IlvView* view)
removeView(Object view ) Void removeView(IlvView* view)
translateView(Object view, Int dx, Int dy) Void translateView(const IlvView* view, IlvPos dx, IlvPos dy, IlBoolean)
rotateView(Object view, IlvPoint center, Float angle) Void rotateView(const IlvView* view, const IlvPoint& point, IlFloat angle, IlBoolean)
zoomView(Object view, IlvPoint center, Float scaleX, Float scaleY) Void zoomView(const IlvView* view, const IlvPoint& center, IlFloat scaleX, IlFloat scaleY, IlBoolean)
fitTransformerToContents(Object view, Boolean ratio) Void fitTransformerToContents(const IlvView* view, IlBoolean, IlBoolean ratio)
ensureVisible(Object view, IlvPoint point) Void ensureVisible(IlvView* view, const IlvPoint& point)
setBackground(Object view, String color, String bitmap) Void setBackground(IlvView* view, IlvColor* color, IlvBitmap* bitmap)
useDoubleBuffering(Object view) Boolean isDoubleBuffering(const IlvView* view) const
setDoubleBuffering(Object view, Boolean value) Void setDoubleBuffering(const IlvView* view, IlBoolean value)
isSelectable(Object object) Boolean isSelectable(const IlvGraphic* object) const
setSelectable(Object object, Boolean value) Void setSelectable(IlvGraphic* object, IlBoolean value)
isMovable(Object object) Boolean isMoveable(const IlvGraphic* object) const
setMovable(Object object, Boolean value) Void setMoveable(IlvGraphic* object, IlBoolean value)
isResizable(Object object) Boolean isResizeable(const IlvGraphic* object) const
setResizable(Object object, Boolean value) Void setResizeable(IlvGraphic* object, IlBoolean value)
isSelected(Object object) Boolean isSelected(const IlvGraphic* object) const
setSelected(Object object, Boolean value) Void setSelected(IlvGraphic* object, IlBoolean value, IlBoolean)
deselectAll() Void deSelectAll()
align(Direction position) Void align(IlvPosition position, IlBoolean)
makeColumn(UInt delta) Void makeColumn(IlvDim delta, IlBoolean)
makeRow(UInt delta) Void makeRow(IlvDim delta, IlBoolean)
sameWidth() Void sameWidth()
sameHeight() Void sameHeight()
lastContains(IlvPoint point, Object view) Object lastContains(const IlvPoint& point, const IlvView* view) const
setInteractor(Object interactor, Object view) Void setInteractor(IlvManagerViewInteractor* i, const IlvView* view)

Constructor & Destructor Documentation

◆ IlvManager()

IlvManager::IlvManager ( IlvDisplay display,
int  layers = 2,
IlBoolean  useacc = IlTrue,
IlUShort  maxInList = IlvMaxObjectsInList,
IlUShort  maxInNode = IlvMaxObjectsInList 
)

Initializes a new instance of IlvManager.

Parameters
displayThe display. The manager uses this display to create graphic resources such as a palette to draw ghost images.
layersThe number of layers in the manager. If the application runs short of layers, the number of layers can be dynamically increased.
useaccIndicates whether to install the default accelerators. See the list of accelerators in this class description.
maxInListSpecifies how objects are stored in a layer of this manager. There are two cases: objects are stored in a simple list, or, objects are stored in a more complex structure where linear access to objects is not possible. The maxInList parameter specifies the maximum number of objects that can be stored in the list. If you try to handle more objects than the number specified, the manager automatically switches to the more complex mode.
maxInNodeThe maximum number of objects allowed in the node of a quadtree, before the node is divided into subtrees.

◆ ~IlvManager()

virtual IlvManager::~IlvManager ( )
virtual

Destructor.

Destroys all objects maintained by the manager as well as the manager itself. The destructor performs the following actions successively:

  • Abort all view interactors, by calling the abort member function on all view interactors that are installed, and then remove all interactors. The interactors themselves are not destroyed.
  • Remove and delete all installed selection hooks.
  • Remove and delete all installed event hooks.
  • Detach all views from the manager. The views themselves are not deleted.
  • Delete all the objects in all the layers.

Member Function Documentation

◆ abortReDraws()

void IlvManager::abortReDraws ( )

Resets the invalidated regions.

Aborts the current update region. You can call this function when you discover, in your update algorithm, that it is necessary to reset every region currently stored as "to be updated" (you need to refresh the whole screen, for example). This function resets the update region to empty.

◆ addAccelerator()

void IlvManager::addAccelerator ( IlvManagerAcceleratorAction  f,
IlvEventType  type,
IlUShort  buttonOrKey = 0,
IlUShort  modifiers = 0,
IlAny  userArg = 0,
IlUShort  optModifiers = 0 
)

Adds an accelerator to the manager.

Creates an IlvManagerAccelerator using the same arguments and adds it to the manager. If the accelerator already matches an action in the manager accelerator watch list (see IlvAccelerator::match()), the action in the list is replaced by the action described in the function parameters. Accelerator actions are called by the shortCut() method, which uses IlvAccelerator::trigger() to check whether an accelerator must be activated.

Parameters
fThe user function used as accelerator action.
typeThe accelerator event type.
buttonOrKeyThe accelerator event data.
modifiersThe accelerator mandatory event modifiers.
userArgThe accelerator action user argument.
optModifiersThe accelerator optional event modifiers.

◆ addCommand()

virtual void IlvManager::addCommand ( IlvCommand command)
virtual

Appends a new command to the command queue.

Parameters
commandThe command.

◆ addLayer() [1/2]

int IlvManager::addLayer ( IlvManagerLayer layer,
int  position = -1 
)

Adds a layer to the manager.

This method allows you to add instances of IlvManagerLayer subclasses.

Parameters
layerSpecifies a pointer to a layer object.
positionIndicates the layer index where this new layer is inserted. Any invalid value (such as -1 or a number greater than the number of layers) indicates that you want to create a new layer on top of all the others.

◆ addLayer() [2/2]

void IlvManager::addLayer ( int  position = -1,
IlUShort  maxInList = IlvMaxObjectsInList,
IlUShort  maxInNode = IlvMaxObjectsInList 
)

Adds a layer to the manager.

Parameters
positionIndicates the layer index where this new layer is inserted. Any invalid value (such as -1 or a number greater than the number of layers) indicates that you want to create a new layer on top of all the others.
maxInListIndicates the maximum number of graphic objects the layer can store.
maxInNodeNot documented.

◆ addObject() [1/2]

virtual void IlvManager::addObject ( const char *  name,
IlvGraphic object,
IlBoolean  redraw = IlTrue,
int  layer = -1 
)
virtual

Adds a graphic object to a manager, and then names the object.

This function is equivalent to

addObject(object, redraw, layer);
setObjectName(object, name);

If the object has a name that is already in use in the manager, the name is removed from the object. For more information, see the description of the addObject() member function.

Parameters
nameSpecifies the name to set on the object.
objectThe graphic object.
redrawIndicates whether the manager must immediately display the object.
layerSpecifies the layer index where the object must be inserted. The default value -1 indicates that the object is stored in the last (topmost) layer.
Note
See "Note" under the first addObject() member function.

Reimplemented in IlvGadgetManager.

◆ addObject() [2/2]

virtual void IlvManager::addObject ( IlvGraphic object,
IlBoolean  redraw = IlTrue,
int  layer = -1 
)
virtual

Adds an object to the manager.

If an object is inserted in a non-existent layer, the layer, as well as any intermediate ones, are automatically created. For example, by default, a manager is created with three layers (0, 1 and 2); the code

addObject(obj, IlTrue, 5);

creates layers 3, 4, and 5.

An object cannot be added to a manager more than once.

Parameters
objectThe graphic object.
redrawIndicates whether the manager must immediately display the object.
layerSpecifies the layer index where the object must be inserted. The default value -1 indicates that the object is stored in the last (topmost) layer.
Note
You can accelerate the process of storing and removing objects to and from the manager. When you call addObject() or removeObject(), tests ensure that the data structure remains consistent. These tests ensure that an object is not stored twice, or remove an object that is not stored in this manager. You can bypass these tests and accelerate the process of storing and removing objects in a manager. See the global functions IlvGetOptimizeMode() and IlvSetOptimizeMode().

Reimplemented in IlvGadgetManager.

◆ addSmartSet()

virtual IlBoolean IlvManager::addSmartSet ( IlvSmartSet set,
IlBoolean  redraw = IlTrue 
)
virtual

Adds a smartset to the manager.

This set must have a name. If there is already a smartset with the same name in the manager, the smartset set is renamed by adding 1 at the end of its name, or by incrementing the decimal value at the end of the name.

If the smartset contains objects that are not stored in this manager, they are added to the manager.

Parameters
setThe smartset.
redrawSpecifies whether the manager must redraw its contents.
Returns
IlFalse on error, that is, if the smartset contains objects located in another manager.

◆ addTransformer()

virtual void IlvManager::addTransformer ( const IlvView view,
IlvTransformer t = 0 
)
virtual

Composes a manager view transformer with another transformer.

Computes the product of the manager view transformer and t and sets the result on the view. The transformer is internally copied during this function call.

Parameters
viewThe manager view.
tThe transformer.

◆ addView()

virtual void IlvManager::addView ( IlvView view)
virtual

Adds a view to the manager.

Attaches a new view to the manager. All events are then handled by the hierarchy of interactors located in the manager.

Parameters
viewThe view.

Reimplemented in IlvGadgetManager.

◆ align()

virtual void IlvManager::align ( IlvPosition  alignment,
IlBoolean  redraw = IlTrue 
)
virtual

Aligns the selected objects.

Moves all selected objects to the given alignment parameter. The objects are aligned with the first selected object.

Parameters
alignmentCan take one of the following values: IlvLeft, IlvRight, IlvTop, IlvBottom, IlvCenter, IlvHorizontalCenter or IlvVerticalCenter.
redrawSpecifies whether the manager must redraw the invalidated regions occupied by the objects.

◆ allContains() [1/2]

IlvGraphic* const* IlvManager::allContains ( const IlvPoint p,
const IlvView view,
IlUInt count 
) const

Returns all graphic objects containing a given point.

The method does returns 0 if view is not a manager view.

Parameters
pSpecifies the point in the view coordinate system.
viewThe manager view.
countUsed to return the number of objects in the array.
Returns
An array of pointers to the objects at the given location in the view. The method takes into account the stack of layers where objects can be stored.
The returned array is stored in an IlPoolOf(Pointer) and should not be deleted or modified.

◆ allContains() [2/2]

IlvGraphic* const* IlvManager::allContains ( int  layer,
const IlvPoint p,
const IlvView view,
IlUInt count 
) const

Returns all graphic objects containing a given point in a layer.

The method does returns 0 if view is not a manager view or if layer is out of range.

Parameters
layerThe index of the manager layer.
pSpecifies the point in the view coordinate system.
viewThe manager view.
countUsed to return the number of objects in the array.
Returns
An array of pointers to the objects of the manager layer at the given location in the view. The method takes into account the stack of layers where objects can be stored.
The returned array is stored in an IlPoolOf(Pointer) and should not be deleted or modified.

◆ allInside() [1/2]

IlvGraphic* const* IlvManager::allInside ( IlUInt count,
const IlvRect rect,
const IlvTransformer t = 0 
) const

Returns all graphic objects located in a rectangle.

Parameters
countUsed to return the number of objects in the array.
rectThe rectangle.
tThe transformer.
Returns
An array of pointers to every object whose bounding box is located inside the specified rectangle (possibly transformed), regardless of whether the objects or layers in which they are stored are visible. If a transformer is specified, the method tests the intersection between the rectangle and the bounding box of the transformed object.
The returned array is stored in an IlPoolOf(Pointer) and should not be deleted or modified.

◆ allInside() [2/2]

IlvGraphic* const* IlvManager::allInside ( int  layer,
IlUInt count,
const IlvRect rect,
const IlvTransformer t = 0 
) const

Returns all graphic objects of a layer located in a rectangle.

Parameters
layerThe index of the manager layer.
countUsed to return the number of objects in the array.
rectThe rectangle.
tThe transformer.
Returns
An array of pointers to every object stored in the layer and whose bounding box is located inside the rectangle (possibly transformed), regardless of whether the objects or layers in which they are stored are visible. If a transformer is specified, the method tests the intersection between the rectangle and the bounding box of the transformed object.
The returned array is stored in an IlPoolOf(Pointer) and should not be deleted or modified.

◆ allIntersects() [1/2]

IlvGraphic* const* IlvManager::allIntersects ( IlUInt count,
const IlvRect rect,
const IlvTransformer t = 0 
) const

Returns all graphic objects intersecting a rectangle.

Parameters
countUsed to return the number of objects in the array.
rectThe rectangle.
tThe transformer.
Returns
An array of pointers to every object whose bounding box intersects the rectangle (possibly transformed), regardless of whether the objects or layers in which they are stored are visible. If a transformer is specified, the method tests the intersection between the rectangle and the bounding box of the transformed object.
The returned array is stored in an IlPoolOf(Pointer) and should not be deleted or modified.

◆ allIntersects() [2/2]

IlvGraphic* const* IlvManager::allIntersects ( int  layer,
IlUInt count,
const IlvRect rect,
const IlvTransformer t = 0 
) const

Returns all graphic objects of a layer intersecting a rectangle.

Parameters
layerThe index of the manager layer.
countUsed to return the number of objects in the array.
rectThe rectangle. If a transformer is specified, the method tests the intersection between the rectangle and the bounding box of the transformed object.
tThe transformer.
Returns
An array of pointers to every object stored in the layer and whose bounding box intersects the rectangle (possibly transformed), whether or not the objects or layers in which they are stored are visible. If a transformer is specified, the method tests the intersection between the rectangle and the transformed bounding box.
The array is stored in an IlPoolOf(Pointer) and should not be deleted or modified.

◆ applyInside() [1/2]

void IlvManager::applyInside ( IlvApplyObject  func,
IlAny  arg,
const IlvRect rect,
const IlvTransformer t = 0,
IlBoolean  redraw = IlTrue 
)

Applies a user function to graphic objects located in a rectangle.

Encapsulates a call to func(object, arg) for each graphic object whose bounding box is included in the specified rectangle. If a transformer is specified, the method tests the bounding box of the transformed objects.

Parameters
funcThe user function to apply.
argThe user argument.
rectThe rectangle.
tThe transformer.
redrawSpecifies whether the manager must redraw the invalidated regions. The invalidated regions are the areas occupied by the objects before and after the calls to the user function.

◆ applyInside() [2/2]

void IlvManager::applyInside ( int  layer,
IlvApplyObject  func,
IlAny  arg,
const IlvRect rect,
const IlvTransformer t = 0,
IlBoolean  redraw = IlTrue 
)

Applies a user function to objects of a layer located in a rectangle.

Encapsulates a call to func(object, arg) for each graphic object of a layer whose bounding box is included in the specified rectangle. If a transformer is specified, the method tests the bounding box of the transformed objects.

Parameters
layerThe index of the manager layer.
funcThe user function to apply.
argThe user argument.
rectThe rectangle.
tThe transformer.
redrawSpecifies whether the manager must redraw the invalidated regions. The invalidated regions are the areas occupied by the objects before and after the calls to the user function.

◆ applyIntersects() [1/2]

void IlvManager::applyIntersects ( IlvApplyObject  func,
IlAny  arg,
const IlvRect rect,
const IlvTransformer t = 0,
IlBoolean  redraw = IlTrue 
)

Applies a user function to graphic objects intersecting a rectangle.

Encapsulates a call to func(object, arg) for each graphic object whose bounding box intersects the specified rectangle. If a transformer is specified, the method tests the bounding box of the transformed objects.

Parameters
funcThe user function to apply.
argThe user argument.
rectThe rectangle.
tThe transformer.
redrawSpecifies whether the manager must redraw the invalidated regions. The invalidated regions are the areas occupied by the objects before and after the calls to the user function.

◆ applyIntersects() [2/2]

void IlvManager::applyIntersects ( int  layer,
IlvApplyObject  func,
IlAny  arg,
const IlvRect rect,
const IlvTransformer t = 0,
IlBoolean  redraw = IlTrue 
)

Applies a user function to objects of a layer intersecting a rectangle.

Encapsulates a call to func(object, arg) for each graphic object of a layer whose bounding box intersects the specified rectangle. If a transformer is specified, the method tests the bounding box of the transformed objects.

Parameters
layerThe index of the manager layer.
funcThe user function to apply.
argThe user argument.
rectThe rectangle.
tThe transformer.
redrawSpecifies whether the manager must redraw the invalidated regions. The invalidated regions are the areas occupied by the objects before and after the calls to the user function.

◆ applyToObject()

virtual void IlvManager::applyToObject ( IlvGraphic object,
IlvApplyObject  func,
IlAny  arg,
IlBoolean  redraw = IlTrue 
)
virtual

Applies a user function to a graphic object.

Encapsulates a call to func(object, arg). This member function ensures the stability of the internal structures of the manager. It removes the object from the quadtree, calls the user function, and then replaces the object. This allows the location to be modified without damaging the quadtree. To apply the same type of function to more objects, use one of the following IlvManager::applyToObjects() functions:

Parameters
objectThe graphic object.
funcThe user function to apply.
argThe user argument.
redrawSpecifies whether the manager must redraw the invalidated regions. The invalidated regions are the areas occupied by the objects before and after the calls to func.
Note
For all the applyTo...() member functions in this section, you must not select or remove an object within an applicative function, and calls to applyTo...() member functions should not be nested. Furthermore, when using these functions, you must not move an object from one layer to another.

◆ applyToObjects() [1/4]

virtual void IlvManager::applyToObjects ( IlUInt  count,
IlvGraphic *const *  objects,
IlvApplyFunction  func,
IlAny  arg,
IlBoolean  redraw = IlTrue 
)
virtual

Applies a user function to a set of graphic objects.

Encapsulates a call to func(arg) for each object in the specified array. The only difference with the other member function IlvManager::applyToObjects(count, objects, func, arg, redraw) is the user function prototype. In this member functionx, the user function takes only one parameter: the user argument. func is called count times; once per object in the array.

Parameters
countThe number of graphic objects in the array.
objectsThe array of graphic objects.
funcThe user function to apply.
argThe user argument.
redrawSpecifies whether the manager must redraw the invalidated regions. The invalidated regions are the areas occupied by the objects before and after the calls to the user function.

◆ applyToObjects() [2/4]

virtual void IlvManager::applyToObjects ( IlUInt  count,
IlvGraphic *const *  objects,
IlvApplyObject  func,
IlAny  arg,
IlBoolean  redraw = IlTrue 
)
virtual

Applies a user function to a set of graphic objects.

Calls IlvManager::applyToObject() for each graphic object of the specified array.

Parameters
countThe number of graphic objects in the array.
objectsThe array of graphic objects.
funcThe user function to apply.
argThe user argument.
redrawSpecifies whether the manager must redraw the invalidated regions. The invalidated regions are the areas occupied by the objects before and after the calls to the user function.

◆ applyToObjects() [3/4]

virtual void IlvManager::applyToObjects ( int  layer,
IlvApplyFunction  func,
IlAny  arg,
IlBoolean  redraw = IlTrue 
)
virtual

Applies a user function to the graphic objects of a manager layer.

Encapsulates a call to func(arg) for the specified manager layer. All the graphic objects stored in the layer are removed from the manager. Then func is called and the objects are inserted back in the layer. The difference with the other member function IlvManager::applyToObjects(layer, func, arg, redraw) is that the user function is called only once, and its prototype has only one parameter, the user argument.

Parameters
layerThe index of the manager layer.
funcThe user function to apply.
argThe user argument.
redrawSpecifies whether the manager must redraw the invalidated regions. The invalidated regions are the areas occupied by the objects before and after the calls to the user function.

◆ applyToObjects() [4/4]

virtual void IlvManager::applyToObjects ( int  layer,
IlvApplyObject  func,
IlAny  arg,
IlBoolean  redraw = IlTrue 
)
virtual

Applies a user function to all graphic objects of a manager layer.

Calls IlvManager::applyToObject() for each graphic object of the specified manager layer.

Parameters
layerThe index of the manager layer.
funcThe user function to apply.
argThe user argument.
redrawSpecifies whether the manager must redraw the invalidated regions. The invalidated regions are the areas occupied by the objects before and after the calls to the user function.

◆ applyToSelections()

void IlvManager::applyToSelections ( IlvApplyObject  func,
IlAny  arg,
IlBoolean  redraw = IlTrue 
)

Applies a user function to the selected graphic objects.

Encapsulates a call to func(object, arg) for each selected graphic object.

Parameters
funcThe user function to apply.
argThe user argument.
redrawSpecifies whether the manager must redraw the invalidated regions. The invalidated regions are the areas occupied by the objects before and after the calls to the user function.

◆ applyToTaggedObjects()

void IlvManager::applyToTaggedObjects ( const IlSymbol tag,
IlvApplyObject  func,
IlAny  arg,
IlBoolean  redraw = IlTrue 
)

Applies a user function to all graphic objects associated with a given tag.

Encapsulates a call to func(object, arg) for each graphic object associated with the specified tag.

Parameters
tagSpecifies a tag.
funcThe user function to apply.
argThe user argument.
redrawSpecifies whether the manager must redraw the invalidated regions. The invalidated regions are the areas occupied by the objects before and after the calls to the user function.
Note
For all the applyTo...() member functions, do not select or remove an object within an applicative function, and do not nest calls to applyTo...() member functions. Furthermore, when using these functions, you must not move an object from one layer to another.

◆ bufferedDraw() [1/3]

void IlvManager::bufferedDraw ( IlvView view,
const IlvGraphic object 
) const

Draws a graphic object in a manager view by means of a temporary pixmap.

Draws a graphic object in a manager view using a technique similar to double-buffering: the drawings are done in a hidden pixmap, then the pixmap is displayed in the manager view at once. Unlike with true double-buffering, the pixmap is temporary and has the size of the object bounding box, not the whole view.

Parameters
viewThe manager view.
objectThe graphic object.

◆ bufferedDraw() [2/3]

void IlvManager::bufferedDraw ( IlvView view,
const IlvRect rect 
) const

Redraws a rectangular area of a manager view by means of a temporary pixmap.

Redraws a rectangular area of a manager view using a technique similar to double buffering: the drawings are done in a hidden pixmap, and then the pixmap is displayed in the manager view immediately. Unlike true double buffering, the pixmap is temporary and has the size of the rectangle, not the whole view.

Parameters
viewThe manager view.
rectThe rectangle in the manager view coordinate system.

◆ bufferedDraw() [3/3]

void IlvManager::bufferedDraw ( IlvView view,
const IlvRegion region 
) const

Redraws a region of a manager view by means of a temporary pixmap.

Redraws a region of a manager view using a technique similar to double buffering: the drawings are done in a hidden pixmap, and then the pixmap is displayed in the manager view immediately. Unlike true double buffering, the pixmap is temporary and has the size of the bounding box of the region, not the whole view.

Parameters
viewThe manager view.
regionThe region in the manager view coordinate system.

◆ computeBBox() [1/2]

void IlvManager::computeBBox ( IlvRect bbox,
const IlvTransformer t = 0 
) const

Computes the bounding box of all the objects stored in all the visible layers.

If a transformer is specified, the returned rectangle is the bounding box of the transformed objects.

Parameters
bboxUsed to return the bounding box.
tThe transformer.

◆ computeBBox() [2/2]

void IlvManager::computeBBox ( IlvRect bbox,
const IlvView view 
) const

Computes the bounding box of all the objects.

Computes the bounding box of all the objects stored in all the visible layers in the specified manager view. If a transformer is associated with the view, the returned rectangle is the bounding box of the transformed objects.

Parameters
bboxUsed to return the bounding box.
viewThe manager view.

◆ contentsChanged()

virtual void IlvManager::contentsChanged ( )
virtual

Called automatically by the manager each time objects are created, removed, moved, or resized in the manager.

The default implementation of this member function sets the manager state to a modified state (see the IlvManager::isModified() and IlvManager::setModified() member functions). If the function IlvSetContentsChangedUpdate() allows it, the method calls each IlvManagerViewHook::contentsChanged() member function of any existing hooks connected to the managed views.

◆ copy()

virtual char* IlvManager::copy ( IlUInt count)
virtual

Saves all the selected graphic objects in a string.

Returns
The string where the selected objects have been saved. When the returned string is no longer useful, the caller must delete it by using the C++ operator delete [].
Parameters
countIndicates the length of the returned string in bytes.

◆ copyToClipboard()

void IlvManager::copyToClipboard ( )

Saves the selected graphic objects in the clipboard.

Copies all the selected objects in the clipboard. It uses the copy() member function.

◆ createInputFile()

virtual IlvManagerInputFile* IlvManager::createInputFile ( std::istream &  stream)
virtual

Creates an IlvManagerInputFile from an input stream.

This method can be overloaded by subclasses, allowing them to create an IlvManagerInputFile subclass adapted to their needs.

Parameters
streamThe input stream.
Returns
An instance of IlvManagerInputFile, or a subclass.

◆ createOutputFile()

virtual IlvManagerOutputFile* IlvManager::createOutputFile ( std::ostream &  stream) const
virtual

Creates an IlvManagerOutputFile from an output stream.

This method can be overloaded by subclasses, allowing them to create an IlvManagerOutputFile subclass adapted to their needs.

Parameters
streamThe output stream.
Returns
An instance of IlvManagerOutputFile, or a subclass. The implementation for the IlvManager class is:
IlvManager::createOutputFile(ostream& stream) const
{
return new IlvManagerOutputFile(stream, this);
}

◆ cut()

virtual char* IlvManager::cut ( IlUInt count)
virtual

Saves the selected graphic objects in a string and then deletes them.

Returns
The string where the selected objects have been saved. When the returned string is no longer useful, the caller must delete it by using the C++ operator delete [].
Parameters
countIndicates the length of the returned string in bytes.

◆ cutToClipboard()

void IlvManager::cutToClipboard ( )

Saves the selected graphic objects in the clipboard and deletes them.

Cuts all the selected objects in the clipboard. It uses the cut() member function.

◆ deleteAll() [1/2]

virtual void IlvManager::deleteAll ( IlBoolean  destroy,
IlBoolean  redraw 
)
virtual

Removes all the graphic objects from the manager.

Parameters
destroyIndicates whether the manager must delete the objects
redrawIndicates whether the manager must redraw its views after removing them.

◆ deleteAll() [2/2]

virtual void IlvManager::deleteAll ( int  layer,
IlBoolean  destroy,
IlBoolean  redraw 
)
virtual

Removes all the objects stored in a specified layer of the manager.

Parameters
layerThe index of the manager layer.
destroyIndicates whether the manager must delete the objects after removing them.
redrawIndicates whether the manager must redraw the views attached to it.

◆ deleteSelections()

virtual void IlvManager::deleteSelections ( IlBoolean  redraw = IlTrue)
virtual

Removes the selected objects from the manager and deletes them if undo is disabled.

By default, undo is enabled.

Parameters
redrawSpecifies whether the manager must refresh its views.

◆ deSelectAll()

virtual void IlvManager::deSelectAll ( IlBoolean  redraw = IlTrue)
virtual

Deselects the selected graphic objects.

Deselects all previously selected objects.

Parameters
redrawSpecifies whether the manager must refresh its views.

◆ disableRedrawTask()

void IlvManager::disableRedrawTask ( )

Deactivates the lazy redraw mechanism.

This function prevents the lazy redraw task from happening when the process is idle.

Any subsequent call to invalidateRegion() will restore the lazy redraw mechanism and reschedule a redraw task.

◆ dispatchToObjects()

virtual IlBoolean IlvManager::dispatchToObjects ( IlvEvent ,
IlvView  
)
virtual

Dispatches an event to the appropriate graphic objects.

Called by the manager event handler for every incoming user event when no view interactor was set in the view where the event occurred. It checks whether there is an object under the cursor. If there is one and if it is associated with an interactor, the event handler propagates the event to the interactor.

Returns
IlTrue if the object interactor handled the event. If there is no object under the pointer or if its object interactor cannot handle the event, the returned value is IlFalse.

Reimplemented in IlvGadgetManager.

◆ draw() [1/4]

void IlvManager::draw ( ) const

Draws the contents of the manager.

Draws all visible graphic objects of the manager in all managed views.

◆ draw() [2/4]

void IlvManager::draw ( IlvPort dst,
const IlvTransformer t = 0,
const IlvRegion region = 0,
const IlvRegion clip = 0 
) const

Draws the contents of a manager in a destination port.

Draws visible graphic objects of the manager in the specified destination port. An affine transformation can be specified by the transformer. Only visible objects in visible layers are affected by this drawing request. These objects must be at least partially located inside the region specified by the region parameter. If this parameter is set to 0, all objects on all visible layers are drawn. Also, the drawing is restricted to the clipping region, if any.

The possibility of drawing directly to an IlvPort instead of an IlvView was implemented for the dump module when you need to explicitly set the clipping region. The other member functions IlvManager::draw() would clip the clipping region with the visible part of the destination view.

Parameters
dstThe destination port.
tThe transformer.
regionOnly objects intersecting this region are drawn.
clipThe clipping region.

◆ draw() [3/4]

virtual void IlvManager::draw ( IlvView view,
IlBoolean  erase,
const IlvRegion clip = 0 
) const
virtual

Draws the graphic objects of the manager in a manager view.

The drawing is restricted to the area of the clipping region, if any. Only the visible layers for this view and the visible objects on these layers are drawn. If the view is not associated with this manager, nothing is done.

Parameters
viewThe manager view.
eraseIndicates whether the view (or the clipping region in the view) must be erased before drawing (see IlvAbstractView::erase()).
clipThe clipping region. 0 means that the drawing is not clipped.

◆ draw() [4/4]

void IlvManager::draw ( int  layer,
IlvPort dst,
const IlvTransformer t = 0,
const IlvRegion region = 0,
const IlvRegion clip = 0 
) const

Draws the contents of a manager layer in a destination port.

Draws visible graphic objects of a given manager layer in the specified destination port. An affine transformation can be specified by the transformer. To be drawn, an object must be at least partially located inside the region specified by the region parameter. If this parameter is set to 0, all objects on all visible layers are drawn. Also, the drawing is restricted to the clipping region.

Parameters
layerThe index of the manager layer.
dstThe destination port.
tThe transformer.
regionOnly objects intersecting this region are drawn.
clipThe clipping region.

◆ duplicate()

virtual void IlvManager::duplicate ( IlvPos  dx = 0,
IlvPos  dy = 0 
)
virtual

Duplicates the selected graphic objects.

Copies the selected objects and adds them to the manager. The copied objects are translated from their original positions.

Parameters
dxThe translation offset along the horizontal axis.
dyThe translation offset along the vertical axis.

◆ duplicateSmartSet()

virtual IlvSmartSet* IlvManager::duplicateSmartSet ( IlvSmartSet set,
IlvPos  dx = 0,
IlvPos  dy = 0 
)
virtual

Makes a copy of a smartset.

set must be stored in this manager. The objects are duplicated, keeping their intrinsic names and interactors. The new smartset has the same geometry as the original but can be translated if the horizontal and vertical offsets are specified.

Parameters
setThe original smartset.
dxThe horizontal translation offset.
dyThe vertical translation offset.
Returns
The copy of the original smartset. The returned smartset has a name built from the name of the original smartset, modified by the call to addSmartSet().

◆ ensureVisible() [1/2]

void IlvManager::ensureVisible ( IlvView view,
const IlvPoint point 
)

Translates the contents of a manager view in order to make a given location visible.

Applies a translation to the manager view transformer to scroll the graphic objects, so that a given location becomes visible. If the location is already visible (in the boundaries of the view), nothing is done.

Special case: A view is scrollable if it is the child of an IlvScrollView (and not IlvScrolledView). In this case, the view transformer is not changed and the view is scrolled instead.

The redraw is performed automatically.

The method does nothing if the view is not a manager view.

Parameters
viewThe manager view.
pointThe point in the view coordinate system.

◆ ensureVisible() [2/2]

void IlvManager::ensureVisible ( IlvView view,
const IlvRect rect 
)

Translates the contents of a manager view in order to make a given rectangle visible.

Applies a translation to the transformer of the manager view to scroll the graphic objects, so that the four corners of the specified rectangle become visible. If they are already visible, nothing is done. If the rectangle is wider than the view, the rectangle will be horizontally centered. If the rectangle is higher than the view, it will be vertically centered. Special case: A view is scrollable if it is the child of an IlvScrollView (and not IlvScrolledView). In this case, the view transformer is not changed and the view is scrolled instead.

The redraw is performed automatically.

The method does nothing if the view is not a manager view.

Parameters
viewThe manager view.
rectThe rectangle in the view coordinate system.

◆ eraseRegion()

virtual void IlvManager::eraseRegion ( IlvView view,
const IlvRegion region 
) const
virtual

Erases a region of a manager view.

Parameters
viewThe manager view.
regionThe region in the manager view coordinate system.

◆ filteredLastContains() [1/2]

IlvGraphic* IlvManager::filteredLastContains ( const IlvPoint p,
const IlvView view,
const IlvGraphicFilter &  f 
) const

Returns the graphic object containing a given point.

The method returns 0 if view is not a manager view.

The method takes into account the stack of layers in which objects are stored. The manager returns the object on the top of the stack.

Parameters
pSpecifies the point in the view coordinate system.
viewThe manager view.
fThe filter function.
Returns
A pointer to the object at the given location in the view. The object must be accepted by the filter function.

◆ filteredLastContains() [2/2]

IlvGraphic* IlvManager::filteredLastContains ( int  layer,
const IlvPoint p,
const IlvView view,
const IlvGraphicFilter &  f 
) const

Returns the graphic object containing a given point in a layer.

The method returns 0 if view is not a manager view or if layer is out of range.

Parameters
layerThe index of the manager layer.
pSpecifies the point in the view coordinate system.
viewThe manager view.
fThe filter function.
Returns
A pointer to the object of the manager layer at the given location in the view. The object must be accepted by the filter function.

◆ firstIntersects() [1/2]

IlvGraphic* IlvManager::firstIntersects ( const IlvRegion tr,
const IlvTransformer t 
) const

Returns the first object intersecting a region.

Parameters
trThe (transformed) region.
tThe transformer.
Returns
A pointer to the first object whose bounding box intersects the region when the object is transformed.

◆ firstIntersects() [2/2]

IlvGraphic* IlvManager::firstIntersects ( int  layer,
const IlvRegion tr,
const IlvTransformer t 
) const

Returns the first object of a layer intersecting a region.

Parameters
layerThe index of the manager layer.
trThe (transformed) region.
tThe transformer.
Returns
A pointer to the first object of the layer whose bounding box intersects the region when the object is transformed.

◆ fitToContents()

void IlvManager::fitToContents ( IlvView view)

Resizes a manager view to fit the bounding box of the graphic objects.

Resizes the view associated with this manager, so that it contains every object stored in all the visible layers. The new size of the view is computed with the current transformer.

The method does nothing if view is not a manager view.

Parameters
viewThe manager view.

◆ fitTransformerToContents()

void IlvManager::fitTransformerToContents ( const IlvView view,
IlBoolean  redraw = IlTrue,
IlBoolean  ratio = IlFalse 
)

Rescales the contents of a manager view to fit in the view.

Applies a scaling factor and a translation to the manager view transformer so that the manager fits in the boundaries of the view. The view is not resized itself. The horizontal scaling factor is such that the width of the transformed bounding box of the objects is the view width. Similarly, the vertical scaling factor is such that the height of the transformed bounding box of the objects is the view height. Only objects in visible layers are taken into account.

The computation of scaling factors is not always accurate: it assumes that the bounding box of a transformed graphic object is equal to the transformed bounding box, which is not true for non-zoomable objects. If there are such objects in the manager, several calls to the method may be necessary to obtain the desired result.

The method does nothing if view is not a manager view.

Parameters
viewThe manager view.
redrawIndicates whether the manager must redraw the objects in the view after the transformation.
ratioIf IlTrue, horizontal and vertical scaling factors are equal, thereby preserving the x/y ratio.

◆ flushRedraw()

virtual void IlvManager::flushRedraw ( )
virtual

Performs the actual redraw of invalid regions.

This function is called as an idle procedure just before a process becomes idle to handle all pending drawing tasks accumulated by calls to invalidateRegion(). You can call it if you want to force the refresh of your views at a given point in your program, if the redraw task has not been disabled.

See also
IlvEventLoop::addIdleProc().

◆ forgetUndo()

void IlvManager::forgetUndo ( )

Resets the undo command queue.

Empties the command queue of the manager. Call this function whenever a command that cannot be undone is applied to the manager objects. In this case, the manager can no longer undo previous commands.

◆ Get()

static IlvManager* IlvManager::Get ( const IlvView view)
static

Returns the manager connected to the specified view, if any.

Parameters
viewThe view.
Returns
A pointer to the manager connected to view if any, 0 otherwise.
See also
IlvManager::addView().

◆ getAccelerator()

IlBoolean IlvManager::getAccelerator ( IlvManagerAcceleratorAction f,
IlAny userArg,
IlvEventType  type,
IlUShort  buttonOrKey = 0,
IlUShort  modifiers = 0 
)

Gets an accelerator action matching an event description.

Looks for a manager accelerator matching an event description. If one is found and if the action and userArg parameters are not 0, these parameters are used to return the accelerator action and user argument.

Parameters
fUsed to return the accelerator action.
userArgUsed to return the action argument.
typeThe event type.
buttonOrKeyThe event data.
modifiersThe event modifiers.
Returns
IlTrue if a matching accelerator is found and IlFalse otherwise.

◆ getCardinal() [1/2]

IlUInt IlvManager::getCardinal ( ) const

Returns the number of graphic objects.

Returns
The total number of graphic objects stored in this manager.

◆ getCardinal() [2/2]

IlUInt IlvManager::getCardinal ( int  layer) const

Returns the number of graphic objects in a layer.

Returns
The number of objects stored in a manager layer.
Parameters
layerThe index of the layer.

◆ getCommandHistory()

IlvCommandHistory* IlvManager::getCommandHistory ( ) const

Returns the object which handles the stack of commands.

Returns
The object which handles a stack of commands that are applied to objects held by a manager and lets you undo and redo these commands.

◆ getCreatorPalette()

IlvPalette* IlvManager::getCreatorPalette ( ) const

Gets the default palette used to create graphic objects interactively.

Returns
The palette used to create new objects interactively using the predefined interactors. These interactors call this member function to give a palette to graphic object constructors.

◆ getDisplay()

IlvDisplay* IlvManager::getDisplay ( ) const

Returns the display.

Returns
The IlvDisplay object for which this manager was built.

◆ getFirstView()

IlvView* IlvManager::getFirstView ( ) const

Returns the first view associated with the manager.

Returns
A pointer to the first view managed by the manager, if there is one. Otherwise it returns 0.

◆ getGrid()

IlvManagerGrid* IlvManager::getGrid ( const IlvView view) const

Returns the manager grid associated with a manager view.

Returns
The IlvManagerGrid object associated with the manager view. It returns 0 if no grid is applied to the view.

◆ getInsertionLayer()

int IlvManager::getInsertionLayer ( ) const

Gets the default layer used to store the graphic objects created interactively.

Returns
The layer where new objects created interactively using the predefined interactors are stored. These interactors call this member function before inserting new objects in the manager with addObject().

◆ getInteractor()

IlvManagerViewInteractor* IlvManager::getInteractor ( const IlvView view) const

Returns the view interactor associated with a manager view.

Parameters
viewThe manager view.
Returns
The view interactor associated with the manager view, and 0 if there is none.

◆ getLayer()

int IlvManager::getLayer ( const IlvGraphic object) const

Returns the manager layer containing a given graphic object.

Parameters
objectThe graphic object.
Returns
The index of the layer where the graphic object is stored. If the object is not found in any layer, the returned value is -1.

◆ getLayerIndex()

int IlvManager::getLayerIndex ( const IlvManagerLayer layer) const

Returns the index of a manager layer instance.

Parameters
layerThe layer that is inspected.
Returns
The index of the manager layer.
Note
Layers are handled by a specific class, IlvManagerLayer, which is not described in this manual.
Layers can be accessed by their index, or by their instance (a pointer to an IlvManagerLayer object).

◆ getManager()

static IlvManager* IlvManager::getManager ( const IlvGraphic object)
static

Gets the manager holding a given graphic object.

Parameters
objectThe graphic object.
Returns
The manager where the graphic object is stored. If the object is not stored in any manager, this static member function returns 0.

◆ getManagerLayer() [1/2]

IlvManagerLayer* IlvManager::getManagerLayer ( const IlvGraphic object) const

Returns the IlvManagerLayer instance of a graphic object.

Returns
The layer where the graphic object is stored.
Parameters
objectThe graphic object.
Note
Layers are handled by a specific class, IlvManagerLayer, which is not described in this manual. Layers can be accessed by their index specification, or by their instance (a pointer to an IlvManagerLayer object). When you change the order of layers in a manager, you lose their original index specifications. The pointer, however, remains the same and you can keep track of the layers by using it.

◆ getManagerLayer() [2/2]

IlvManagerLayer* IlvManager::getManagerLayer ( int  index) const

Returns the IlvManagerLayer instance from its index.

Most of the time, manager layers are referred to by their index. However, it can be useful to get a pointer to the manager layer instance. This member function allows you to get a layer instance from its index in the manager. (See the note concerning the IlvManagerLayer class).

Parameters
indexThe index of the returned layer.
Returns
The pointer to the manager layer instance from its index.

◆ getName()

const char* IlvManager::getName ( ) const
virtual

Returns the name of the manager.

Returns
The name of the manager.

Reimplemented from IlvValueInterface.

◆ getNumLayers()

int IlvManager::getNumLayers ( ) const

Returns the number of manager layers.

Returns
The number of layers in the manager.

◆ getObject()

IlvGraphic* IlvManager::getObject ( const char *  name) const

Gets a graphic object by its name.

Parameters
nameThe object name.
Returns
The graphic object with the specified name, or 0 if no object was given this name in the manager.

◆ getObjectInteractor()

IlvManagerObjectInteractor* IlvManager::getObjectInteractor ( const IlvGraphic object) const

The object interactor associated with a graphic object.

Parameters
objectThe graphic object.
Returns
The object interactor associated with a graphic object, or 0 if there is none.

◆ getObjectName()

const char* IlvManager::getObjectName ( const IlvGraphic object) const

Returns the name of a graphic object.

Parameters
objectThe graphic object.
Returns
The name associated with the object in the manager, or 0 if the object has no name.

◆ getObjects() [1/2]

virtual IlvGraphic* const* IlvManager::getObjects ( IlUInt count) const
virtual

Returns the graphic objects stored in the manager.

Parameters
countThe number of objects returned in the array.
Returns
An array of pointers to all objects stored in this manager. The array is stored in an IlPoolOf(Pointer) and should not be deleted or modified.

This member function is rarely used, since you can implement your code by means of the member functions described in the "Applying Functions to Objects" section.

◆ getObjects() [2/2]

virtual IlvGraphic* const* IlvManager::getObjects ( int  layer,
IlUInt count 
) const
virtual

Returns the graphic objects stored in a manager layer.

Parameters
layerThe index of the layer.
countThe number of objects returned in the array.
Returns
An array of pointers to all objects stored in the specified manager layer.
The array is stored in an IlPoolOf(Pointer) and should not be deleted or modified.

This member function is rarely used, since you can implement your code by means of the member functions described in the "Applying Functions to Objects" section.

◆ getPalette()

IlvPalette* IlvManager::getPalette ( ) const

Returns the manager palette.

Returns
The IlvPalette object of the manager. The palette is dedicated to temporary drawings that provide visual feedback. For example, it is used to draw ghost images.

The draw mode of the palette is set to XOR.

◆ getReDrawMode()

IlvReDrawMode IlvManager::getReDrawMode ( ) const

Returns the redraw mode of the manager.

Returns
The current redraw mode of the manager.

◆ getSelection()

IlvDrawSelection* IlvManager::getSelection ( const IlvGraphic object) const

Returns the selection object of a graphic object.

Parameters
objectThe graphic object.
Returns
The drawn selector object (the one created when an object is selected), or 0 if the graphic object is not selected. The selector object is an internal IlvGraphic used to draw selections and test against mouse events.

◆ getSelections()

IlvGraphic* const* IlvManager::getSelections ( IlUInt count) const

Returns the selected graphic objects.

Parameters
countUsed to return the number of graphic objects in the array.
Returns
An array of pointers to the selected objects. The array is stored in an IlPoolOf(Pointer) and should not be deleted or modified.
Note
This member function should rarely be used, since the IlvManager::applyToSelections() member function is available.

◆ getSmartSet()

IlvSmartSet* IlvManager::getSmartSet ( const char *  name) const

Gets a smartset by its name.

Parameters
nameThe smartset name.
Returns
The IlvSmartSet with the specified name, or 0 if there is none.

◆ getTaggedObjects()

IlvGraphic* const* IlvManager::getTaggedObjects ( const IlSymbol tag,
IlUInt count 
) const

Returns the graphic objects associated with a given tag.

Parameters
tagSpecifies a tag.
countUsed to return the number of graphic objects in the returned array.
Returns
An array of pointers to the objects stored in the manager and associated with the specified tag, or 0 if none are found. The array is stored in an IlPoolOf(Pointer) and should not be deleted or modified.

◆ getTransformer()

IlvTransformer* IlvManager::getTransformer ( const IlvView view) const

Returns the transformer associated with a manager view.

Returns
A pointer to the transformer associated with the view.
Parameters
viewThe manager view.

◆ getView()

IlvMgrView* IlvManager::getView ( const IlvView v) const

Returns the IlvMrgView of a manager view.

Parameters
vThe view.
Returns
The instance of IlvMrgView representing the specified view.
If v is not associated with the manager, the function returns 0.

◆ getViewHooks()

IlvManagerViewHook* const* IlvManager::getViewHooks ( const IlvView view,
IlUInt count 
) const

Gets the view hooks of a manager view.

Parameters
viewThe manager view.
countUsed to return the number of view hooks in the returned array.
Returns
An array of pointers to the view hooks connected to the specified manager view. The array is stored in an IlPoolOf(Pointer) and should not be deleted or modified.

◆ getViews()

IlvView** IlvManager::getViews ( IlUInt count) const

Returns the array of views associated with the manager.

Parameters
countUsed to return the number of views in the array.
Returns
An array of pointers to all the views connected to this manager. The array is stored in an IlPoolOf(Pointer) and should not be deleted or modified.

◆ group()

virtual IlvGraphicSet* IlvManager::group ( IlUInt  count,
IlvGraphic *const *  objects 
)
virtual

Groups several graphic objects.

Creates an IlvGraphicSet object by grouping the graphic objects in the array. When objects are grouped, they lose all the manager-related information they contain (such as name, storage layer, and object interactor). You cannot retrieve this information, even when ungrouping.

Parameters
countThe number of graphic objects in the array.
objectsThe array of graphic objects.
Returns
The graphic set grouping the graphic objects.

◆ initReDraws()

void IlvManager::initReDraws ( )

Initializes the manager so that calls to invalidateRegion() can begin.

Called to initialize the manager before a series of calls to the member function invalidateRegion() begin. It empties the update region for every managed view. Calls to initReDraws() can be embedded so that the actual refresh only takes place when the last call to reDrawViews() is reached.

◆ installEventHook()

IlBoolean IlvManager::installEventHook ( const IlvManagerEventHook hook)

Installs an event hook on the manager.

The last event hook installed is the first to be called when an event occurs.

Parameters
hookThe event hook.
Returns
IlTrue on success. If the hook is already installed on a manager, this member function does nothing and returns IlFalse.

◆ installSelectionHook()

IlBoolean IlvManager::installSelectionHook ( const IlvManagerSelectionHook hook)

Sets a selection hook on the manager.

Parameters
hookThe selection hook.
Returns
IlTrue on success. If the hook is already installed on a manager, the member function does nothing and returns IlFalse.

◆ installViewHook()

void IlvManager::installViewHook ( const IlvManagerViewHook hook)

Adds a view hook to the manager.

Adds the hook to the list of handlers for the view to which the hook is attached. Previous hooks are not removed, but this one becomes the first to be called.

Parameters
hookThe manager view hook.

◆ invalidateRegion() [1/4]

void IlvManager::invalidateRegion ( const IlvGraphic object)

Invalidates the bounding box of a graphic object.

Adds the bounding box of a graphic object to the update region in every view and schedules a redraw task to happen before the process becomes idle.

Parameters
objectThe graphic object. The object must be directly held by the manager, and indirectly through an other object like an IlvGraphicSet or IlvTransformer.

◆ invalidateRegion() [2/4]

void IlvManager::invalidateRegion ( const IlvRect rect)

Invalidates a rectangle.

Adds a rectangle to the update region in every view and schedules a redraw task to happen before the process becomes idle.

Parameters
rectThe rectangle, specified in manager coordinates.

◆ invalidateRegion() [3/4]

void IlvManager::invalidateRegion ( const IlvRegionUpdater updater,
const IlvGraphic g = 0 
)

Updates the invalidated region.

Uses the updater object to update the invalidated region and schedules a redraw task to happen before the process becomes idle.

Parameters
updaterThe object used to update the invalidated region.
gAn optional parameter to specify which graphic object requests the invalidation.
See also
IlvRegionUpdater::update().

◆ invalidateRegion() [4/4]

void IlvManager::invalidateRegion ( const IlvView view,
const IlvRect rect 
)

Invalidates a rectangle in a manager view.

Adds a rectangle to the update region of the specified manager view and schedules a redraw task to happen before the process becomes idle.

Parameters
viewThe manager view.
rectThe rectangle, specified in manager coordinates.

◆ isASelection()

IlBoolean IlvManager::isASelection ( const IlvGraphic object) const

Indicates if a graphic object is a selection object.

Parameters
objectThe graphic object.
Returns
IlTrue if the object is a selection (that is, a subtype of IlvDrawSelection). Otherwise, it returns IlFalse.

◆ isDoubleBuffering()

IlBoolean IlvManager::isDoubleBuffering ( const IlvView view) const

Indicates whether double buffering is used for a manager view.

Parameters
viewThe manager view.
Returns
IlTrue if double buffering is applied to the view, and IlFalse otherwise.

◆ isEditable()

IlBoolean IlvManager::isEditable ( const IlvGraphic object) const

Indicates whether a graphic object can be edited.

This property is used by the IlvSelectInteractor class to check if object can be manipulated through its selection object. This property concerns the editing operations that are not a resize (see isResizeable()) or a translation (isMoveable()).

Parameters
objectThe graphic object to test.
Returns
IlTrue if this object can be edited, and IlFalse otherwise.
See also
IlvDrawSelection::getSelectionInteractor().

◆ isInApply()

IlBoolean IlvManager::isInApply ( ) const

Indicates if an applyTo...() method is being executed.

Returns
IlTrue if it is called from within a call to any apply member function. Use this function to avoid nested calls to apply...() member functions.

◆ isInvalidating()

IlBoolean IlvManager::isInvalidating ( ) const

Indicates whether the manager is in a phase of invalidating regions.

Returns
IlTrue if the manager has scheduled some redraw task to perform when the process is idle.

◆ isKeepingAspectRatio()

IlBoolean IlvManager::isKeepingAspectRatio ( const IlvView view) const

Indicates whether a manager view preserves the x/y ratio.

Parameters
viewThe manager view.
Returns
IlTrue if the manager view automatically respects the aspect ratio (that is, the x/y ratio) when its transformer is changed. Otherwise, it returns IlFalse (which is the default). When the aspect ratio must be kept, the transformer set to view using IlvManager::setTransformer() or IlvManager::addTransformer() may be modified by the manager. This works correctly only for trivial rotations (multiple of 90 degrees).

◆ isManaged()

IlBoolean IlvManager::isManaged ( const IlvGraphic object) const

Indicates whether a graphic object is stored by the manager.

Parameters
objectThe graphic object.
Returns
IlTrue if the given graphic object is stored in the manager. Otherwise, it returns IlFalse.

◆ isModified()

IlBoolean IlvManager::isModified ( ) const

Indicates whether the manager contents have been modified.

Returns
A value indicating the state of the manager. At the beginning, when no objects have yet been modified, the method returns IlFalse. The state changes to IlTrue when an object is modified or added. This is useful for checking the manager state before leaving the application without saving the information it contains.

◆ isMoveable()

IlBoolean IlvManager::isMoveable ( const IlvGraphic object) const

Indicates if a graphic object can be moved.

Parameters
objectThe graphic object.
Returns
IlTrue if the object is moveable, and IlFalse otherwise.

◆ isResizeable()

IlBoolean IlvManager::isResizeable ( const IlvGraphic object) const

Indicates if a graphic object can be resized.

Parameters
objectThe graphic object.
Returns
IlTrue if the object can be resized, and IlFalse otherwise.

◆ isSelectable() [1/2]

virtual IlBoolean IlvManager::isSelectable ( const IlvGraphic obj) const
virtual

Indicates if a graphic object can be selected.

Returns
IlTrue if the object can be selected, and IlFalse otherwise.

◆ isSelectable() [2/2]

IlBoolean IlvManager::isSelectable ( int  layer) const

Indicates if a manager layer allows the selection of its graphic objects.

Parameters
layerThe index of the manager view.
Returns
IlTrue if the layer allows the selection of the graphic objects it stores. Otherwise, the function returns IlFalse.

◆ isSelected()

IlBoolean IlvManager::isSelected ( const IlvGraphic obj) const

Indicates if a graphic object is selected.

Returns
IlTrue if the graphic object is selected, IlFalse otherwise.

◆ isUndoEnabled()

IlBoolean IlvManager::isUndoEnabled ( ) const

Indicates whether the manager lets you undo commands.

Returns
IlTrue if the undo process is enabled. Otherwise, it returns IlFalse.

◆ isVisible() [1/4]

IlBoolean IlvManager::isVisible ( const IlvGraphic graphic,
IlvView view 
) const

Indicates whether a graphic object is visible in a manager view.

Parameters
graphicThe graphic object that is tested.
viewThe view that is considered.
Returns
IlTrue if the object is visible in the manager view. To be considered as visible in a view, a graphic object must be visible for the manager (see isVisible(const IlvGraphic*)), and the layer it is stored in must be visible in the manager view. If any of these conditions are not verified, the method returns IlFalse.

◆ isVisible() [2/4]

IlBoolean IlvManager::isVisible ( const IlvGraphic object) const

Indicates whether a graphic object is visible.

Parameters
objectThe graphic object.
Returns
IlTrue if the graphic object can be visible (that is, displayed at draw time by the manager), or IlFalse if the object cannot be visible.

◆ isVisible() [3/4]

IlBoolean IlvManager::isVisible ( const IlvView view,
int  layer 
) const

Indicates the visibility of a layer in a manager view.

The visibility of a layer has two levels: a global level for the manager, and a local level stored by each manager view. A layer is considered to be visible in a manager view if it is visible both for the manager and for the view.

Parameters
viewThe manager view.
layerThe index of the layer.
Returns
IlTrue if the layer is visible for both the manager and the manager view.

◆ isVisible() [4/4]

IlBoolean IlvManager::isVisible ( int  layer) const

Indicates whether a layer is considered visible by the manager.

Parameters
layerThe index of the layer.
Returns
IlTrue if the layer is visible from the manager point of view. The layer may still be hidden in a manager view.

◆ lastContains() [1/2]

virtual IlvGraphic* IlvManager::lastContains ( const IlvPoint p,
const IlvView view 
) const
virtual

Returns the graphic object containing a given point.

The method returns 0 if view is not a manager view.

The method takes into account the stack of layers in which objects are stored. The manager returns the object on the top of the stack.

Parameters
pSpecifies the point in the view coordinate system.
viewThe manager view.
Returns
A pointer to the object at the given location in the view.

◆ lastContains() [2/2]

IlvGraphic* IlvManager::lastContains ( int  layer,
const IlvPoint p,
const IlvView view 
) const

Returns the graphic object containing a given point in a layer.

Parameters
layerThe index of the manager layer.
pSpecifies the point in the view coordinate system.
viewThe manager view.
Returns
A pointer to the object of the manager layer at the given location in the view. Returns 0 if layer is out of range, or if view is not a manager view, or if there is no object at the specified location.

◆ makeColumn()

virtual void IlvManager::makeColumn ( IlvDim  spacing = 0,
IlBoolean  redraw = IlTrue 
)
virtual

Arranges the selected graphic objects in a column.

Builds a column by moving all the selected objects in the order in which they were selected.

Parameters
spacingSpecifies the vertical distance between objects.
redrawSpecifies whether the manager must redraw the invalidated regions occupied by the objects.

◆ makeRow()

virtual void IlvManager::makeRow ( IlvDim  spacing = 0,
IlBoolean  redraw = IlTrue 
)
virtual

Arranges the selected graphic objects in a row.

Builds a row by moving all the selected objects in the order in which they were selected. The spacing parameter is the horizontal distance between objects.

Parameters
spacingSpecifies the horizontal distance between objects.
redrawSpecifies whether the manager must redraw the invalidated regions occupied by the objects.

◆ moveObject()

void IlvManager::moveObject ( IlvGraphic object,
IlvPos  x,
IlvPos  y,
IlBoolean  redraw = IlTrue 
)

Moves a graphic object.

Moves the upper left corner of a graphic object to the specified coordinates expressed in the object coordinate system.

This member function performs a call to translateObject().

Parameters
objectThe graphic object.
xThe new horizontal coordinate.
yThe new vertical coordinate.
redrawSpecifies whether the manager must redraw the invalidated regions occupied by the object.

◆ numberOfSelections()

IlUInt IlvManager::numberOfSelections ( ) const

Returns the number of selected graphic objects.

Returns
The number of selected objects in the manager.

◆ paste()

virtual void IlvManager::paste ( const IlvView view,
const char *  str,
IlvPoint location 
)
virtual

Reads graphic objects from a string.

Reads a set of objects from the specified string and adds them to the manager at a given location. The string may be considered as the contents of a Rogue Wave Views data file.

Parameters
viewThe manager view.
strThe string containing the object descriptions.
locationSpecifies, in the view coordinate system, the top-left corner of the bounding box of all the new graphic objects.

◆ pasteFromClipboard()

void IlvManager::pasteFromClipboard ( const IlvView view,
IlvPoint location 
)

Reads graphic objects from the clipboard and adds them to the manager.

Reads a set of graphic objects from the clipboard and adds them to the manager at a given location. It uses the paste() member function.

Parameters
viewThe manager view.
locationSpecifies, in the view coordinate system, the top-left corner of the bounding box of all the new graphic objects.

◆ pop()

virtual void IlvManager::pop ( IlvGraphic object,
IlBoolean  redraw = IlTrue 
)
virtual

Moves a graphic object higher in the drawing stacking order.

Gives the object a higher display priority. To perform this, the manager behaves differently depending on how the object is stored:

  • The object is stored in a complex data structure.The object is moved to an upper layer, if there is one (otherwise, no further action is performed).
  • The object is stored in a list (that is, the number of the object in the layer is less than the maxInList parameter of the constructor for this manager). The object is moved to the end of the list, so that it will be displayed last.
Parameters
objectThe graphic object.
redrawSpecifies whether the manager must redraw the invalidated region occupied by the object.

◆ push()

virtual void IlvManager::push ( IlvGraphic object,
IlBoolean  redraw = IlTrue 
)
virtual

Moves a graphic object lower in the drawing stacking order.

Gives the object a lower display priority. Depending on whether the object is stored in a list or a more complex data structure (see the explanations of the member function pop()), the object is moved to the beginning of the layer object list, or to a lower layer, if there is one.

Parameters
objectThe graphic object.
redrawSpecifies whether the manager must redraw the invalidated region occupied by the object.

◆ read() [1/2]

virtual void IlvManager::read ( const char *  filename)
virtual

Loads a Rogue Wave Views data file.

Reads a set of graphic objects from the file named filename. The function calls the other member function IlvManager::read() with a stream as argument. Read success status must be checked in the manager's holder. The file is properly loaded if manager->getHolder()->getError() == 0.

Parameters
filenameThe file name. If it is a relative path, the file is searched for in each directory referenced in the display path.
Note
Unix platforms may not be able to correctly read files that have been generated under Windows in text mode. See the IlvManager::save() member function for more information.
Both the IlvEdit and Studio editors use the text mode.

◆ read() [2/2]

virtual void IlvManager::read ( std::istream &  stream)
virtual

Reads a set of graphic objects from the specified input stream.

The function creates an instance of IlvManagerInputFile from the stream and calls the IlvManagerInputFile::readAll() member function. Read success status must be checked in the manager's holder. The stream is properly loaded if manager->getHolder()->getError() == 0.

Parameters
streamThe input stream.

◆ reDo()

virtual void IlvManager::reDo ( IlBoolean  unused)
virtual

Executes again the last canceled command.

Parameters
unusedThis parameter is not used. It has been added to force an compilation error for the users of Views 5.1.x or previous. Because this function has been replaced by the repeat() function to enable to the reDo() function have the proper behaviour.

◆ reDraw() [1/3]

void IlvManager::reDraw ( ) const

Erases all manager views and draws the contents of the manager.

Erases all the managed views and then calls the first member function IlvManager::draw().

◆ reDraw() [2/3]

void IlvManager::reDraw ( const IlvGraphic object,
IlBoolean  erase = IlTrue 
) const

Draws a graphic object in all manager views.

Parameters
objectThe graphic object.
eraseIndicates whether the object bounding box must be erased before the object is drawn.

◆ reDraw() [3/3]

void IlvManager::reDraw ( IlUInt  count,
const IlvGraphic *const *  objects,
IlBoolean  erase = IlTrue 
) const

Draws a set of graphic objects in all manager views.

Draws all the graphic objects of the specified array in all managed views.

Parameters
countThe number of graphic objects in the array.
objectsThe array of graphic objects.
eraseIndicates whether each object bounding box must be erased before the objects are drawn.

◆ reDrawViews()

void IlvManager::reDrawViews ( IlBoolean  erase = IlTrue)

Draws the invalidated regions.

Draws the update region in all the manager views. The update region is the sum of all the areas specified in previous calls to invalidateRegion().

Parameters
eraseIndicates whether invalidated regions must be erased before drawing.

◆ registerCallback()

void IlvManager::registerCallback ( const char *  callbackName,
IlvGraphicCallback  callback 
)

Registers a callback and its name.

Associates the user callback function with a string that will be used as its name. This string will be registered using the IlSymbol class.

Parameters
callbackNameThe character string.
callbackThe user function.

◆ removeAccelerator()

void IlvManager::removeAccelerator ( IlvEventType  type,
IlUShort  buttonOrKey = 0,
IlUShort  modifiers = 0 
)

Removes the accelerator matching the event description.

Looks for an accelerator matching the event description and removes it from the manager event handler. Managers have built-in accelerators, which are listed below. You can disconnect them by setting the accelerators parameter of the manager constructor to IlFalse.

- Predefined accelerators for managers -

Event Type

Key or button

Action

IlvKeyUpf Modifies the zoom factor of the view so that all objects can be seen (f for fit)
IlvKeyUpF Fits and preserves ratio
IlvKeyUpi/td> Sets the transformer of the view to the identity matrix.
IlvKeyUpp Moves selected objects to an upper layer.
IlvKeyUpP Moves selected objects to a deeper layer.
IlvKeyUpCtrl-D Duplicates all selected objects and moves the copied object slightly.
IlvKeyUpCtrl-A Selects all objects
IlvKeyUpCtrl-S Selects the object designated by the pointing device.
IlvKeyUp<Del> Deletes all selected objects.
IlvKeyDownr Re-executes last command.
IlvKeyDownu Undoes last command.
IlvKeyUpCtrl-G Groups selected objects into one.
IlvKeyUpCtrl-U Ungroups an IlvGraphicSet.
IlvKeyDown<Right> Translates the view to the left.
IlvKeyDown<Left> Translates the view to the right.
IlvKeyDown<Down> Translates the view to the top.
IlvKeyDown<Up> Translates the view to the bottom.
IlvKeyUpZ Zooms into the view.
IlvKeyUpU Zooms out of the view.
IlvKeyUpCtrl-B Deselects all objects.
IlvKeyUpCtrl-T Inverts all selected objects.
IlvKeyUpY Horizontally flips the selected objects.
IlvKeyUpy Vertically flips the selected objects.
IlvKeyUp.(dot) Flips the selected objects both horizontally and vertically.
IlvKeyUpCtrl-C Copies selected objects into the clipboard.
IlvKeyDownCtrl-V Inserts objects from the clipboard.
IlvKeyUpCtrl-X Deletes selected objects but saves them into the clipboard.
IlvKeyDownR Rotates the view 90 degrees counter-clockwise.
IlvKeyDownC Centers the view on the indicated point.
IlvKeyUpT Encapsulates relevant object in an IlvTransformedGraphic.

Parameters
typeThe event type.
buttonOrKeyThe event data.
modifiersThe event modifiers.

◆ removeAccelerators()

void IlvManager::removeAccelerators ( )

Removes all accelerators.

This method removes all accelerators from the manager.

◆ removeEventHook()

IlvManagerEventHook* IlvManager::removeEventHook ( const IlvManagerEventHook hook)

Removes and returns an event hook installed on the manager.

You can then delete the returned value if it is no longer needed, or install the hook on another manager.

Parameters
hookThe manager hook.
Returns
The hook if it was installed on the manager. Otherwise the returned value is 0.

◆ removeInteractor()

void IlvManager::removeInteractor ( const IlvView view)

Removes the view interactor from a manager view.

The interactor is detached from the view. All events occuring in the view are then handled by the object interactors and accelerators (if they exist). This method removes all references to the view in the interactor.

Parameters
viewThe manager view.

◆ removeLayer()

void IlvManager::removeLayer ( int  layer = -1)

Removes a layer from the manager.

Removes a layer from the manager and deletes all the graphic objects stored in this layer. A manager cannot have less than two layers.

Parameters
layerIndicates the index of the layer to remove. Any invalid value (such as -1 or a number greater than the number of layers) indicates that you want to remove the last (topmost) layer.

◆ removeObject()

virtual IlBoolean IlvManager::removeObject ( IlvGraphic object,
IlBoolean  redraw = IlTrue,
IlBoolean  destroyIt = IlTrue 
)
virtual

Removes a graphic object from the manager set.

When the object is removed from the manager, all the properties related to the manager are removed. However, the other properties (for example, the object name, its named properties, and so on) remain attached to the object itself.

Parameters
objectThe graphic object.
redrawIndicates whether the manager must immediately redraw the area occupied by the object.
destroyItIndicates whether the manager must delete the object after removing it.
Returns
IlFalse on error (the object cannot be removed) and IlTrue on success.
Note
See "Note" under the first addObject() member function.

◆ removeSelectionHook()

IlvManagerSelectionHook* IlvManager::removeSelectionHook ( const IlvManagerSelectionHook hook)

Removes the selection hook from the manager, if it is installed.

If the hook is not installed on a manager, the member function does nothing.

Parameters
hookThe selection hook.
Returns
The specified selection hook, if it was installed, and 0 otherwise. You can delete the returned value if it is no longer needed, or install the hook on another manager.

◆ removeSmartSet()

virtual IlBoolean IlvManager::removeSmartSet ( IlvSmartSet set)
virtual

Removes a smartset from the manager.

The objects are renamed to their intrinsic name.

Parameters
setThe smartset.
Returns
IlFalse on error, that is, if the smartset is not in this manager.

◆ removeTaggedObjects()

void IlvManager::removeTaggedObjects ( const IlSymbol tag,
IlBoolean  redraw = IlTrue 
)

Removes graphic objects associated with a given tag.

Removes from the manager all the objects associated with the specified tag.

Parameters
tagSpecifies a tag.
redrawSpecifies whether the manager must redraw the invalidated regions occupied by the objects.

◆ removeView() [1/2]

IlBoolean IlvManager::removeView ( IlvMgrView v)

Removes the IlvMrgView from the manager.

Parameters
vThe IlvMgrView to remove. Please note that IlvMgrView passed to this function will be deleted. Do not use the pointer after calling this function.
Returns
IlTrue if the view was removed. Otherwise, it returns IlFalse.

◆ removeView() [2/2]

virtual IlBoolean IlvManager::removeView ( IlvView view)
virtual

Removes a view from the manager view list.

The view is no longer handled by the manager.

Parameters
viewThe manager view.
Returns
IlTrue on success, and IlFalse on error (the view could not be detached).

Reimplemented in IlvGadgetManager.

◆ removeViewHook()

void IlvManager::removeViewHook ( const IlvManagerViewHook hook)

Removes a view hook from the manager.

Disconnects the hook from the manager view to which the hook is attached.

Parameters
hookThe manager view hook.

◆ reshapeObject()

virtual void IlvManager::reshapeObject ( IlvGraphic object,
const IlvRect bbox,
IlBoolean  redraw = IlTrue 
)
virtual

Resizes a graphic object to fit in a rectangle.

Modifies the object size so that its new bounding box becomes the specified rectangle.

Parameters
objectThe graphic object.
bboxThe rectangle.
redrawSpecifies whether the manager must redraw the invalidated regions occupied by the object.

◆ rotateView()

void IlvManager::rotateView ( const IlvView view,
const IlvPoint point,
IlFloat  angle,
IlBoolean  redraw = IlTrue 
)

Rotates the contents of a manager view.

Applies a rotation to the manager view transformer.

Parameters
viewThe manager view.
pointSpecifies the invariant point of the transformation.
angleThe rotation angle in degrees.
redrawIndicates whether the manager must redraw the objects in the view after the transformation.

◆ sameHeight()

virtual void IlvManager::sameHeight ( IlBoolean  redraw = IlTrue)
virtual

Resizes the selected graphic objects to the same height.

Makes the height of all selected objects the same as the first selected object.

Parameters
redrawSpecifies whether the manager must redraw the invalidated regions occupied by the objects.

◆ sameWidth()

virtual void IlvManager::sameWidth ( IlBoolean  redraw = IlTrue)
virtual

Resizes the selected graphic objects to the same width.

Makes the width of all selected objects the same as the first selected object.

Parameters
redrawSpecifies whether the manager must redraw the invalidated regions occupied by the objects.

◆ save()

virtual void IlvManager::save ( std::ostream &  stream) const
virtual

Saves all the graphic objects in an output stream.

The function gets the graphic objects with IlvManager::getObjects(), creates an instance of IlvManagerOutputFile from stream, and calls its IlvManagerOutputFile::saveAll() member function.

Parameters
streamThe output stream.
Note
If you are running under Windows or OS/2, and you create the stream in "text mode", Unix platforms will not be able to read the file until the carriage return character is removed by a conversion. These carriage return characters perturb the read on a Unix platform. A possible workaround is to save your data in a file that is opened in binary mode. Both the IlvEdit and Studio editors use the text mode.

◆ selectAll()

virtual void IlvManager::selectAll ( IlBoolean  redraw = IlTrue)
virtual

Selects all the objects of the manager.

Parameters
redrawSpecifies whether the manager must refresh its views.

◆ setBackground()

virtual void IlvManager::setBackground ( IlvView view,
IlvColor color,
IlvBitmap bitmap = 0 
)
virtual

Sets the background of a manager view.

Sets the color used to erase the double buffering bitmap for the view. When the view is set to double buffering mode, the color is initially updated to the background color of the view. If you change the view background color and want to set the double buffering color accordingly, call this member function with this color. If a bitmap is specified, it will be used as the background for the view; this means that it will not remain as a single image but will be tiled to the size of the manager view. To remove properly a background bitmap that was previously set, you must do the following:

view->setBackgroundBitmap(0); // Remove the background bitmap
manager->setBackground(view, view->getBackground()); // Update the manager
manager->draw(view, IlTrue); // Redraw the view
Parameters
viewThe manager view.
colorThe background color.
bitmapThe background bitmap.

Reimplemented in IlvGadgetManager.

◆ setCleanFunction()

void IlvManager::setCleanFunction ( IlvApplyObject  func)

Sets a function to be called when an object is removed from the manager.

Parameters
funcSpecifies a function to be called when an object stored in the manager is removed. This function is called with the object as the first parameter, and a user-defined parameter as a pointer to the manager. The function is called before the object is removed from the manager.

◆ setCreatorPalette()

void IlvManager::setCreatorPalette ( IlvPalette palette)

Sets the default palette used to create new graphic objects interactively.

Parameters
paletteThe palette.

◆ setDoubleBuffering()

IlBoolean IlvManager::setDoubleBuffering ( const IlvView view,
IlBoolean  useDblBuffering 
)

Enables or disables double buffering for a manager view.

Parameters
viewThe manager view.
useDblBufferingIlTrue to enable double buffering and IlFalse to disable it.
Returns
IlFalse if the view is not handled by the manager, or if useDB is set to IlTrue and the double buffering bitmap associated with view is not valid. Otherwise, it returns IlTrue.

◆ setEditable()

void IlvManager::setEditable ( IlvGraphic object,
IlBoolean  editable 
)

Indicates whether a graphic object can be edited.

Parameters
objectThe graphic object.
editableIlTrue to set the object as editable and IlFalse otherwise.

◆ setGrid()

void IlvManager::setGrid ( IlvView *const  view,
IlvManagerGrid grid 
)

Sets a manager grid on a manager view.

The grid already existing is disconnected, but not deleted.

Parameters
viewThe manager view.
gridThe manager grid. 0 is specified to disconnect the view from the current grid.

◆ setInsertionLayer()

void IlvManager::setInsertionLayer ( int  layer = -1)

Sets the layer where new objects created interactively using the predefined interactors will be stored.

Parameters
layerThe index of the layer.

◆ setInteractor()

void IlvManager::setInteractor ( IlvManagerViewInteractor i,
const IlvView view = 0 
)

Sets a view interactor on a manager view.

If the view is different from the one that was used when creating the interactor, you must first detach the interactor by using IlvManager::removeInteractor().

Parameters
iThe view interactor. 0 is not a valid value (use IlvManager::removeInteractor() to detach an interactor from a view).
viewThe manager view. If 0 is specified, the method uses the view used to create the interactor.

◆ setKeepingAspectRatio()

void IlvManager::setKeepingAspectRatio ( const IlvView view,
IlBoolean  ratio = IlTrue,
IlBoolean  redraw = IlTrue 
) const

Sets or unsets the automatic preservation of the x/y ratio in a manager view.

If you request that the aspect ratio be kept, and if the view transformer does not respect this ratio, the transformer will be recomputed accordingly.

Parameters
viewThe manager view.
ratioSet to IlTrue to respect the x/y ratio and IlFalse otherwise.
redrawIndicates whether the manager must redraw the objects in the view if the transformer is changed.

◆ setLayer()

void IlvManager::setLayer ( IlvGraphic object,
int  layer,
IlBoolean  redraw = IlTrue 
)

Moves a graphic object to a given manager layer.

Moves a graphic object from its original manager layer to the specified manager layer.

Parameters
objectThe graphic object.
layerThe index of the destination manager layer.
redrawSpecifies whether the manager must redraw the invalidated region occupied by the object.

◆ setMakeSelection()

IlvMakeSelection IlvManager::setMakeSelection ( IlvMakeSelection  func)

Sets the function that creates a selection object for a graphic object.

Changes the function called to create the graphic object that represents the selection of an object. The function func is called when an object becomes selected. The function receives a pointer to this manager, and a pointer to the object itself. It then creates a selection object (a subtype of the IlvDrawSelection graphic class) and returns a pointer to the object. This object is entirely managed by Rogue Wave Views, and removed when finished with.

The default behavior of a manager is to create an IlvDrawSelection instance (one having eight square handles) that fits the object bounding box. However, you may need to have another type of selection object. To create this new type of selection object, subtype the IlvDrawSelection class and create a function that instantiates this class depending of the type of the graphic object selected. This function is the parameter to the IlvManager::setMakeSelection() member function.

Returns
The previous function used by the manager.
Parameters
funcThe new selection function.
Note
A better way to customize the selection objects is to use the IlvSelectionInterface class. It allows you to associate different subclasses of IlvDrawSelection with different subclasses of IlvGraphic.
See also
IlvSelectionInterface.

◆ setModified()

void IlvManager::setModified ( IlBoolean  value)

Sets the modification status of the manager.

Parameters
valueIlTrue to set the manager status as modified, IlFalse to unset it.

◆ setMoveable()

void IlvManager::setMoveable ( IlvGraphic object,
IlBoolean  moveable 
)

Sets the moveability of a graphic object.

Parameters
objectThe graphic object.
moveableIlTrue to set the object as moveable, and IlFalse otherwise.

◆ setName()

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

Sets the name of the manager.

Parameters
nameThe new name. The string is copied.

◆ setNumLayers()

void IlvManager::setNumLayers ( int  numLayers)

Sets the number of manager layers.

Sets the number of layers handled by the manager to the specified value. Although there is no limit to the number of layers allowed, having a large number of layers is not recommended for reasons of efficiency. The maximum should probably not exceed 100 to 200 layers. You can use this method to add layers, but not to remove them.

Parameters
numLayersThe number of layers.

◆ setObjectInteractor()

IlBoolean IlvManager::setObjectInteractor ( IlvGraphic object,
IlvManagerObjectInteractor i 
)

Sets an object interactor on a graphic object.

If an interactor is already set on this object, it is replaced but not deleted. This way you can use it with other objects.

Parameters
objectThe graphic object.
iThe object interactor.
Returns
IlTrue if the interactor is properly associated with the object (that is, the interactor accepts the connection to the object). Otherwise, the returned value is IlFalse.

◆ setObjectName()

virtual IlBoolean IlvManager::setObjectName ( IlvGraphic object,
const char *  name 
)
virtual

Sets the name of a graphic object in the manager.

Object names must be unique in a given manager. Trying to give the same name to two different objects results in an error and the function returns IlFalse.

You can rename an object by calling setObjectName() with a different string, or you can delete an object name by setting its name to 0 when calling the function. An attempt to erase the name of an unnamed object is considered to be an error.

Parameters
objectThe graphic object.
nameThe name to set on the graphic object. The string is copied.
Returns
IlTrue on success, and IlFalse on failure.

◆ setReDrawMode()

void IlvManager::setReDrawMode ( IlvReDrawMode  reDrawMode)

Sets the redraw mode of the manager.

The redraw mode determines the way the manager redraws objects after a call to a method modifying objects, such as applyToObjects() or changeValues().

Parameters
reDrawModeCan only take the value IlvReDrawAll or IlvReDrawObjects. IlvReDrawAll indicates that all the objects of the manager intersecting the region enclosing the modified objects are redrawn. This is the default mode. IlvReDrawObjects indicates that only modified objects must be redrawn (for example, the objects passed to applyToObjects()).

◆ setResizeable()

void IlvManager::setResizeable ( IlvGraphic object,
IlBoolean  resizable 
)

Sets a graphic object as resizable or not resizable.

Parameters
objectThe graphic object.
resizableIlTrue to set the object as resizable, and IlFalse otherwise.

◆ setSelectable() [1/2]

virtual void IlvManager::setSelectable ( IlvGraphic object,
IlBoolean  selectable 
)
virtual

Sets a graphic object as selectable or not selectable.

Sets the selectable attribute of the object object to the value of selectable.

Parameters
objectThe graphic object.
selectableIlTrue to set the object as selectable, and IlFalse otherwise.

◆ setSelectable() [2/2]

void IlvManager::setSelectable ( int  layer,
IlBoolean  selectable 
)

Enables or disables the selection of graphic objects in a manager layer.

Sets the selectable attribute of the layer to the value of the selectable parameter.

Parameters
layerThe index of the manager view.
selectableIlTrue to enable the selection in the layer, and IlFalse to disable it.

◆ setSelected()

virtual void IlvManager::setSelected ( IlvGraphic object,
IlBoolean  selected = IlTrue,
IlBoolean  redraw = IlTrue 
)
virtual

Selects or deselects a graphic object.

Selects or deselects an object in the manager.

Parameters
objectThe graphic object.
selectedIlTrue if the graphic object must be selected, IlFalse otherwise.
redrawSpecifies whether the manager must redraw the invalidate region occupied by the selection object.

Reimplemented in IlvGadgetManager.

◆ setTaggedObjectsSelected()

void IlvManager::setTaggedObjectsSelected ( const IlSymbol tag,
IlBoolean  selected = IlTrue,
IlBoolean  redraw = IlTrue 
)

Selects or deselects the graphic objects associated with a given tag.

Sets the selected state of the objects associated with the specified tag.

Parameters
tagSpecifies a tag.
selectedIndicates whether the graphic objects must be selected.
redrawSpecifies whether the manager must redraw the invalidated regions occupied by the selection objects.

◆ setTransformer()

virtual void IlvManager::setTransformer ( const IlvView view,
IlvTransformer t = 0 
)
virtual

Sets a transformer to a manager view.

Associates a transformer to a manager view. The transformer will be used to draw the graphic objects in this view. The transformer is internally copied during this function call.

Parameters
viewThe manager view.
tThe transformer.

◆ setUndoEnabled()

void IlvManager::setUndoEnabled ( IlBoolean  enable)

Enables or disables the possibility of undoing commands in the manager.

Parameters
enableIlFalse to disable Undo, IlTrue to enable it (this is the default state of the manager).

◆ setVisible() [1/3]

void IlvManager::setVisible ( const IlvView view,
int  layer,
IlBoolean  visible 
)

Sets the visibility of a layer for a manager view.

Sets the visibility attribute of a layer from the perspective of a manager view.

Parameters
viewThe manager view.
layerThe index of the layer.
visibleIlTrue to set the layer as visible.

◆ setVisible() [2/3]

void IlvManager::setVisible ( IlvGraphic object,
IlBoolean  visible,
IlBoolean  redraw = IlFalse 
)

Sets the visibility of a graphic object in the manager to visible.

This method calls the IlvManagerViewHook::contentsChanged() member function of the hook objects that are linked to the manager. It does not redraw the bounding box of the object.

Parameters
objectThe graphic object.
visibleIlTrue to set the object as visible, and IlFalse to make it invisible.
redrawSpecifies whether the manager must redraw its contents.

◆ setVisible() [3/3]

void IlvManager::setVisible ( int  layer,
IlBoolean  visible 
)

Sets the visibility of a layer for the manager.

Sets the visibility attribute of a layer from the manager perspective.

Parameters
layerThe manager layer.
visibleIlTrue to set the layer as visible.

◆ shortCut()

virtual IlBoolean IlvManager::shortCut ( IlvEvent event,
IlvView view 
)
virtual

Dispatches an incoming event to manager accelerators.

Called when IlvManager::dispatchToObjects() has returned IlFalse. It is typically called by the member function of the view interactors IlvManagerViewInteractor::handleEvent(), when these interactors cannot parse the incoming events.

The function checks whether the event triggers one of the accelerators stored in the manager (see IlvAccelerator::trigger()).

Parameters
eventThe incoming event.
viewThe manager view.
Returns
IlTrue if a matching accelerator is found; the accelerator action is then called. If no matching accelerator is found, IlFalse is returned.

◆ snapToGrid()

void IlvManager::snapToGrid ( const IlvView view,
IlvPoint p 
) const

Moves a given point to the closest grid point on a manager view.

If no grid is currently associated with the view, the point is not modified.

Parameters
viewThe manager view.
pSpecifies the point in the view coordinate system. This parameter is modified to hold the return value, which is also expressed in the view coordinate system.

◆ sortObjects()

IlvGraphic* const* IlvManager::sortObjects ( IlvGraphic *const *  objs,
IlUInt  count 
) const

Sorts a set of object.

The objects are sorted by redraw order.

Parameters
objsThe objects array which must be sorted.
countThe object count of the array.
Returns
An array of pointers to the sorted objects. The array is stored in an IlPoolOf(Pointer) and should not be deleted or modified.

◆ swapLayers()

void IlvManager::swapLayers ( int  layer1,
int  layer2,
IlBoolean  redraw = IlTrue 
)

Swaps the contents of two manager layers.

The objects originally in layer1 are moved to layer2, and the objects originally in layer2 are moved to layer1.

Parameters
layer1The index of a manager layer.
layer2The index of another manager layer.
redrawSpecifies whether the manager must redraw the invalidated regions occupied by the objects.

◆ transformThroughGrid()

IlBoolean IlvManager::transformThroughGrid ( const IlvView view,
IlvPoint p 
) const

Transforms and moves a given point on a manager view to the closest grid point in the manager coordinate system.

The point given in parameter is first transformed in the manager coordinate system, and then snapped to the grid of the manager view. If no grid is currently associated with the view, the point is not snapped to the grid but just converted in the manager coordinate system.

Parameters
viewThe manager view.
pSpecifies the point in the view coordinate system. This parameter is modified to hold the return value, which is expressed in the coordinate system of the manager.
Returns
IlFalse if the view is not associated with the manager, otherwise IlTrue.

◆ translateObject()

virtual void IlvManager::translateObject ( IlvGraphic object,
IlvPos  dx,
IlvPos  dy,
IlBoolean  redraw = IlTrue 
)
virtual

Translates a graphic object.

Translates the upper left corner of a graphic object by the specified offsets expressed in the object coordinate system.

Parameters
objectThe graphic object.
dxThe horizontal translation offset.
dyThe vertical translation offset.
redrawSpecifies whether the manager must redraw the invalidated regions occupied by the object.

◆ translateView()

void IlvManager::translateView ( const IlvView view,
IlvPos  dx,
IlvPos  dy,
IlBoolean  redraw = IlTrue 
)

Scroll the contents of a manager.

Applies a translation to the manager view transformer to scroll the graphic objects.

Parameters
viewThe manager view.
dxTranslation along the horizontal axis.
dyTranslation along the vertical axis.
redrawIndicates whether the manager must redraw the objects in the view after the transformation.

◆ unGroup()

virtual void IlvManager::unGroup ( IlvGraphic object,
IlBoolean  undoCommand = IlTrue 
)
virtual

Ungroups the graphic objects of a graphic set.

Ungroups an IlvGraphicSet. The objects keep the same position and shape they have when they are ungrouped.

Parameters
objectThe graphic set. If it is not a subclass of IlvGraphicSet, nothing is done.
undoCommandIlFalse indicates that you do not want to store this action in the command stack of the manager.

◆ unregisterCallback()

void IlvManager::unregisterCallback ( const char *  callbackName)

Removes the callback function registered with the specified name from the callback list.

Parameters
callbackNameThe callback name.

◆ whichSelection()

IlvDrawSelection* IlvManager::whichSelection ( const IlvPoint p,
const IlvView view 
) const

Returns the selection object located at the given location.

Accomplishes the same task as the lastContains() member function but only on selected objects. It is generally used to get the selected object located at the cursor location.

Parameters
pThe point, in the coordinate system of the view.
viewThe manager view.
Returns
The selection object at the specified location, or 0 if there is none.

◆ zoomView()

void IlvManager::zoomView ( const IlvView view,
const IlvPoint point,
IlFloat  scalex,
IlFloat  scaley,
IlBoolean  redraw = IlTrue 
)

Zoom the contents of a manager view.

Applies a zooming factor to the manager view transformer.

Parameters
viewThe manager view.
pointSpecifies the invariant point of the transformation.
scalexZooming factor on the horizontal axis.
scaleyZooming factor on the vertical axis.
redrawIndicates whether the manager must redraw the objects in the view after the transformation.
IlvManager::setObjectName
virtual IlBoolean setObjectName(IlvGraphic *object, const char *name)
Sets the name of a graphic object in the manager.
IlvManager::addObject
virtual void addObject(IlvGraphic *object, IlBoolean redraw=IlTrue, int layer=-1)
Adds an object to the manager.
IlvManagerOutputFile
Input/output class.
Definition: io.h:53
IlvManager::createOutputFile
virtual IlvManagerOutputFile * createOutputFile(std::ostream &stream) const
Creates an IlvManagerOutputFile from an output stream.