Passer au contenu principal

OXARoundMenu.xml and RCARoundMenu.xml

…rhinoCapture offers 2 radial menus, configured by two separate files with the same format:

  • RCARoundMenu.xml configures the radial menu of rhinoCapture displayed by the command CaptureDisplayRoundMenu
  • OXARoundMenu.xml configures the radial menu of Oxalis displayed by the command Oxalis_DisplayRoundMenu. This menu exists only in the STEREO edition.

A radial menu is an on-screen menu, displayed under the cursor, which appears when the corresponding command is called. This command can therefore easily be assigned to a keyboard shortcut or to a click of a pointing device.

These two files follow the same mechanism as ControllerConfig.xml and RhinoCapture.xml: each user has their own copy, in their personal folder C:\Users\<user>\RhinoTerrainSAS\8.

This copy is the one used by rhinoCapture, so it is the one you must customize.

It is created on first use from the corresponding default file, OXARoundMenu.Default.xml or RCARoundMenu.Default.xml, supplied in the \Cfg subfolder of the installation folder of the plugin concerned. This default file serves only as a reference: it is never read by rhinoCapture or Oxalis and must not be modified — if needed, it lets you start over from the original menu.

Since your custom menus are stored in your profile, they survive rhinoCapture STEREO updates. To replicate a menu on another workstation or for another user, simply copy the file.

The content and appearance of both menus are fully customizable: the default versions supplied are only a starting point.

The format described in the rest of this section applies to both files.

When using a full path, you can use {PlugIn} as an alias for the installation folder of the plugin (e.g. C:\Program Files\RhinoCapture_8\Bin).

The configuration file is an XML file, formatted as follows:

<ToolBar_UI version="1.0">
<font>Arial</font>
...
<style> ... </style>
...
<cell>
...
</cell>
</ToolBar_UI>

 Element<ToolBar_UI>

The base element is <ToolBar_UI>.

It can have a version attribute, which defaults to 1.0.

The <ToolBar_UI> element can have three types of child elements: <font>, <style> and <cell>.

 Element<font>

The <font> element loads a font.

It must contain the name of a system font, as found in the C:\Windows\Fonts folder, or the full path to a font file.

Element<style> 

The <style> element defines the appearance of a menu cell. It can have a class attribute, which identifies the style so that it can be applied to cells. If the class attribute is missing, it is treated as empty and becomes the default style.

A <style> element can have the following child elements:

Element

Description

Default value

<text-color>

Sets the text color.

#000000 ■

<border-color>

Sets the color of the cell borders.

#000000 ■

<cell-color>

Sets the background color of the cells.

#F2F2F2 ■ idle

#E6E6E6 ■ on hover

#CCCCCC ■ on click

<text-size>

Sets the text size. Corresponds to the size, in pixels, of the lowercase letter ‘o’.

12px

<border-width>

Sets the width of the cell borders, in pixels.

1px

<cell-width>

Sets the width of a cell. Corresponds to the size, in pixels, of the mean arc of the cell.

For the initial cell, corresponds to the diameter of the circle.

50px

<childs:cell-height>

Sets the height of the child cells, in pixels.

40px

<childs:cell-spacing>

Sets the spacing between the cell and its children, as well as between those children, in pixels.

3px

The five size elements expect a decimal number as their value.

The three color elements, <text-color>, <border-color> and <cell-color>,, expect a hexadecimal color code as their value. This is the hash sign #, followed by 6 or 8 hexadecimal characters (the 10 digits + the letters A to F). The characters, in pairs, represent the red, green, blue and opacity components of the color, respectively. 00 represents the minimum value, while FF represents the maximum value. If opacity is not included, the color is fully opaque.

In addition, these three elements accept a state attribute. This attribute can have one or more of these values, separated by a comma: idle, hover and pressed. They indicate in which state of the cell the color is used: respectively the default state, when the cursor hovers over the cell, and when the cell is clicked. If this attribute is missing or empty, the color is applied to all three states.

 Element<cell> 

The <cell> element defines a menu cell. You can define the text it contains, the text displayed in its tooltip, the command to run on click, and its child cells. A <cell> element is formatted as follows:

<cell class="...">
<text>Lorem Ipsum</text>
<tooltip>Call the command "Lorem Ipsum"</tooltip>
<command>!_CmdLoremIpsum</command>
<style> ... </style>
<cell> ... </cell>
...
</cell>

It has a class, referencing the class attribute of the <style> tag defined at the root. This applies the appearance defined by that <style> to this cell. If the class attribute is missing, it is treated as empty.

A <style> element can be declared if customizations must apply to this cell only. It is formatted as described above. Any style property not specified is taken from the style linked by the attribute class.

The <text> element defines the text displayed in the cell. Line breaks are preserved, but leading and trailing spaces on each line are not.

The <tooltip> element defines the text displayed in the tooltip that appears when the cursor hovers over the cell. Line breaks are preserved, but leading and trailing spaces on each line are not.

The <command> element defines the command to run at the Rhino command prompt.

As many <cell> elements as desired can be added. Each one defines a cell that appears only when the parent cell is hovered over. Their order is kept as defined, and their format is the same as described here.

Example

The following file produces this menu:

<?xml version="1.0" encoding="UTF-8"?>
<ToolBar_UI version="1.0">
    <style>
        <text-size>15</text-size>
    </style>
    <style class="Command">
        <cell-color state="idle">#C1D6E5</cell-color>
        <cell-color state="hover">#9AC6E5</cell-color>
    </style>
    <cell>
        <text>Base</text>
        <cell>
            <text>0</text>
            <cell class="Command">
                <text>A</text>
                <tooltip>
                    Runs the command
                    "TestCommandA"
                </tooltip>
            </cell>
            <cell class="Command"> <text>B</text> </cell>
        </cell>
        <cell> <text>1</text> </cell>
        <cell> <text>2</text> </cell>
        <cell> <text>3</text> </cell>
    </cell>
</ToolBar_UI>