<window> ‐ A container for the layout of the rendering window(s)
Name | Type | Defaults |
---|---|---|
id | ID | None (required) |
width | INTEGER | 800 |
height | INTEGER | 600 |
x | INTEGER | 0 |
y | INTEGER | 0 |
type | STRING | main-window |
user_id | STRING | Empty string |
main_window_id | STRING | Empty string |
ratio | STRING | no_ratio |
mouse_passive_selection | BOOLEAN | false |
passive_highlight | BOOLEAN | true |
mouse_drag | BOOLEAN | true |
mouse_active_selection | STRING | left_button |
mouse_navigation | STRING | right_button |
This element defines the layout of the windows in which geometry is rendered.
The string value of the id attribute defines the window name and the window title that will be displayed. The string value of the user_id attribute defines the ID of the current user associated with this window.
If the string value of the type attribute is main-window the window is a main window: an active window that displays the current viewpoint associated with user user_id. If the string is equal to NULL, no user is associated with this window and the window is blanked. It can be used as a container for sub-windows. Otherwise, the user is the first user with an id attribute equal to user_id that is encountered in a depth-first traversal of the scene graph. If the type value is monitor_window, the window is an auxiliary window in which the content of the associated main-window is displayed. For auxiliary windows, the string value of the main_window_id attribute defines the ID of the main window is copied in this window.
Window layouts can be embedded. The top windows are displayed as autonomous framed windows. The nested windows (sub-windows) are part of a top window or a sub-window. In Figure 3-2, two sub-windows of equal size are displayed as sub-windows of a top window. An additional monitor top window copies the content of the leftmost sub-window.
The integer values of the width, height, x, and y attributes define the size of the window and its position on the display. If the window is a top window, the values of these attributes are absolute values. If the window is a sub-window, the values are relative values: ratios of the length and width of their ancestor window.
The string value of the ratio attribute controls the width/height ratio of the window size that will be preserved when resizing the window (the largest dimension is maximized). If the value is window_ratio, the value of the width and height attributes define the initial dimensions and width/height ratio. If the value is view_volume_ratio the width/height ratio of the perspective or orthogonal view volume or the current user defines width/height ratio of the window. If the value is no_ratio (the default value) width and height are independently maximized. In this case output image can be distorted.
The boolean value of the mouse_passive_selection attribute defines whether passive selection of objects in this window is active or not. If it is active, the bounding boxes of the scene objects contained in scene nodes are used for selection. The boolean value of the testable attribute of the scene node must be true to enable passive selection (see Section 2.6.1 and Section 2.6.2). If the boolean value of the passive_highlight attribute is true, the bounding boxes of the passively selected objects is rendered by a red wireframe.
The string values of the mouse_active_selection and mouse_navigation attributes can take one of the following three values: left_button, middle_button or right_button. The boolean value of the interactable and draggable attributes of the scene node must be true to enable active selection and dragging (see Section 2.6.1 and Section 2.6.2). Navigation consists in pressing the associating button and using the mouse to define the motion direction. By pressing the shift key, motion is performed backwards instead of forward.
The boolean value of the mouse_drag attribute defines whether object dragging through the mouse button defined by mouse_active_selection is active or not for the considered window. If the value is set to true, only nodes whose draggable attribute is true can be dragged and dropped
The beginning and end of navigation are triggered by pressing and releasing the mouse button defined for navigation through the mouse_navigation attribute. Beginnning and end of navigation cause messages sensor-mouse-navigation and sensor-mouse-end-navigation to be sent to all the active users (users currently bound to one of the windows).
The auxiliary windows cannot be interacted with and only contain a copy of the bitmap displayed in the associated main window. Only the first main window is in full screen mode if this mode is selected in the full_screen attribute of the display element.
This element can contain as many window layouts as sub-windows.
The example below defines two top windows. The first one, ID frame, size 750×375, has its top left corner is located at (0,0). This window is blank because it is associated with a NULL user. The frame top window is used as a container for main and superviser sub-windows, each has a display of 375×375 pixels. The ratio attribute of such a container window should be no_ratio. Initial main and superviser windows ratio (equal width and height) will be preserved when resizing the top window for the top window and its two sub-windows. Similarly, the auxiliary window W/H ratio will also be preserved after resizing. In both windows, passive selection is enabled, active selection is possible through the mouse left button and navigation through the mouse right button.
The leftmost window is associated with user user_main, the rightmost is associated with user_superviser. The IDs of these two sub-windows are respectively main and superviser. A second top window is located besides window frame. This window is a monitor window which copies the content of main window, the left sub-window of frame (see Figure 3-2).
<windows> <window type="main-window" id="frame" width="750" height="375" x="0" y="0" user_id="NULL" ratio="no_ratio" > <window type="main-window" id="main" width="0.5" height="1.0" x="0" y="0" user_id="user_main" ratio="window_ratio" mouse_passive_selection="true" mouse_active_selection="left_button" mouse_drag="true" mouse_navigation="right_button" /> <window type="main-window" id="superviser" width="0.5" height="1.0" x="0.5" y="0" user_id="user_superviser" ratio="window_ratio" mouse_passive_selection="true" mouse_active_selection="left_button" mouse_drag="false" mouse_navigation="right_button" /> </window> <window type="monitor-window" id="copy" width="150" height="60" x="750" y="0" main_window_id="main" ratio="window_ratio" /> </windows>