|
static void | Execute (bool in_once=true) |
| This function will pump the stand-alone window event system once by default. More...
|
|
static Time | GetTime () |
| Queries the number of milliseconds that have elapsed since Visualize started. More...
|
|
static void | Sleep (Time milliseconds) |
| Sleep for the number of milliseconds requested. More...
|
|
static void | RelinquishMemory () |
| Relinquish any internally cached memory to the system. More...
|
|
static void | ShowMemoryUsage (size_t &out_allocated, size_t &out_used) |
| Returns information about system memory usage. More...
|
|
static void | Reset () |
| Performs a complete reset of the Visualize database. More...
|
|
static void | Synchronize () |
| Synchronizes the database, guaranteeing that all queued actions and updates have been performed. More...
|
|
static WindowKeyArray | GetWindowKeys () |
| Get a list of all windows (application, stand-alone, and offscreen) which are active (have been created but not deleted). More...
|
|
static SegmentKeyArray | GetRootSegments () |
| Get a list of all root segments which are active (have been created but not deleted). More...
|
|
static PortfolioKeyArray | GetPortfolios () |
| Get a list of all portfolios which are active (have been created but not deleted). More...
|
|
static PortfolioKey const | GetMaterialLibraryPortfolio () |
| Get the material library portfolio. More...
|
|
static ApplicationWindowKey | CreateApplicationWindow (WindowHandle in_window_handle, Window::Driver in_driver=Window::Driver::Default3D) |
| Create an application window for the given window handle that Visualize can draw into with the specified driver. More...
|
|
static ApplicationWindowKey | CreateApplicationWindow (WindowHandle in_window_handle, ApplicationWindowOptionsKit const &in_options) |
| Create an application window for the given window handle that Visualize can draw into with the specified options. More...
|
|
static StandAloneWindowKey | CreateStandAloneWindow (Window::Driver in_driver=Window::Driver::Default3D) |
| Create a stand-alone window with the specified driver. More...
|
|
static StandAloneWindowKey | CreateStandAloneWindow (StandAloneWindowOptionsKit const &in_options) |
| Create a stand-alone window with the specified options. More...
|
|
static OffScreenWindowKey | CreateOffScreenWindow (unsigned int in_width, unsigned int in_height, Window::Driver in_driver=Window::Driver::Default3D) |
| Create an offscreen window of the given height and width with the specified driver. More...
|
|
static OffScreenWindowKey | CreateOffScreenWindow (unsigned int in_width, unsigned int in_height, OffScreenWindowOptionsKit const &in_options) |
| Create an offscreen window of the given height and width with the specified options. More...
|
|
static OffScreenWindowKey | CreateOffScreenWindow (ImageDefinition const &in_destination_image, Window::Driver in_driver=Window::Driver::Default3D) |
| Create an offscreen window with the specified driver. More...
|
|
static OffScreenWindowKey | CreateOffScreenWindow (ImageDefinition const &in_destination_image, OffScreenWindowOptionsKit const &in_options) |
| Create an offscreen window of the given height and width with the specified options. More...
|
|
static SegmentKey | CreateRootSegment () |
| Create a new root segment, i.e., a segment without an owner. More...
|
|
static PortfolioKey | CreatePortfolio () |
| Create a new portfolio. More...
|
|
static EventDispatcher | CreateEventDispatcher () |
| Create a new EventDispatcher with a dedicated thread ready to dispatch events to handlers. More...
|
|
static EventDispatcher | CreateEventDispatcher (char const *in_name) |
| Create a new EventDispatcher with a dedicated thread ready to dispatch events to handlers. More...
|
|
static size_t | SelectByShell (ShellKit const &in_shell, SelectionOptionsKit const &in_options, SelectionResults &out_results) |
| Performs an object space selection by shell starting at the specified segment using the specified selection options. More...
|
|
static size_t | SelectByShell (ShellKey const &in_shell, SelectionOptionsKit const &in_options, SelectionResults &out_results) |
| Performs an object space selection by shell starting at the specified segment using the specified selection options. More...
|
|
static size_t | SelectByVolume (SimpleCuboid const &in_volume, SelectionOptionsKit const &in_options, SelectionResults &out_results) |
| Performs an object space selection by volume starting at the specified segment using the specified selection options. More...
|
|
static size_t | SelectByRay (Point const &in_start_point, Vector const &in_direction, SelectionOptionsKit const &in_options, SelectionResults &out_results) |
| Performs an object space selection by ray starting at the specified segment using the specified selection options. More...
|
|
static EventDispatcher const & | GetEventDispatcher () |
| Get the event dispatcher associated with the database. More...
|
|
static bool | GetInformationEventFilter (HPS::Info::Code in_code) |
| Provides the filter state of an InformationEvent. More...
|
|
static bool | GetWarningEventFilter (HPS::Info::Code in_code) |
| Provides the filter state of a WarningEvents. More...
|
|
static bool | GetErrorEventFilter (HPS::Info::Code in_code) |
| Provides the filter state of an ErrorEvent. More...
|
|
static bool | SetInformationEventFilter (HPS::Info::Code in_code, bool in_filtered) |
| Sets if a specific code for InformationEvent should be filtered. More...
|
|
static bool | SetWarningEventFilter (HPS::Info::Code in_code, bool in_filtered) |
| Sets if a specific code for WarningEvent should be filtered. More...
|
|
static bool | SetErrorEventFilter (HPS::Info::Code in_code, bool in_filtered) |
| Sets if a specific code for ErrorEvent should be filtered. More...
|
|
static void | SetEmergencyHandler (HPS::EmergencyHandler const &in_emergency_handler) |
| Sets a custom EmergencyHandler. More...
|
|
static void | UnsetEmergencyHandler () |
| Sets the default EmergencyHandler. More...
|
|
static size_t | GetSoftMemoryLimit () |
| Gets the value at which the EmergencyHandler will be activated for SoftMemoryLimit. More...
|
|
static size_t | SetSoftMemoryLimit (size_t in_limit_bytes) |
| Sets the value at which the EmergencyHandler will be activated for SoftMemoryLimit. More...
|
|
static size_t | GetOOCMemoryLimit () |
| Gets the byte limit used for OOC file loading. More...
|
|
static size_t | SetOOCMemoryLimit (size_t in_limit_bytes) |
| Sets the byte limit used for OOC file loading. More...
|
|
static bool | IsDriverAvailable (HPS::Window::Driver in_driver) |
| Checks whether the specified driver type is present and available for use. More...
|
|
The Database class is a special type that is never intended to be instantiated.
It contains static functions for creating top-level database objects as well as performing global queries and actions.
static void HPS::Database::RelinquishMemory |
( |
| ) |
|
|
static |
Relinquish any internally cached memory to the system.
This can reduce performance and stability if overused. If your application inserts or removes items from the Visualize database continuously, this function should not be used, even as a means of 'obtaining more memory' for the application. Otherwise, Visualize will simply allocate more memory from the operating system. This is slower than using its built in memory manager to allocate from its currently available memory pool. However, if you have a case where database interactions have perhaps reached a point of stabilization (for example, a model is loaded and has been interacted with already, and no other operations are going to incur extra memory usage), this function could prove useful by having Visualize free up its unused portion of allocated memory.
This function should generally not be called on 32-bit Windows operating systems, because it can significantly shorten the life of an application. When memory is freed back to the system on 32-bit Windows, the real memory gets freed and defragmented by the OS, but the virtual address space does not. If an application keeps allocating and freeing system memory during its lifetime, memory will run out due to the address space fragmentation, even though physical memory might still be available. While 64-bit systems do not have the 'virtual address space fragmentation' issue, you typically should avoid calling this method, and rely on Visualize to manage its allocated memory during the lifetime of your application.
Note that you can track Visualize's current memory usage by calling HPS::Database::ShowMemoryUsage.
static void HPS::Database::ShowMemoryUsage |
( |
size_t & |
out_allocated, |
|
|
size_t & |
out_used |
|
) |
| |
|
static |
Returns information about system memory usage.
It may be useful to know how much memory Visualize is using to store graphical information. Visualize utilizes its own internal memory manager. It generally allocates memory in large chunks from the operating system, then parcels the chunks out as needed by the database. Upon entity deletion, Visualize will keep some cached information, as well as the chunks of memory associated with the deleted items, effectively 'recycling' them. Allocated memory indicates the total size of all chunks; used memory indicates the amount that's currently parceled out.
The memory usage information is also useful during debugging - you might be able to use it to determine if your program (or perhaps Visualize) is "leaking" memory - for example, not cleaning up the segment tree properly after a procedure is finished.
Some changes and deletions in the database might cause immediate changes in the memory usage statistics, while others might be delayed until after the next update.
Because of the nature of Visualize's built-in memory allocation methods, only a call to HPS::Database::RelinquishMemory or HPS::Database::Reset can clean up memory that has been allocated but not used and return it to the operating system. However, HPS::Database::RelinquishMemory should be used with care, so be sure to review the documentation.
\param out_allocated Total bytes currently allocated from the OS.
\param out_used Total bytes currently in use by the database.