There are several types of reusable sub-components that are used in various ROPs.
These components are treated as “elements”, with a standardized data COMP nested inside them. The
opDefinition locates these data COMPs and pulls settings from them, which contribute to the contents of the
Contributed elements include:
- Parameter specifications
- Blocks of code that can be injected into the ROP code
transformCodeGenerator is used in elements that perform standard transformations (translate, rotate, scale, pivot). It generates a block of code that performs the transform with sections for each aspect (e.g. rotation) of the transform that’s enabled and supported by the host ROP.
aggregateCodeGenerator is used in ROPs that repeat a chunk of code a variable number of times, depending on how many inputs are connected.
codeSwitcher is used in ROPs that have a menu parameter that switches between different behaviors. Most menu parameters are implemented using this component, though some are manually written into the ROP code instead.
The switcher is based on a table of “options”, where each option has:
- Code snippet
- Parameters that it uses
- Macros that it applies
- Optional other info that ROPs can use for things like changing
combiner is used in ROPs that combine SDF results (e.g. simple union, stair intersect, etc).
It is a wrapper around two
codeSwitchers, one which is for initial code to prepare parameters and the other is for performing the actual SDF combination.
waveFunction is used in ROPs that have repeating waves (sine, cosine, square, etc), such as
Similar to the
combiner, It is a wrapper around two
codeSwitchers, one for preparing parameters and the other for calculating wave result values.