Skip to content

Instance support

David Thompson requested to merge dcthomp/smtk:instance-support into master

Initial support for instance entities in SMTK.

This merge request

  • adds methods to smtk::model::Instance to generate its tessellation on demand from properties defined on it in the model manager.
  • provides a way to specify instance placements as properties on the instance; both tabular point coordinates and random placement generation are supported. In the future, we envision smtk::common::Extensions (see below) providing extensible ways to specify instance placements that are application-specific.
  • provides a way to specify that instance placements should be snapped to points on model-entity tessellations (including cells and auxiliary geometry).
  • adds smtk::common::Extension, a class to allow methods in the smtkCore library to invoke methods from other libraries (with additional dependencies) if they are present; immediate subclasses should be abstract and implemented by concrete children in other libraries.
    • adds a point-locator extension to SMTK and implements it in a new ParaView server-side plugin; this is used to snap instance placements to points in tessellations of other entities.
    • adds an auxiliary-geometry extension, vtkAuxiliaryGeometryExtension, to SMTK and implements it in the vtkSMTKSourceExt library; this is used to verify that URLs are valid during aux. geom construction, to fetch bounding box information of auxiliary geometry, and to allow the point-locator extension to perform snapping when loading SMTK files (before auxiliary geometry has a corresponding VTK dataset in the CMB application).
  • adds a new operator: Model Entities - Create Instances that provides a way for users to create an instance of a model entity or of auxiliary geometry; each instance may have many individual placements (i.e., locations in space where the prototype entity is repeated).
  • adds transform properties to the Model - Add Auxiliary Geometry operator so that a rigid-body transform can be applied to data as it is read.
  • adds support for deleting Instances to the polygon-session Model Entities - Delete operator.
  • adds a new operator: Model Entities - Group Auxiliary Geometry operator to allow creation of hierarchical auxiliary geometry. These new, hierarchical auxiliary geometry instances may be instanced, allowing for complex scene construction.
  • adds a new templated method to smtk::model::EntityRef named instances() that you can use to ask any entity for a list of places it is duplicated in the model.
  • adds output ports to vtkModelMultiBlockSource that hold
    • a second multiblock dataset that holds references to each entity serving as a prototype to an instance; and
    • a polydata containing placement points for all instances in its vtkPoints. Instance tessellation points are assumed to be the origin of glyphs that reference blocks in the first output port (the multiblock of model and non-image auxiliary geometry). These two output ports can serve as inputs to a vtkGlyph3DMapper for rendering instances. Eventually, the polydata will be replaced with a multiblock of polydata point placements, one block for each instance entity (in order to allow block-selection in VTK/PV to translate into entity-selection in SMTK/CMB).
  • adds the ability to specify a transform when constructing auxiliary geometry. Note that the order of operations has not been thoroughly tested to be consistent with VTK, but that is the intent.
  • tracks all VTK-SMTK model/mesh-source objects as they are constructed/destroyed in order to make point-location and snapping possible in CMB.

This merge request does not:

  • provide ways to change the orientation of instance placements individually
  • provide a way to specify coloring of instances (per-placement or per-instance)

Future merge requests are planned to implement these features.

This commit also improves documentation for model operators by describing conventions for operator specifications (inputs) and results (outputs).

Edited by David Thompson

Merge request reports

Loading