The simplest geometric primitive in HOOPS Visualize is a marker, which is used to represent a point in space. With one exception, markers are two-dimensional geometry with the marker always oriented to face the camera, but can be positioned anywhere in 3D space.
The default marker symbol is a small filled circle, and the default marker visibility setting is off (see this section for instructions on enabling marker visibility). The marker symbol is set using HPS::MarkerAttributeControl::SetSymbol as demonstrated in this snippet:
Like other geometry, markers can be inserted using a HPS::MarkerKit. However, the benefit to doing this is limited as there is only one parameter to set, the position. It should be noted that a segment's active marker symbol is also used to draw geometry vertices for shells and meshes.
When possible, Visualize will use hardware paths to draw markers. However, this means we sometimes run into the situation where the hardware has a maximal size for hardware markers - any markers larger than this are shrunk to the hardware maximum. This setting should be left at the default value of Marker::DrawingPreference::Fastest in all cases unless such a problem is directly seen, in which case Marker::DrawingPreference::Nicest can be used to ensure markers are drawn properly. As this incurs a performance cost, we recommend only setting Nicest at the segment where the too-large markers live, and to set Fastest in all other places.
Marker size is controlled by calling HPS::MarkerAttributeControl::SetSize. Note the default size is fixed - the marker will not change size due to camera or modelling matrix changes. If no marker size-unit parameter is given when calling HPS::MarkerAttributeControl::SetSize, the marker is linearly scaled by the default marker size. Note that several of the marker size-units will result in 'view-dependent' sizing, where the marker size will change as the camera or modelling matrices change.
NOTE: The "Dot" marker symbol is a special case and cannot be resized.
In the code snippet above, an enum Marker::DrawingPreference has been applied to the markers' attributes. When possible, Visualize will use hardware paths to draw markers. However, this means we sometimes run into the situation where the hardware has a maximal size for hardware markers - any markers larger than this are shrunk to the hardware maximum.
This setting should be left at the default value of Fastest in all cases unless markers are appearing smaller than desired on certain hardware, in which case Marker::DrawingPreference::Nicest can be used to ensure markers are drawn at the proper size. Because this incurs a performance cost, we recommend only setting Nicest at the segment where the oversize markers live, and to set Fastest in all other places.
As with other geometry, markers can be modified after insertion by using the marker's key. However, the actions available for modifying a marker are limited:
Marker color is controlled at the segment level using the HPS::MaterialMappingControl (for a discussion on materials, see this section). To toggle the visibility of markers, use the HPS::VisibilityControl of the segment key:
For applications that require markers in a grid pattern, it is possible to insert multiple markers using a mesh with face and edge visibility turned off. This technique is slightly more efficient in terms of space, and produces identical results. The mesh primitive is discussed here.
If you have inserted a large number of markers into your scene (on the order of 10,000 or more), we suggest that you explore using vertex markers as an alternative way to represent your data. This approach will result in more efficient rendering and lower memory usage.