#include <hps.h>
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 |
Create an application window for the given window handle that Visualize can draw into with the specified driver. By default Visualize will try to create an anti-alias capable driver.
in_window_handle | Handle to the window that Visualize will draw into. |
in_driver | Type of driver Visualize should create. Defaults to Window::Driver::Default3D. |
|
static |
Create an application window for the given window handle that Visualize can draw into with the specified options.
in_window_handle | Handle to the window that Visualize will draw into. |
in_options | Options for the application window. |
|
static |
Create a new EventDispatcher with a dedicated thread ready to dispatch events to handlers.
|
static |
Create a new EventDispatcher with a dedicated thread ready to dispatch events to handlers.
in_name | A specific name for the new dispatcher. |
|
static |
Create an offscreen window of the given height and width with the specified driver. By default Visualize will try to create an anti-alias capable driver.
in_width | Width of the offscreen window in pixels. |
in_height | Height of the offscreen window in pixels. |
in_driver | Type of driver Visualize should create. Defaults to Window::Driver::Default3D. |
|
static |
Create an offscreen window of the given height and width with the specified options.
in_width | Width of the offscreen window in pixels. |
in_height | Height of the offscreen window in pixels. |
in_options | Options for the offscreen window. |
|
static |
Create an offscreen window with the specified driver. By default, Visualize will try to create an anti-alias capable driver.
in_destination_image | An RGB or RGBA image definition that the offscreen window will be rendered to. |
in_driver | Type of driver Visualize should create. Defaults to Window::Driver::Default3D. |
|
static |
Create an offscreen window of the given height and width with the specified options.
in_destination_image | An RGB or RGBA image definition that the offscreen window will be rendered to. |
in_options | Options for the offscreen window. |
|
static |
Create a new portfolio.
|
static |
Create a new root segment, i.e., a segment without an owner.
|
static |
Create a stand-alone window with the specified driver. By default Visualize will try to create an anti-alias capable driver.
in_driver | Type of driver Visualize should create. Defaults to Window::Driver::Default3D. |
|
static |
Create a stand-alone window with the specified options.
in_options | Options for the stand-alone window. |
|
static |
This function will pump the stand-alone window event system once by default. If once is false then the calling thread will loop pumping events and will only return when the last window of any type exits.
in_once | determines if the stand-alone events are pumped once or forever. |
|
static |
Provides the filter state of an ErrorEvent.
in_code | The info code in to operate on. |
|
static |
Get the event dispatcher associated with the database. All database information, errors and warnings will be injected into this EventDispatcher.
|
static |
Provides the filter state of an InformationEvent.
in_code | The info code in to operate on. |
|
static |
Get the material library portfolio. This is the portfolio which contains all relevant definitions for materials coming from the material library. It is provided to facilitate importing definitions from this portfolio, or to allow examination of the definitions in the portfolio. It should not be deleted, and if it is, the scene will not render correctly if a file was loaded which depended on the material library.
|
static |
Get a list of all portfolios which are active (have been created but not deleted).
|
static |
Get a list of all root segments which are active (have been created but not deleted).
|
static |
Gets the value at which the EmergencyHandler will be activated for SoftMemoryLimit.
|
static |
Queries the number of milliseconds that have elapsed since Visualize started.
|
static |
Provides the filter state of a WarningEvents.
in_code | The info code in to operate on. |
|
static |
Get a list of all windows (application, stand-alone, and offscreen) which are active (have been created but not deleted).
|
static |
Checks whether the specified driver type is present and available for use.
in_driver | the driver type to check availability for. |
|
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 |
Performs a complete reset of the Visualize database. All segments are deleted and all window displays are terminated. This will leave all keys, controls, and dispatchers invalid. Kits are preserved. This can never be called from inside an event handler.
It may be appropriate to call this method if your application doesn't need to use Visualize for a while.
|
static |
Performs an object space selection by ray starting at the specified segment using the specified selection options.
in_start_point | Start point of ray. |
in_direction | Direction vector for ray. |
in_options | Selection options to use when performing the selection. |
out_results | Results of the selection. |
|
static |
Performs an object space selection by shell starting at the specified segment using the specified selection options.
in_shell | Shell to use to perform the selection. |
in_options | Selection options to use when performing the selection. |
out_results | Results of the selection. |
|
static |
Performs an object space selection by shell starting at the specified segment using the specified selection options.
in_shell | Shell in the database to use to perform the selection. |
in_options | Selection options to use when performing the selection. |
out_results | Results of the selection. |
|
static |
Performs an object space selection by volume starting at the specified segment using the specified selection options. If the volume is invalid, i.e., min > max for any component, an exception will be thrown.
in_volume | Volume to use when performing the selection. |
in_options | Selection options to use when performing the selection. |
out_results | Results of the selection. |
|
static |
Sets a custom EmergencyHandler.
in_emergency_handler | The EmergencyHandler to use. |
|
static |
Sets if a specific code for ErrorEvent should be filtered.
in_code | The info code in to operate on. |
in_filtered | The new filter state desired. |
|
static |
Sets if a specific code for InformationEvent should be filtered.
in_code | The info code in to operate on. |
in_filtered | The new filter state desired. |
|
static |
Sets the value at which the EmergencyHandler will be activated for SoftMemoryLimit.
in_limit_bytes | The new limit value in bytes. |
|
static |
Sets if a specific code for WarningEvent should be filtered.
in_code | The info code in to operate on. |
in_filtered | The new filter state desired. |
|
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.
|
static |
Sleep for the number of milliseconds requested.
|
static |
Synchronizes the database, guaranteeing that all queued actions and updates have been performed.
|
static |
Sets the default EmergencyHandler.