namespace services overview

Included by: zmodeler.h

Description

services namespace is a logical group of interfaces that serve to other interfaces as common helpers. Services do not have visual appearence in ZModeler, but they perform a lot of work internally.

Obtaining service interfaces.

Interface form services namespace could be common (one instance of service is shared across ZModeler run) or unique (when instance is created on demand). Common instances are provided by core::IRepository with getService method while unqiue instances are provided with createService method. This is solely implementation-specific of services, whether they expect only one shared instances or could have several instances.

Without confusing plug-in developers, ZModeler SDK provides functions to obtain desired service with common semantic: get:Name:Service, in helper file helpers/services.h. Each function provides an interface pointer onto requested service, so you don't need to bother with core::IRepository methods directly.

Definitions

DSS_* Definitions and macros for IDialogSizingService.
MB_* Definitions for IMessageBoxService.
RENDMAN_* Definitions for IRenderManager.

General interfaces in namespace services

IService Base interface for services. Provides the only common method for initialization.
IUIService Direct derivation from IService interface, IUIService is a user interface service. It has no methods and used as a base for services which work with ZModeler's user interface. In other words, services derived from this interface can not exist when main window of ZModeler is not created. When closing ZModeler, these servides are released prior ZModeler window closes. Services which do not inherit this interface can be created at anytime and can persist after the main ZModeler window is closed.

User-interface, rendering and visalization-related services.

ICommandsBarService Services represents ZModeler's tools box, a so-called Commands Bar. This service is used to deploy tools in commands bar, and provides a tools on demand. Implementation of this service takes care of drawing, displaying dialog boxes, managing tools selection and so on.
IConfigurationService ZModeler has a single property sheet for configurating it's behaviour and provide settings for add-on modules. It's recomended to use this service instead of adding separate configuration boxes for your tools. The service is implemented in one dialog box with a tree-structure on the left side and a field for dialog box on the right side. You can add dialog boxes into this service as core::layout::IChildDialog interfaces. Also, this service provides a configuration page for so-called static properties which is preseted with IPropertiesService.
IDialogSizingService Native ZModeler support for stratchable dialog boxes is implemented by this service which subclasses CWnd object and allows repositioning and resizing of controls in it.
IDialogDisplayService This service allows you to disaply instances of core::layout::IChildDialog interfaces in some container. You can have several dialogs and display the one you need at a time. For example, the right pane of IConfigurationService displays desired configuration dialog by means of this service.
IMultyDialogDisplayService Extends IDialogDisplayService by allowing display several dialog at a time, using a so-called roll-up technique when single dialog can be minimized to a row-button with a title on it. User can expand dialogs he need by pushing buttons with dialog titles.
IToolBarService This service represents a single instance of ToolBar and holds an interface pointer to core::ui::IToolBar.
IMenuService Each menu in ZModeler is an instance of this interface, either it a menu in window, or a pop-up menu. The service allows adding of tools (extracts images if available), or generic command ID items. If tools support core::IStatus interface, menu could use it to display disabled (dimmed) items or place checkmarks next to items.
INodeService Service creates instances of scene::INode-derived interfaces.
IViewportService Instances of core::ui::IView and core::ui::IViewport are created by means of this service. Initial setup, deploy of viewport layers is a task of this service too.
IRenderManager The main rendering code, that wraps Direct3D rendering, is concentrated in this manager. It also provides IMaterialsService and ITexturesService interfaces.
IMaterialsService Materials management service. This service creates materials and manages them with a so-called materials editor which is also implemented by the instance of this service. You can extend materials editor by either implementing your own instances of rend::IMaterial interface or by adding extensions into materials editor as child dialogs.
ITexturesService Management of textures and core:io::ITextureLoader interfaces is a task of ITexturesService.
IPropertiesService This service is used to provide user a configurateable options set, which is organized in tree structure and allows user to make some changes. There are two types of this service implemented at the moment: the first one is a so-called "static properties", which is provided and managed by IConfigurationService; and the second one is a dynamic context menu properties which is displayed for a set of items in some context.
IPropertiesSource Most of adjustable scene elements are expected to have ability to change some options or properties after creation. For example, geometry mesh should be able to change vertices format, lights should be able to change color or some other attributes. The code which is able to make these changes should be provided as a IPropertiesSource to IPropertiesService, and when properites sheet is displayed for some nodes or elements, properites source is queried for a set of items it could change in these nodes or elements.
ITimerService Timers in ZModeler are implemented by ITimerService which allows to map several events to one timer. Since timers are limited system resources, their proper usage is an important task of this service.

Messaging services.

IMessagingService Base abstract interface for messaging. In current implementation, this interface is used as a base for error messaging or when displaying user a ZModeler-styled message box.
IErrorMessagingService Error messaging service is used to show error/warning/hint notifications to user. In current implementation, it occupies a dockable bar with treen-control in it and usually docked at the bottom of main window.
IMessageBoxService ZModeler has it's own styled message box with icons and a support for displaying core::layout::IChildDialog in it. Thus, for example, if you need to pop-up a message box to the user with more options that just several buttons, this service is your choice. In any case, it's recomended to use this service for any "message box cases".

Generic workflow-support services.

IBindService Binding service manages bind sources, bind targets and bind conditions.
IHotkeysService This service implements hotkeys for dynamic structure of ZModeler. There could be different set of plugins and certain functions appear when user installs add-ons. Hotkeys service allows to assign keys combinations to different tools and fully manageable by user.
ILocalizationService Localization service is used to present ZModeler's user interface and item labels in user's native language. In general, ZModeler's serivces implementations perform localization of tools and dialog boxes automatically, but in certain cases you should deal with this service directly.
ISnappingProcessor Instances of ISnappingProcessor are registered in ISnappingService and used to perform snapping of user input.
ISnappingService This service is used to alter user input in viewports by snapping input arguments to some elements of scene: vertices, lines, or viewport grid.
IUndoService ZModeler is designed to be able to Undo any modifications made in scene. It provides a set of commonly used undo operations, but if your tool need some complex routines to perform undo, you can implement your own core::undo::IUndoBlock interface. Undo service allows complex undo branches, when a set of operations is considered as logically single operation and can be undone as a whole.

Stream input/output and related services.

IImportExportService Instances of core::io::IImportExportFilter are registered in this service so it can perform importing and exporting.
IOpenSaveService This service holds an instances of core::io::ISerializeable, maps them to IDs when opening or saving the scene.
IProfilingService ZModeler does not uses windows registry to store data. Instead, it uses ZModeler2_profile.xml file to store configuration and settings. This service provide methods for reading and writing data into ZModeler's profile.
IXMLParseService This service wraps loading of XML by means of core::events::IXMLHandler.
IXMLWriteService XML files are written and formated by means of IXMLWriteService.
See Also:
References overview
core::IRepository::getService method
core::IRepository::createService method