Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Manager class. More...
#include <ilviews/manager/manager.h>
Public Member Functions | |
IlvManager (IlvDisplay *display, int layers=2, IlBoolean useacc=IlTrue, IlUShort maxInList=IlvMaxObjectsInList, IlUShort maxInNode=IlvMaxObjectsInList) | |
Constructor. More... | |
virtual | ~IlvManager () |
Destructor. More... | |
IlvMgrView * | getView (const IlvView *v) const |
Returns the IlvMrgView of a manager view. 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... | |
virtual IlBoolean | gadgetShortCut (IlvEvent &) |
Dispatches an event to the appropriate graphic objects. More... | |
IlvManagerObjectInteractor * | getObjectInteractor (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... | |
void | pushInteractor (IlvManagerViewInteractor *e) |
Dispatches an event to the appropriate graphic objects. More... | |
IlvManagerViewInteractor * | getInteractor (const IlvView *view) const |
Returns the view interactor associated with a manager view. More... | |
Callback Management | |
const IlAList * | getCallbackNames () const |
Registers a callback and its name. More... | |
IlvGraphicCallback | getCallback (const IlSymbol *cbName) const |
Registers a callback and its name. More... | |
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... | |
void | removeCallback (const char *callbackName) |
Registers a callback and its name. More... | |
virtual void | callCallbacks (const IlSymbol *callbackName, IlvGraphic *) |
Registers a callback and its name. More... | |
void | callCallback (IlvGraphic *object) |
Registers a callback and its name. 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 IlvGraphicSet * | group (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... | |
void | installDrawHook (IlvManagerDrawHook *hook) |
Groups several graphic objects. More... | |
void | removeDrawHook (IlvManagerDrawHook *hook) |
Groups several graphic objects. More... | |
virtual void | eraseRegion (IlvView *view, const IlvRegion ®ion) 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... | |
virtual void | viewResized (const IlvView *, IlvRect &) |
Groups several graphic objects. 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 ®ion) 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... | |
void | setClientData (IlAny data) |
Groups several graphic objects. More... | |
IlAny | getClientData () const |
Groups several graphic objects. 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... | |
IlvDisplay * | getDisplay () const |
Returns the display. More... | |
IlvPalette * | getPalette () 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... | |
IlvGraphic *const * | objects (IlUInt &count) const |
Returns the name of the manager. More... | |
virtual IlvGraphic *const * | getObjects (int layer, IlUInt &count) const |
Returns the graphic objects stored in a manager layer. More... | |
virtual IlvGraphic * | lastContains (const IlvPoint &p, const IlvView *view) const |
Returns the graphic object containing a given point. More... | |
IlvGraphic * | lastContains (int layer, const IlvPoint &p, const IlvView *view) const |
Returns the graphic object containing a given point in a layer. More... | |
IlvGraphic * | filteredLastContains (const IlvPoint &p, const IlvView *view, const IlvGraphicFilter &f) const |
Returns the graphic object containing a given point. More... | |
IlvGraphic * | filteredLastContains (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... | |
IlvGraphic * | firstIntersects (const IlvRegion &tr, const IlvTransformer *t) const |
Returns the first object intersecting a region. More... | |
IlvGraphic * | firstIntersects (const IlvRect &r) |
Returns the name of the manager. More... | |
IlvGraphic * | firstIntersects (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 | |
IlvManagerGrid * | getGrid (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 IlvManagerInputFile * | createInputFile (istream &stream) |
Creates an IlvManagerInputFile from an input stream. More... | |
virtual IlvManagerInputFile * | createInputFile (ILVSTDPREF istream &stream) |
Creates an IlvManagerInputFile from an input stream. More... | |
virtual IlvManagerOutputFile * | createOutputFile (ostream &stream) const |
Creates an IlvManagerOutputFile from an output stream. More... | |
virtual IlvManagerOutputFile * | createOutputFile (ILVSTDPREF ostream &stream) const |
Creates an IlvManagerInputFile from an input stream. More... | |
virtual void | save (ostream &stream) const |
Saves all the graphic objects in an output stream. More... | |
virtual void | save (ILVSTDPREF ostream &stream) const |
Creates an IlvManagerInputFile from an input stream. More... | |
virtual void | read (istream &stream) |
Reads a set of graphic objects from the specified input stream. More... | |
virtual void | read (ILVSTDPREF istream &stream) |
Creates an IlvManagerInputFile from an input stream. More... | |
virtual void | read (const char *filename) |
Loads an Rogue Wave Views data file. More... | |
Managing Accelerators | |
virtual void | handleInput (IlvEvent &event, IlvView *view) |
Installs an event hook on the manager. More... | |
IlvManagerEventHook * | getEventHooks () const |
Installs an event hook on the manager. More... | |
IlBoolean | handleEventHooks (IlvEvent &event, IlvView *view) |
Installs an event hook on the manager. More... | |
IlBoolean | installEventHook (const IlvManagerEventHook *hook) |
Installs an event hook on the manager. More... | |
IlvManagerEventHook * | removeEventHook (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 | addAccelerator (IlvManagerAccelerator *) |
Installs an event hook on the manager. More... | |
void | removeAccelerator (IlvManagerAccelerator *) |
Installs an event hook on the manager. More... | |
IlvManagerAccelerator * | getAccelerator (IlvEventType type, IlUShort buttonOrKey=0, IlUShort modifiers=0) |
Installs an event hook on the manager. More... | |
void | removeAccelerators () |
Removes all accelerators. More... | |
Managing Double Buffering | |
IlBoolean | setDoubleBuffering (const IlvView *view, IlBoolean useDB, IlBoolean tmp=IlFalse) |
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... | |
void | setDoubleBufferingColor (IlvColor *color) |
Enables or disables double buffering for a manager view. More... | |
IlBoolean | isDoubleBuffering (const IlvView *view) const |
Indicates whether double buffering is used for a manager view. More... | |
IlvManagerDblBufferHandler * | getDoubleBufferingHandler () const |
Enables or disables double buffering for a manager view. More... | |
void | setDoubleBufferingHandler (IlvManagerDblBufferHandler *) |
Enables or disables double buffering for a manager view. More... | |
IlvBitmap * | getDoubleBufferingBitmap (const IlvView *) const |
Enables or disables double buffering 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... | |
virtual void | moveLayer (int from, int to, IlBoolean redraw=IlTrue) |
Indicates whether a layer is considered visible by the manager. More... | |
IlvManagerLayer * | getManagerLayer (const char *layerName) const |
Indicates whether a layer is considered visible by the manager. More... | |
IlvManagerLayer * | getManagerLayer (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... | |
IlvManagerLayer * | removeLayer (IlvManagerLayer *) |
Indicates whether a layer is considered visible by the manager. More... | |
IlvManagerLayer * | replaceLayer (IlvManagerLayer *newLayer, int index) |
Indicates whether a layer is considered visible by the manager. More... | |
IlvManagerLayerFactory * | setManagerLayerFactory (IlvManagerLayerFactory *) |
Indicates whether a layer is considered visible by the manager. More... | |
IlvManagerLayer * | getManagerLayer (int i) const |
Returns the IlvManagerLayer instance from its index. More... | |
int | getLayerIndex (const IlvManagerLayer *) 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... | |
IlvManagerSelectionHook * | getSelectionHooks () const |
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... | |
IlvManagerSelectionHook * | removeSelectionHook (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... | |
IlvDrawSelection * | getSelection (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 | |
IlvSmartSet * | getSmartSet (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 IlvSmartSet * | duplicateSmartSet (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... | |
IlvCommandHistory * | getCommandHistory () 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... | |
IlvLink * | getViewHookList (const IlvView *view) const |
Adds a view hook to 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 | |
IlvPalette * | getCreatorPalette () 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 IlvManager::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 | addBefore (const IlvGraphic *g) |
Initializes the manager so that calls to IlvManager::invalidateRegion can begin. More... | |
void | addAfter (const IlvGraphic *g) |
Initializes the manager so that calls to IlvManager::invalidateRegion can begin. 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... | |
IlvView * | getFirstView () const |
Returns the first view associated with the manager. More... | |
IlvTransformer * | getTransformer (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... | |
void | allowEnsureVisible (IlBoolean v) |
Adds a view to the manager. More... | |
IlBoolean | allowEnsureVisible () const |
Adds a view to the manager. More... | |
static IlvManager * | Get (const IlvView *view) |
Returns the manager connected to the specified view, if any. More... | |
static void | Set (IlvView *view, IlvManager *manager) |
Adds a view to the manager. 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... | |
IlvGraphic *const * | objects (int layer, IlUInt &count) const |
Adds an object to the manager. More... | |
IlvGraphic *const * | getPersistentObjects (IlUInt &count) const |
Adds an object to the manager. More... | |
IlvDrawSelection * | whichSelection (const IlvPoint &p, const IlvView *view) const |
Returns the selection object located at the given location. More... | |
IlvGraphic * | firstIntersects (int layer, const IlvRect &r) |
Adds an object to the manager. More... | |
IlBoolean | isVisible (const IlvGraphic *object) const |
Indicates whether a graphic object is visible. More... | |
IlBoolean | isVisible (const IlvGraphic *g, 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. The method calls the IlvManagerViewHook::contentsChanged member function of the hook objects that are linked to the manager. This member function does not redraw the bounding box of the object. 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... | |
IlvGraphic * | getObject (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... | |
IlBoolean | isEditable (const IlvGraphic *object, const IlvView *) const |
Adds an object to the manager. More... | |
IlvEditableFilter * | getEditableFilter () const |
Adds an object to the manager. More... | |
IlvEditableFilter * | setEditableFilter (IlvEditableFilter *) |
Adds an object to the manager. 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... | |
virtual void | installAccelerators () |
Adds an object to the manager. More... | |
static IlvManager * | getManager (const IlvGraphic *object) |
Gets the manager holding a given graphic object. More... | |
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.
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.
IlvApplyObject
, IlvContainer
, IlvGadgetManager
, IlvGetContentsChangedUpdate
, IlvGetOptimizeMode
, IlvGrapher
, IlvIndexedSet
, IlvManagerAccelerator
, IlvManagerAcceleratorAction
, IlvManagerCommand
, IlvManagerEventHook
, IlvManagerGrid
, IlvManagerLayer
, IlvManagerSelectionHook
, IlvManagerViewHook
, IlvManagerObjectInteractor
, IlvManagerObserver
, IlvManagerViewInteractor
, IlvManagerInputFile
, IlvManagerOutputFile
, IlvMgrView
, IlvSetContentsChangedUpdate
, IlvSetOptimizeMode
. IlvManager::IlvManager | ( | IlvDisplay * | display, |
int | layers = 2 , |
||
IlBoolean | useacc = IlTrue , |
||
IlUShort | maxInList = IlvMaxObjectsInList , |
||
IlUShort | maxInNode = IlvMaxObjectsInList |
||
) |
Constructor.
Initializes an instance of IlvManager
.
display | The display. The manager uses this display to create graphic resources such as a palette to draw ghost images. |
layers | The number of layers in the manager. If the application runs short of layers, the number of layers can be dynamically increased. |
useacc | Indicates whether to install the default accelerators. See the list of accelerators in this class description. |
maxInList | Specifies 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. |
maxInNode | The maximum number of objects allowed in the node of a quadtree, before the node is divided into subtrees. |
|
virtual |
Destructor.
Destroys all objects maintained by the manager as well as the manager itself. The destructor performs the following actions successively:
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.
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 IlvManager::shortCut
method, which uses IlvAccelerator::trigger
to check whether an accelerator must be activated.
f | The user function used as accelerator action. |
type | The accelerator event type. |
buttonOrKey | The accelerator event data. |
modifiers | The accelerator mandatory event modifiers. |
userArg | The accelerator action user argument. |
optModifiers | The accelerator optional event modifiers. |
void IlvManager::addAccelerator | ( | IlvManagerAccelerator * | ) |
Installs an event hook on the manager.
The last event hook installed is the first to be called when an event occurs.
IlTrue
on success. If the hook is already installed on a manager, this member function does nothing and returns IlFalse
. hook | The event hook. |
void IlvManager::addAfter | ( | const IlvGraphic * | g | ) |
Initializes the manager so that calls to IlvManager::invalidateRegion
can begin.
Called to initialize the manager before a series of calls to the member function IlvManager::invalidateRegion
begin. It empties the update region for every managed view. Calls to IlvManager::initReDraws
can be embedded so that the actual refresh only takes place when the last call to IlvManager::reDrawViews
is reached.
void IlvManager::addBefore | ( | const IlvGraphic * | g | ) |
Initializes the manager so that calls to IlvManager::invalidateRegion
can begin.
Called to initialize the manager before a series of calls to the member function IlvManager::invalidateRegion
begin. It empties the update region for every managed view. Calls to IlvManager::initReDraws
can be embedded so that the actual refresh only takes place when the last call to IlvManager::reDrawViews
is reached.
|
virtual |
Appends a new command to the command queue.
command | The command. |
void IlvManager::addLayer | ( | int | position = -1 , |
IlUShort | maxInList = IlvMaxObjectsInList , |
||
IlUShort | maxInNode = IlvMaxObjectsInList |
||
) |
Adds a layer to the manager.
position | Indicates 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. |
maxInList | Indicates the maximum number of graphic objects the layer can store. |
maxInNode | Not documented. |
int IlvManager::addLayer | ( | IlvManagerLayer * | layer, |
int | position = -1 |
||
) |
Adds a layer to the manager.
This method allows you to add instances of IlvManagerLayer
subclasses.
layer | Specifies a pointer to a layer object. |
position | Indicates 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. |
|
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
creates layers 3
, 4
, and 5
. An object cannot be added to a manager more than once.
object | The graphic object. |
redraw | Indicates whether the manager must immediately display the object. |
layer | Specifies the layer index where the object must be inserted. The default value -1 indicates that the object is stored in the last (topmost) layer. |
IlvManager::addObject
or IlvManager::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.
|
virtual |
Adds a graphic object to a manager, and then names the object.
This function is equivalent to
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 IlvManager::addObject
member function.
name | Specifies the name to set on the object. |
object | The graphic object. |
redraw | Indicates whether the manager must immediately display the object. |
layer | Specifies the layer index where the object must be inserted. The default value -1 indicates that the object is stored in the last (topmost) layer. |
IlvManager::addObject
member function. Reimplemented in IlvGadgetManager.
|
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.
set | The smartset. |
redraw | Specifies whether the manager must redraw its contents. |
IlFalse
on error, that is, if the smartset contains objects located in another manager.
|
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.
view | The manager view. |
t | The transformer. |
|
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.
view | The view. |
Reimplemented in IlvGadgetManager.
|
virtual |
Aligns the selected objects.
Moves all selected objects to the given alignment parameter. The objects are aligned with the first selected object.
alignment | Can take one of the following values: IlvLeft IlvRight IlvTop IlvBottom IlvCenter IlvHorizontalCenter IlvVerticalCenter . |
redraw | Specifies whether the manager must redraw the invalidated regions occupied by the objects. |
IlvGraphic* const* IlvManager::allContains | ( | const IlvPoint & | p, |
const IlvView * | view, | ||
IlUInt & | count | ||
) | const |
Returns all graphic objects containing a given point.
p | Specifies the point in the view coordinate system. |
view | The manager view. |
count | Used to return the number of objects in the array. |
IlPoolOf(Pointer)
and should not be deleted or modified. 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.
layer | The index of the manager layer. |
p | Specifies the point in the view coordinate system. |
view | The manager view. |
count | Used to return the number of objects in the array. |
IlPoolOf(Pointer)
and should not be deleted or modified. IlvGraphic* const* IlvManager::allInside | ( | IlUInt & | count, |
const IlvRect & | rect, | ||
const IlvTransformer * | t = 0 |
||
) | const |
Returns all graphic objects located in a rectangle.
count | Used to return the number of objects in the array. |
rect | The rectangle. |
t | The transformer. |
IlPoolOf(Pointer)
and should not be deleted or modified. 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.
layer | The index of the manager layer. |
count | Used to return the number of objects in the array. |
rect | The rectangle. |
t | The transformer. |
IlPoolOf(Pointer)
and should not be deleted or modified. IlvGraphic* const* IlvManager::allIntersects | ( | IlUInt & | count, |
const IlvRect & | rect, | ||
const IlvTransformer * | t = 0 |
||
) | const |
Returns all graphic objects intersecting a rectangle.
count | Used to return the number of objects in the array. |
rect | The rectangle. |
t | The transformer. |
IlPoolOf(Pointer)
and should not be deleted or modified. 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.
layer | The index of the manager layer. |
count | Used to return the number of objects in the array. |
rect | The rectangle. If a transformer is specified, the method tests the intersection between the rectangle and the bounding box of the transformed object. |
t | The transformer. |
IlPoolOf(Pointer)
and should not be deleted or modified. void IlvManager::allowEnsureVisible | ( | IlBoolean | v | ) |
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.
view | The view. |
IlBoolean IlvManager::allowEnsureVisible | ( | ) | const |
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.
view | The view. |
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.
layer | The index of the manager layer. |
func | The user function to apply. |
arg | The user argument. |
rect | The rectangle. |
t | The transformer. |
redraw | Specifies 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. |
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.
func | The user function to apply. |
arg | The user argument. |
rect | The rectangle. |
t | The transformer. |
redraw | Specifies 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. |
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.
layer | The index of the manager layer. |
func | The user function to apply. |
arg | The user argument. |
rect | The rectangle. |
t | The transformer. |
redraw | Specifies 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. |
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.
func | The user function to apply. |
arg | The user argument. |
rect | The rectangle. |
t | The transformer. |
redraw | Specifies 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. |
|
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:
object | The graphic object. |
func | The user function to apply. |
arg | The user argument. |
redraw | Specifies 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. |
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.
|
virtual |
Applies a user function to a set of graphic objects.
Calls IlvManager::applyToObject
for each graphic object of the specified array.
count | The number of graphic objects in the array. |
objects | The array of graphic objects. |
func | The user function to apply. |
arg | The user argument. |
redraw | Specifies 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. |
|
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.
count | The number of graphic objects in the array. |
objects | The array of graphic objects. |
func | The user function to apply. |
arg | The user argument. |
redraw | Specifies 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. |
|
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.
layer | The index of the manager layer. |
func | The user function to apply. |
arg | The user argument. |
redraw | Specifies 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. |
|
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.
layer | The index of the manager layer. |
func | The user function to apply. |
arg | The user argument. |
redraw | Specifies 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. |
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.
func | The user function to apply. |
arg | The user argument. |
redraw | Specifies 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. |
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.
tag | Specifies a tag. |
func | The user function to apply. |
arg | The user argument. |
redraw | Specifies 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. |
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. 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.
view | The manager view. |
rect | The rectangle in the manager view coordinate system. |
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.
view | The manager view. |
region | The region in the manager view coordinate system. |
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.
view | The manager view. |
object | The graphic object. |
void IlvManager::callCallback | ( | IlvGraphic * | object | ) |
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.
callbackName | The character string. |
callback | The user function. |
|
virtual |
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.
callbackName | The character string. |
callback | The user function. |
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.
bbox | Used to return the bounding box. |
t | The transformer. |
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.
bbox | Used to return the bounding box. |
view | The manager view. |
|
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.
|
virtual |
Saves all the selected graphic objects in a string.
delete []
. count | Indicates the length of the returned string in bytes. |
void IlvManager::copyToClipboard | ( | ) |
Saves the selected graphic objects in the clipboard.
Copies all the selected objects in the clipboard. It uses the IlvManager::copy
member function.
|
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.
IlvManagerInputFile
, or a subclass. stream | The input 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.
IlvManagerInputFile
, or a subclass. stream | The input stream. |
|
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.
stream | The output stream. |
IlvManagerOutputFile
, or a subclass. The implementation for the IlvManager
class is:
|
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.
IlvManagerInputFile
, or a subclass. stream | The input stream. |
|
virtual |
Saves the selected graphic objects in a string and then deletes them.
delete []
. count | Indicates the length of the returned string in bytes. |
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 IlvManager::cut
member function.
Removes all the graphic objects from the manager.
destroy | Indicates whether the manager must delete the objects |
redraw | Indicates whether the manager must redraw its views after removing them. |
Removes all the objects stored in a specified layer of the manager.
layer | The index of the manager layer. |
destroy | Indicates whether the manager must delete the objects after removing them. |
redraw | Indicates whether the manager must redraw the views attached to it. |
Removes the selected objects from the manager and deletes them if undo is disabled.
By default, undo is enabled.
redraw | Specifies whether the manager must refresh its views. |
Deselects the selected graphic objects.
Deselects all previously selected objects.
redraw | Specifies whether the manager must refresh its views. |
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 IlvManager::invalidateRegion
will restore the lazy redraw mechanism and reschedule a redraw task.
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.
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.
|
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.
view | The manager view. |
erase | Indicates whether the view (or the clipping region in the view) must be erased before drawing (see IlvAbstractView::erase ). |
clip | The clipping region. 0 means that the drawing is not clipped. |
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.
dst | The destination port. |
t | The transformer. |
region | Only objects intersecting this region are drawn. |
clip | The clipping region. |
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.
layer | The index of the manager layer. |
dst | The destination port. |
t | The transformer. |
region | Only objects intersecting this region are drawn. |
clip | The clipping region. |
void IlvManager::draw | ( | ) | const |
Draws the contents of the manager.
Draws all visible graphic objects of the manager in all managed views.
Duplicates the selected graphic objects.
Copies the selected objects and adds them to the manager. The copied objects are translated from their original positions.
dx | The translation offset along the horizontal axis. |
dy | The translation offset along the vertical axis. |
|
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.
IlvManager::addSmartSet
. set | The original smartset. |
dx | The horizontal translation offset. |
dy | The vertical translation offset. |
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.
view | The manager view. |
point | The point in the view coordinate system. |
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.
view | The manager view. |
rect | The rectangle in the view coordinate system. |
Erases a region of a manager view.
view | The manager view. |
region | The region in the manager view coordinate system. |
IlvGraphic* IlvManager::filteredLastContains | ( | const IlvPoint & | p, |
const IlvView * | view, | ||
const IlvGraphicFilter & | f | ||
) | const |
Returns the graphic object containing a given point.
p | Specifies the point in the view coordinate system. |
view | The manager view. |
f | The filter function. |
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.
layer | The index of the manager layer. |
p | Specifies the point in the view coordinate system. |
view | The manager view. |
f | The filter function. |
IlvGraphic* IlvManager::firstIntersects | ( | const IlvRegion & | tr, |
const IlvTransformer * | t | ||
) | const |
Returns the first object intersecting a region.
tr | The (transformed) region. |
t | The transformer. |
IlvGraphic* IlvManager::firstIntersects | ( | const IlvRect & | r | ) |
Returns the name of the manager.
IlvGraphic* IlvManager::firstIntersects | ( | int | layer, |
const IlvRegion & | tr, | ||
const IlvTransformer * | t | ||
) | const |
Returns the first object of a layer intersecting a region.
layer | The index of the manager layer. |
tr | The (transformed) region. |
t | The transformer. |
IlvGraphic* IlvManager::firstIntersects | ( | int | layer, |
const IlvRect & | r | ||
) |
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
creates layers 3
, 4
, and 5
. An object cannot be added to a manager more than once.
object | The graphic object. |
redraw | Indicates whether the manager must immediately display the object. |
layer | Specifies the layer index where the object must be inserted. The default value -1 indicates that the object is stored in the last (topmost) layer. |
IlvManager::addObject
or IlvManager::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
. 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.
view | The manager view. |
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.
view | The manager view. |
redraw | Indicates whether the manager must redraw the objects in the view after the transformation. |
keepRatio | If IlTrue , horizontal and vertical scaling factors are equal, thereby preserving the x/y ratio. |
|
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 IlvManager::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.
IlvEventLoop::addIdleProc
. 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.
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.
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.
|
static |
Returns the manager connected to the specified view, if any.
view | The view. |
0
otherwise. IlvManager::addView
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.
IlTrue
if a matching accelerator is found and IlFalse
otherwise. f | Used to return the accelerator action. |
userArg | Used to return the action argument. |
type | The event type. |
buttonOrKey | The event data. |
modifiers | The event modifiers. |
IlvManagerAccelerator* IlvManager::getAccelerator | ( | IlvEventType | type, |
IlUShort | buttonOrKey = 0 , |
||
IlUShort | modifiers = 0 |
||
) |
Installs an event hook on the manager.
The last event hook installed is the first to be called when an event occurs.
IlTrue
on success. If the hook is already installed on a manager, this member function does nothing and returns IlFalse
. hook | The event hook. |
IlvGraphicCallback IlvManager::getCallback | ( | const IlSymbol * | cbName | ) | const |
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.
callbackName | The character string. |
callback | The user function. |
const IlAList* IlvManager::getCallbackNames | ( | ) | const |
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.
callbackName | The character string. |
callback | The user function. |
IlUInt IlvManager::getCardinal | ( | ) | const |
Returns the number of graphic objects.
IlUInt IlvManager::getCardinal | ( | int | layer | ) | const |
Returns the number of graphic objects in a layer.
layer | The index of the layer. |
IlAny IlvManager::getClientData | ( | ) | const |
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.
count | The number of graphic objects in the array. |
objects | The array of graphic objects. |
IlvCommandHistory* IlvManager::getCommandHistory | ( | ) | const |
Returns the object which handles the stack of commands.
IlvPalette* IlvManager::getCreatorPalette | ( | ) | const |
Gets the default palette used to create graphic objects interactively.
IlvDisplay* IlvManager::getDisplay | ( | ) | const |
Returns the display.
IlvDisplay
object for which this manager was built. Enables or disables double buffering for a manager view.
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
. view | The manager view. |
useDB | IlTrue to enable double buffering and IlFalse to disable it. |
tmp | Not documented |
IlvManagerDblBufferHandler* IlvManager::getDoubleBufferingHandler | ( | ) | const |
Enables or disables double buffering for a manager view.
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
. view | The manager view. |
useDB | IlTrue to enable double buffering and IlFalse to disable it. |
tmp | Not documented |
IlvEditableFilter* IlvManager::getEditableFilter | ( | ) | const |
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
creates layers 3
, 4
, and 5
. An object cannot be added to a manager more than once.
object | The graphic object. |
redraw | Indicates whether the manager must immediately display the object. |
layer | Specifies the layer index where the object must be inserted. The default value -1 indicates that the object is stored in the last (topmost) layer. |
IlvManager::addObject
or IlvManager::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
. IlvManagerEventHook* IlvManager::getEventHooks | ( | ) | const |
Installs an event hook on the manager.
The last event hook installed is the first to be called when an event occurs.
IlTrue
on success. If the hook is already installed on a manager, this member function does nothing and returns IlFalse
. hook | The event hook. |
IlvView* IlvManager::getFirstView | ( | ) | const |
Returns the first view associated with the manager.
0
. IlvManagerGrid* IlvManager::getGrid | ( | const IlvView * | view | ) | const |
Returns the manager grid associated with a manager view.
IlvManagerGrid
object associated with the manager view. It returns 0
if no grid is applied to the view. int IlvManager::getInsertionLayer | ( | ) | const |
Gets the default layer used to store the graphic objects created interactively.
IlvManager::addObject
. IlvManagerViewInteractor* IlvManager::getInteractor | ( | const IlvView * | view | ) | const |
Returns the view interactor associated with a manager view.
0
if there is none. view | The manager view. |
int IlvManager::getLayer | ( | const IlvGraphic * | object | ) | const |
Returns the manager layer containing a given graphic object.
-1
. object | The graphic object. |
int IlvManager::getLayerIndex | ( | const IlvManagerLayer * | ) | const |
Returns the index of a manager layer instance.
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).
|
static |
Gets the manager holding a given graphic object.
object | The graphic object. |
0
. IlvManagerLayer* IlvManager::getManagerLayer | ( | const char * | layerName | ) | const |
Indicates whether a layer is considered visible by the manager.
IlTrue
if the layer is visible from the manager point of view. The layer may still be hidden in a manager view. layer | The index of the layer. |
IlvManagerLayer* IlvManager::getManagerLayer | ( | const IlvGraphic * | object | ) | const |
Returns the IlvManagerLayer
instance of a graphic object.
object | The graphic object. |
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. IlvManagerLayer* IlvManager::getManagerLayer | ( | int | i | ) | 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).
const char* IlvManager::getName | ( | ) | const |
Returns the name of the manager.
int IlvManager::getNumLayers | ( | ) | const |
Returns the number of manager layers.
IlvGraphic* IlvManager::getObject | ( | const char * | name | ) | const |
Gets a graphic object by its name.
0
if no object was given this name in the manager. name | The object name. |
IlvManagerObjectInteractor* IlvManager::getObjectInteractor | ( | const IlvGraphic * | object | ) | const |
The object interactor associated with a graphic object.
0
if there is none. object | The graphic object. |
const char* IlvManager::getObjectName | ( | const IlvGraphic * | object | ) | const |
Returns the name of a graphic object.
0
if the object has no name. object | The graphic object. |
|
virtual |
Returns the graphic objects stored in the manager.
count | The number of objects returned in the array. |
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.
|
virtual |
Returns the graphic objects stored in a manager layer.
layer | The index of the layer. |
count | The number of objects returned in the array. |
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.
IlvPalette* IlvManager::getPalette | ( | ) | const |
Returns the manager palette.
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.XOR
. IlvGraphic* const* IlvManager::getPersistentObjects | ( | IlUInt & | count | ) | const |
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
creates layers 3
, 4
, and 5
. An object cannot be added to a manager more than once.
object | The graphic object. |
redraw | Indicates whether the manager must immediately display the object. |
layer | Specifies the layer index where the object must be inserted. The default value -1 indicates that the object is stored in the last (topmost) layer. |
IlvManager::addObject
or IlvManager::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
. IlvReDrawMode IlvManager::getReDrawMode | ( | ) | const |
Returns the redraw mode of the manager.
IlvDrawSelection* IlvManager::getSelection | ( | const IlvGraphic * | object | ) | const |
Returns the selection object of a graphic object.
object | The graphic object. |
0
if the graphic object is not selected. The selector object is an internal IlvGraphic
used to draw selections and test against mouse events. IlvManagerSelectionHook* IlvManager::getSelectionHooks | ( | ) | const |
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.
func | The new selection function. |
IlvSelectionInterface
class. It allows you to associate different subclasses of IlvDrawSelection
with different subclasses of IlvGraphic
. IlvSelectionInterface
IlvGraphic* const* IlvManager::getSelections | ( | IlUInt & | count | ) | const |
Returns the selected graphic objects.
count | Used to return the number of graphic objects in the array. |
IlPoolOf(Pointer)
and should not be deleted or modified. IlvManager::applyToSelections
member function is available. IlvSmartSet* IlvManager::getSmartSet | ( | const char * | name | ) | const |
Gets a smartset by its name.
IlvSmartSet
with the specified name, or 0
if there is none. name | The smartset name. |
IlvGraphic* const* IlvManager::getTaggedObjects | ( | const IlSymbol * | tag, |
IlUInt & | count | ||
) | const |
Returns the graphic objects associated with a given tag.
0
if none are found. The array is stored in an IlPoolOf(Pointer)
and should not be deleted or modified. tag | Specifies a tag. |
count | Used to return the number of graphic objects in the returned array. |
IlvTransformer* IlvManager::getTransformer | ( | const IlvView * | view | ) | const |
Returns the transformer associated with a manager view.
view | The manager view. |
IlvMgrView* IlvManager::getView | ( | const IlvView * | v | ) | const |
Returns the IlvMrgView
of a manager view.
IlvMrgView
representing the specified view. If v is not associated with the manager, the function returns 0
. v | The view. |
IlvLink* IlvManager::getViewHookList | ( | const IlvView * | view | ) | const |
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.
hook | The manager view hook. |
IlvManagerViewHook* const* IlvManager::getViewHooks | ( | const IlvView * | view, |
IlUInt & | count | ||
) | const |
Gets the view hooks of a manager view.
IlPoolOf(Pointer)
and should not be deleted or modified. view | The manager view. |
count | Used to return the number of view hooks in the returned array. |
Returns the array of views associated with the manager.
count | Used to return the number of views in the array. |
IlPoolOf(Pointer)
and should not be deleted or modified.
|
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.
count | The number of graphic objects in the array. |
objects | The array of graphic objects. |
Installs an event hook on the manager.
The last event hook installed is the first to be called when an event occurs.
IlTrue
on success. If the hook is already installed on a manager, this member function does nothing and returns IlFalse
. hook | The event hook. |
Installs an event hook on the manager.
The last event hook installed is the first to be called when an event occurs.
IlTrue
on success. If the hook is already installed on a manager, this member function does nothing and returns IlFalse
. hook | The event hook. |
Reimplemented in IlvGadgetManager.
void IlvManager::initReDraws | ( | ) |
Initializes the manager so that calls to IlvManager::invalidateRegion
can begin.
Called to initialize the manager before a series of calls to the member function IlvManager::invalidateRegion
begin. It empties the update region for every managed view. Calls to IlvManager::initReDraws
can be embedded so that the actual refresh only takes place when the last call to IlvManager::reDrawViews
is reached.
|
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
creates layers 3
, 4
, and 5
. An object cannot be added to a manager more than once.
object | The graphic object. |
redraw | Indicates whether the manager must immediately display the object. |
layer | Specifies the layer index where the object must be inserted. The default value -1 indicates that the object is stored in the last (topmost) layer. |
IlvManager::addObject
or IlvManager::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
. void IlvManager::installDrawHook | ( | IlvManagerDrawHook * | hook | ) |
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.
count | The number of graphic objects in the array. |
objects | The array of graphic objects. |
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.
IlTrue
on success. If the hook is already installed on a manager, this member function does nothing and returns IlFalse
. hook | The event hook. |
IlBoolean IlvManager::installSelectionHook | ( | const IlvManagerSelectionHook * | hook | ) |
Sets a selection hook on the manager.
hook | The selection hook. |
IlTrue
on success. If the hook is already installed on a manager, the member function does nothing and returns IlFalse
. 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.
hook | The manager view hook. |
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.
object | The graphic object. The object must be directly held by the manager, and indirectly through an other object like a IlvGraphicSet or IlvTransformer . |
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.
rect | The rectangle, specified in manager coordinates. |
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.
view | The manager view. |
rect | The rectangle, specified in manager coordinates. |
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.
updater | The object used to update the invalidated region. |
g | An optional parameter to specify which graphic object requests the invalidation. |
IlvRegionUpdater::update
. IlBoolean IlvManager::isASelection | ( | const IlvGraphic * | object | ) | const |
Indicates if a graphic object is a selection object.
object | The graphic object. |
IlTrue
if the object is a selection (that is, a subtype of IlvDrawSelection
). Otherwise, it returns IlFalse
. Indicates whether double buffering is used for a manager view.
IlTrue
if double buffering is applied to the view, and IlFalse
otherwise. view | The manager view. |
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 IlvManager::isResizeable
) or a translation (IlvManager::isMoveable
).
IlTrue
if this object can be edited, and IlFalse
otherwise. object | The graphic object. |
IlvDrawSelection::getSelectionInteractor
. IlBoolean IlvManager::isEditable | ( | const IlvGraphic * | object, |
const IlvView * | |||
) | const |
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
creates layers 3
, 4
, and 5
. An object cannot be added to a manager more than once.
object | The graphic object. |
redraw | Indicates whether the manager must immediately display the object. |
layer | Specifies the layer index where the object must be inserted. The default value -1 indicates that the object is stored in the last (topmost) layer. |
IlvManager::addObject
or IlvManager::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
. IlBoolean IlvManager::isInApply | ( | ) | const |
Indicates if an applyTo...()
method is being executed.
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. IlBoolean IlvManager::isInvalidating | ( | ) | const |
Indicates whether the manager is in a phase of invalidating regions.
IlTrue
if the manager has scheduled some redraw task to perform when the process is idle. Indicates whether a manager view preserves the x/y ratio.
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). view | The manager view. |
IlBoolean IlvManager::isManaged | ( | const IlvGraphic * | object | ) | const |
Indicates whether a graphic object is stored by the manager.
IlTrue
if the given graphic object is stored in the manager. Otherwise, it returns IlFalse
. object | The graphic object. |
IlBoolean IlvManager::isModified | ( | ) | const |
Indicates whether the manager contents have been modified.
IlBoolean
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. IlBoolean IlvManager::isMoveable | ( | const IlvGraphic * | object | ) | const |
Indicates if a graphic object can be moved.
IlTrue
if the object is moveable, and IlFalse
otherwise. object | The graphic object. |
IlBoolean IlvManager::isResizeable | ( | const IlvGraphic * | object | ) | const |
Indicates if a graphic object can be resized.
IlTrue
if the object can be resized, and IlFalse
otherwise. object | The graphic object. |
IlBoolean IlvManager::isSelectable | ( | int | layer | ) | const |
Indicates if a manager layer allows the selection of its graphic objects.
IlTrue
if the layer allows the selection of the graphic objects it stores. Otherwise, the function returns IlFalse
. layer | The index of the manager view. |
|
virtual |
Indicates if a graphic object can be selected.
IlTrue
if the object can be selected, and IlFalse
otherwise. IlBoolean IlvManager::isSelected | ( | const IlvGraphic * | obj | ) | const |
Indicates if a graphic object is selected.
IlTrue
if the graphic object is selected, IlFalse
otherwise. IlBoolean IlvManager::isUndoEnabled | ( | ) | const |
Indicates whether the manager lets you undo commands.
IlTrue
if the undo process is enabled. Otherwise, it returns IlFalse
. IlBoolean IlvManager::isVisible | ( | int | layer | ) | const |
Indicates whether a layer is considered visible by the manager.
IlTrue
if the layer is visible from the manager point of view. The layer may still be hidden in a manager view. layer | The index of the layer. |
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.
IlTrue
if the layer is visible for both the manager and the manager view. view | The manager view. |
layer | The index of the layer. |
IlBoolean IlvManager::isVisible | ( | const IlvGraphic * | object | ) | const |
Indicates whether a graphic object is visible.
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. object | The graphic object. |
IlBoolean IlvManager::isVisible | ( | const IlvGraphic * | g, |
IlvView * | view | ||
) | const |
Indicates whether a graphic object is visible in a manager view.
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 IlvManager::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
.
|
virtual |
Returns the graphic object containing a given point.
p | Specifies the point in the view coordinate system. |
view | The manager view. |
IlvGraphic* IlvManager::lastContains | ( | int | layer, |
const IlvPoint & | p, | ||
const IlvView * | view | ||
) | const |
Returns the graphic object containing a given point in a layer.
layer | The index of the manager layer. |
p | Specifies the point in the view coordinate system. |
view | The manager view. |
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.
spacing | Specifies the vertical distance between objects. |
redraw | Specifies whether the manager must redraw the invalidated regions occupied by the objects. |
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.
spacing | Specifies the horizontal distance between objects. |
redraw | Specifies whether the manager must redraw the invalidated regions occupied by the objects. |
Indicates whether a layer is considered visible by the manager.
IlTrue
if the layer is visible from the manager point of view. The layer may still be hidden in a manager view. layer | The index of the layer. |
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 IlvManager::translateObject
.
object | The graphic object. |
x | The new horizontal coordinate. |
y | The new vertical coordinate. |
redraw | Specifies whether the manager must redraw the invalidated regions occupied by the object. |
IlUInt IlvManager::numberOfSelections | ( | ) | const |
Returns the number of selected graphic objects.
IlvGraphic* const* IlvManager::objects | ( | IlUInt & | count | ) | const |
Returns the name of the manager.
IlvGraphic* const* IlvManager::objects | ( | int | layer, |
IlUInt & | count | ||
) | const |
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
creates layers 3
, 4
, and 5
. An object cannot be added to a manager more than once.
object | The graphic object. |
redraw | Indicates whether the manager must immediately display the object. |
layer | Specifies the layer index where the object must be inserted. The default value -1 indicates that the object is stored in the last (topmost) layer. |
IlvManager::addObject
or IlvManager::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
.
|
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 an Rogue Wave Views data file.
view | The manager view. |
str | The string containing the object descriptions. |
location | Specifies, in the view coordinate system, the top-left corner of the bounding box of all the new graphic objects. |
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 IlvManager::paste
member function.
view | The manager view. |
location | Specifies, in the view coordinate system, the top-left corner of the bounding box of all the new graphic objects. |
|
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.
object | The graphic object. |
redraw | Specifies whether the manager must redraw the invalidated region occupied by the object. |
|
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 IlvManager::pop
), the object is moved to the beginning of the layer object list, or to a lower layer, if there is one.
object | The graphic object. |
redraw | Specifies whether the manager must redraw the invalidated region occupied by the object. |
void IlvManager::pushInteractor | ( | IlvManagerViewInteractor * | e | ) |
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.
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
.
|
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.
stream | The input 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.
IlvManagerInputFile
, or a subclass. stream | The input stream. |
|
virtual |
Loads an 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.
filename | The file name. If it is a relative path, the file is searched for in each directory referenced in the display path. |
IlvManager::save
member function for more information. Both the IlvEdit
and Studio
editors use the text mode.
|
virtual |
Executes again the last canceled command.
unused | This 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 good behaviour. |
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
.
void IlvManager::reDraw | ( | const IlvGraphic * | object, |
IlBoolean | erase = IlTrue |
||
) | const |
Draws a graphic object in all manager views.
object | The graphic object. |
erase | Indicates whether the object bounding box must be erased before the object is drawn. |
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.
count | The number of graphic objects in the array. |
objects | The array of graphic objects. |
erase | Indicates whether each object bounding box must be erased before the objects are drawn. |
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 IlvManager::invalidateRegion
.
erase | Indicates whether invalidated regions must be erased before drawing. |
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.
callbackName | The character string. |
callback | The user function. |
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
.
Event Type |
Key or button |
Action |
---|---|---|
IlvKeyUp | f |
Modifies the zoom factor of the view so that all objects can be seen (f for fit) |
IlvKeyUp | F |
Fits and preserves ratio |
IlvKeyUp | i |
Sets the transformer of the view to the identity matrix. |
IlvKeyUp
| p
| Moves selected objects to an upper layer. |
IlvKeyUp
| P
| Moves selected objects to a deeper layer. |
IlvKeyUp
| Ctrl-D
| Duplicates all selected objects and moves the copied object slightly. |
IlvKeyUp
| Ctrl-A
| Selects all objects |
IlvKeyUp
| Ctrl-S
| Selects the object designated by the pointing device. |
IlvKeyUp
| <Del>
| Deletes all selected objects. |
IlvKeyDown
| r
| Re-executes last command. |
IlvKeyDown
| u
| Undoes last command. |
IlvKeyUp
| Ctrl-G
| Groups selected objects into one. |
IlvKeyUp
| Ctrl-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. |
IlvKeyUp
| Z
| Zooms into the view. |
IlvKeyUp
| U
| Zooms out of the view. |
IlvKeyUp
| Ctrl-B
| Deselects all objects. |
IlvKeyUp
| Ctrl-T
| Inverts all selected objects. |
IlvKeyUp
| Y
| Horizontally flips the selected objects. |
IlvKeyUp
| y
| Vertically flips the selected objects. |
IlvKeyUp
| .(dot)
| Flips the selected objects both horizontally and vertically. |
IlvKeyUp
| Ctrl-C
| Copies selected objects into the clipboard. |
IlvKeyDown
| Ctrl-V
| Inserts objects from the clipboard. |
IlvKeyUp
| Ctrl-X
| Deletes selected objects but saves them into the clipboard. |
IlvKeyDown
| R
| Rotates the view 90 degrees counter-clockwise. |
IlvKeyDown
| C
| Centers the view on the indicated point. |
IlvKeyUp
| T
| Encapsulates relevant object in an
IlvTransformedGraphic . |
type | The event type. |
buttonOrKey | The event data. |
modifiers | The event modifiers. |
void IlvManager::removeAccelerator | ( | IlvManagerAccelerator * | ) |
Installs an event hook on the manager.
The last event hook installed is the first to be called when an event occurs.
IlTrue
on success. If the hook is already installed on a manager, this member function does nothing and returns IlFalse
. hook | The event hook. |
void IlvManager::removeAccelerators | ( | ) |
Removes all accelerators.
This method removes all accelerators from the manager.
void IlvManager::removeCallback | ( | const char * | callbackName | ) |
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.
callbackName | The character string. |
callback | The user function. |
void IlvManager::removeDrawHook | ( | IlvManagerDrawHook * | hook | ) |
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.
count | The number of graphic objects in the array. |
objects | The array of graphic objects. |
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.
0
. hook | The manager hook. |
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.
view | The manager view. |
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.
layer | Indicates 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. |
IlvManagerLayer* IlvManager::removeLayer | ( | IlvManagerLayer * | ) |
Indicates whether a layer is considered visible by the manager.
IlTrue
if the layer is visible from the manager point of view. The layer may still be hidden in a manager view. layer | The index of the layer. |
|
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.
object | The graphic object. |
redraw | Indicates whether the manager must immediately redraw the area occupied by the object. |
destroy | Indicates whether the manager must delete the object after removing it. |
IlFalse
on error (the object cannot be removed) and IlTrue
on success. IlvManager::addObject
member function. 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.
hook | The selection hook. |
0
otherwise. You can delete the returned value if it is no longer needed, or install the hook on another manager.
|
virtual |
Removes a smartset from the manager.
The objects are renamed to their intrinsic name.
IlFalse
on error, that is, if the smartset is not in this manager. set | The smartset. |
Removes graphic objects associated with a given tag.
Removes from the manager all the objects associated with the specified tag.
tag | Specifies a tag. |
redraw | Specifies whether the manager must redraw the invalidated regions occupied by the objects. |
Removes a view from the manager view list.
The view is no longer handled by the manager.
view | The manager view. |
IlTrue
on success, and IlFalse
on error (the view could not be detached). Reimplemented in IlvGadgetManager.
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.
hook | The manager view hook. |
IlvManagerLayer* IlvManager::replaceLayer | ( | IlvManagerLayer * | newLayer, |
int | index | ||
) |
Indicates whether a layer is considered visible by the manager.
IlTrue
if the layer is visible from the manager point of view. The layer may still be hidden in a manager view. layer | The index of the layer. |
|
virtual |
Resizes a graphic object to fit in a rectangle.
Modifies the object size so that its new bounding box becomes the specified rectangle.
object | The graphic object. |
bbox | The rectangle. |
redraw | Specifies whether the manager must redraw the invalidated regions occupied by the object. |
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.
view | The manager view. |
point | Specifies the invariant point of the transformation. |
angle | The rotation angle in degrees. |
redraw | Indicates whether the manager must redraw the objects in the view after the transformation. |
Resizes the selected graphic objects to the same height.
Makes the height of all selected objects the same as the first selected object.
redraw | Specifies whether the manager must redraw the invalidated regions occupied by the objects. |
Resizes the selected graphic objects to the same width.
Makes the width of all selected objects the same as the first selected object.
redraw | Specifies whether the manager must redraw the invalidated regions occupied by the objects. |
|
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.
stream | The output 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.
IlvManagerInputFile
, or a subclass. stream | The input stream. |
Selects all the objects of the manager.
redraw | Specifies whether the manager must refresh its views. |
|
static |
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.
view | The view. |
|
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 | The manager view. |
color | The background color. |
bitmap | The background bitmap. |
Reimplemented in IlvGadgetManager.
void IlvManager::setCleanFunction | ( | IlvApplyObject | func | ) |
Sets a function to be called when an object is removed from the manager.
func | Specifies 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. |
void IlvManager::setClientData | ( | IlAny | data | ) |
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.
count | The number of graphic objects in the array. |
objects | The array of graphic objects. |
void IlvManager::setCreatorPalette | ( | IlvPalette * | palette | ) |
Sets the default palette used to create new graphic objects interactively.
palette | The palette. |
IlBoolean IlvManager::setDoubleBuffering | ( | const IlvView * | view, |
IlBoolean | useDB, | ||
IlBoolean | tmp = IlFalse |
||
) |
Enables or disables double buffering for a manager view.
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
. view | The manager view. |
useDB | IlTrue to enable double buffering and IlFalse to disable it. |
tmp | Not documented |
void IlvManager::setDoubleBufferingColor | ( | IlvColor * | color | ) |
Enables or disables double buffering for a manager view.
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
. view | The manager view. |
useDB | IlTrue to enable double buffering and IlFalse to disable it. |
tmp | Not documented |
void IlvManager::setDoubleBufferingHandler | ( | IlvManagerDblBufferHandler * | ) |
Enables or disables double buffering for a manager view.
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
. view | The manager view. |
useDB | IlTrue to enable double buffering and IlFalse to disable it. |
tmp | Not documented |
void IlvManager::setEditable | ( | IlvGraphic * | object, |
IlBoolean | editable | ||
) |
Indicates whether a graphic object can be edited.
object | The graphic object. |
editable | IlTrue to set the object as editable and IlFalse otherwise. |
IlvEditableFilter* IlvManager::setEditableFilter | ( | IlvEditableFilter * | ) |
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
creates layers 3
, 4
, and 5
. An object cannot be added to a manager more than once.
object | The graphic object. |
redraw | Indicates whether the manager must immediately display the object. |
layer | Specifies the layer index where the object must be inserted. The default value -1 indicates that the object is stored in the last (topmost) layer. |
IlvManager::addObject
or IlvManager::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
. 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.
view | The manager view. |
grid | The manager grid. 0 is specified to disconnect the view from the current grid. |
void IlvManager::setInsertionLayer | ( | int | layer = -1 | ) |
Sets the layer where new objects created interactively using the predefined interactors will be stored.
layer | The index of the layer. |
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
.
i | The view interactor. 0 is not a valid value (use IlvManager::removeInteractor to detach an interactor from a view). |
view | The manager view. If 0 is specified, the method uses the view used to create the interactor. |
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.
view | The manager view. |
ratio | Set to IlTrue to respect the x/y ratio and IlFalse otherwise. |
redraw | Indicates whether the manager must redraw the objects in the view if the transformer is changed. |
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.
object | The graphic object. |
layer | The index of the destination manager layer. |
redraw | Specifies whether the manager must redraw the invalidated region occupied by the object. |
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.
func | The new selection function. |
IlvSelectionInterface
class. It allows you to associate different subclasses of IlvDrawSelection
with different subclasses of IlvGraphic
. IlvSelectionInterface
IlvManagerLayerFactory* IlvManager::setManagerLayerFactory | ( | IlvManagerLayerFactory * | ) |
Indicates whether a layer is considered visible by the manager.
IlTrue
if the layer is visible from the manager point of view. The layer may still be hidden in a manager view. layer | The index of the layer. |
void IlvManager::setModified | ( | IlBoolean | value | ) |
Sets the modification status of the manager.
value | IlTrue to set the manager status as modified, IlFalse to unset it. |
void IlvManager::setMoveable | ( | IlvGraphic * | object, |
IlBoolean | moveable | ||
) |
Sets the moveability of a graphic object.
object | The graphic object. |
moveable | IlTrue to set the object as moveable, and IlFalse otherwise. |
|
virtual |
Sets the name of the manager.
name | The new name. The string is copied. |
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.
numLayers | The number of layers. |
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.
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
. object | The graphic object. |
i | The object interactor. |
|
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 IlvManager::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.
object | The graphic object. |
name | The name to set on the graphic object. |
IlTrue
on success, and IlFalse
on failure. 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 IlvManager::applyToObjects
or changeValues
.
reDrawMode | Can 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 IlvManager::applyToObjects ). |
void IlvManager::setResizeable | ( | IlvGraphic * | object, |
IlBoolean | resizable | ||
) |
Sets a graphic object as resizable or not resizable.
object | The graphic object. |
resizable | IlTrue to set the object as resizable, and IlFalse otherwise. |
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.
layer | The index of the manager view. |
selectable | IlTrue to enable the selection in the layer, and IlFalse to disable it. |
|
virtual |
Sets a graphic object as selectable or not selectable.
Sets the selectable attribute of the object object to the value of selectable.
object | The graphic object. |
selectable | IlTrue to set the object as selectable, and IlFalse otherwise. |
|
virtual |
Selects or deselects a graphic object.
Selects or deselects an object in the manager.
object | The graphic object. |
selected | IlTrue if the graphic object must be selected, IlFalse otherwise. |
redraw | Specifies whether the manager must redraw the invalidate region occupied by the selection object. |
Reimplemented in IlvGadgetManager.
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.
tag | Specifies a tag. |
selected | Indicates whether the graphic objects must be selected. |
redraw | Specifies whether the manager must redraw the invalidated regions occupied by the selection objects. |
|
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.
view | The manager view. |
t | The transformer. |
void IlvManager::setUndoEnabled | ( | IlBoolean | enable | ) |
Enables or disables the possibility of undoing commands in the manager.
enable | IlFalse to disable Undo, IlTrue to enable it (this is the default state of the manager). |
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.
layer | The manager layer. |
visible | IlTrue to set the layer as 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.
view | The manager view. |
layer | The index of the layer. |
visible | IlTrue to set the layer as visible. |
void IlvManager::setVisible | ( | IlvGraphic * | object, |
IlBoolean | visible, | ||
IlBoolean | redraw = IlFalse |
||
) |
Sets the visibility of a graphic object in the manager to visible. The method calls the IlvManagerViewHook::contentsChanged
member function of the hook objects that are linked to the manager. This member function does not redraw the bounding box of the object.
object | The graphic object. |
visible | IlTrue to set the object as visible, and IlFalse to make it invisible. |
redraw | Specifies whether the manager must redraw its contents. |
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
).
IlTrue
if a matching accelerator is found; the accelerator action is then called. If no matching accelerator is found, IlFalse
is returned. event | The incoming event. |
view | The manager view. |
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.
view | The manager view. |
p | Specifies 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. |
IlvGraphic* const* IlvManager::sortObjects | ( | IlvGraphic *const * | objs, |
IlUInt | count | ||
) | const |
Sorts a set of object.
The objects are sorted by redraw order.
objs | The objects array which must be sorted. |
count | The object count of the array. |
IlPoolOf(Pointer)
and should not be deleted or modified. 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.
layer1 | The index of a manager layer. |
layer2 | The index of another manager layer. |
redraw | Specifies whether the manager must redraw the invalidated regions occupied by the objects. |
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.
view | The manager view. |
p | Specifies 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. |
IlFalse
if the view is not associated with the manager, otherwise 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.
object | The graphic object. |
dx | The horizontal translation offset. |
dy | The vertical translation offset. |
redraw | Specifies whether the manager must redraw the invalidated regions occupied by the object. |
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.
view | The manager view. |
dx | Translation along the horizontal axis. |
dy | Translation along the vertical axis. |
redraw | Indicates whether the manager must redraw the objects in the view after the transformation. |
|
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.
object | The graphic set. If it is not a subclass of IlvGraphicSet , nothing is done. |
undoCommand | IlFalse indicates that you do not want to store this action in the command stack of the manager. |
void IlvManager::unregisterCallback | ( | const char * | callbackName | ) |
Removes the callback function registered with the specified name from the callback list.
callbackName | The callback name. |
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.
count | The number of graphic objects in the array. |
objects | The array of graphic objects. |
Reimplemented in IlvGadgetManager.
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 IlvManager::lastContains
member function but only on selected objects. It is generally used to get the selected object located at the cursor location.
0
if there is none. p | The point, in the coordinate system of the view. |
view | The manager view. |
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.
view | The manager view. |
point | Specifies the invariant point of the transformation. |
scalex | Zooming factor on the horizontal axis. |
scaley | Zooming factor on the vertical axis. |
redraw | Indicates whether the manager must redraw the objects in the view after the transformation. |
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.