Overview

Sample Code

Programming Guide

API Reference

Support

9.3 Component hierarchy


HOOPS Visualize uses a generic component hierarchy to represent third-party CAD models which feature topological entities. The component hierarchy is a way to organize the scene graph uniformly across disparate file formats. It also provides developers the ability to extend the capabilities of our importers, as well as to create entirely new importers in a way that is compatible with the Visualize scene graph. The HOOPS Exchange and Parasolid importers both use the component hierarchy.

[figure 9.2.a] The HPS::Component object hierarchy

The major parts of the hierarchy are described below:

Object nameDescription
HPS::CADModel The root entity of the 3D model. Files loaded with the HOOPS Exchange importer will have a root entity of type HPS::Exchange::CADModel. The Parasolid importer uses HPS::Parasolid::CADModel.
HPS::Capture A specific view of an object, including the camera, materials, transforms, etc.
HPS::Filter A collection of visibility settings for a HPS::CADModel
HPS::*::Component A complex object which can represent a variety of model components, including non-geometric components

In general, components refer to Visualize objects, whereas entities refer to the underlying object of the model's native platform. However, there is not a perfect one-to-one mapping between components and entities. For example, some modelling APIs represent faces and edges as two separate entities, but Visualize groups the two into a single shell. For a list of all supported entities and their corresponding components, see the reference manual entry for HPS::Component.

Using a model browser

When loading a model using HOOPS Exchange, a common operation is to navigate the model hierarchy using a tree control. HOOPS Visualize does not provide such a control as part of its API, but you can see an example of one in use in the WPF or MFC sandboxes.

9.3.1 Utilizing the ComponentPath

A HPS::ComponentPath is an explicit list of components that form a path from an individual component to the top of the scene graph. A HPS::ComponentPath is very similar to a HPS::KeyPath, except that it forms a list of HPS::Component objects instead of HPS::Key objects (key path objects are discussed in section 1.2). If necessary, you can get a component path from a key path by calling HPS::CADModel::GetComponentPath.

Using a component path, you can show, hide, highlight, and isolate components at a high level. For example, calling HPS::ComponentPath::Isolate will hide all other geometry while leaving the selected component visible. This is particularly useful during selection, or when using a tree view to show a scene structurally.