8#ifndef MDL_DISTILLER_RULES_H
9#define MDL_DISTILLER_RULES_H
18class IDistiller_plugin_api;
19class Debug_output_callback;
146 char const *rule_set_name,
147 char const *dag_path) = 0;
157 char const *rule_set_name,
159 char const *rule_name,
160 char const *file_name,
161 unsigned line_number) = 0;
167 char const *rule_set_name) = 0;
173 char const *path) = 0;
190 char const *rule_set_name,
192 char const *rule_name,
193 char const *file_name,
194 unsigned line_number,
195 char const *var_name,
A node inside the DAG Intermediate Representation.
Definition: mdl_generated_dag.h:118
Options class to hold all parameters for algorithm and rule customizations.
Definition: mdl_distiller_options.h:15
The rule engine handles the transformation of a compiled material by a rule set.
Definition: mdl_distiller_plugin_api.h:30
An interface for reporting rule matcher events.
Definition: mdl_distiller_rules.h:139
virtual void postcondition_failed_path(char const *path)=0
A postcondition has failed for a given path.
virtual void rule_match_event(char const *rule_set_name, unsigned rule_id, char const *rule_name, char const *file_name, unsigned line_number)=0
A rule has matched.
virtual void debug_print(IDistiller_plugin_api &plugin_api, char const *rule_set_name, unsigned rule_id, char const *rule_name, char const *file_name, unsigned line_number, char const *var_name, DAG_node const *value)=0
A rule with an attached debug_print() statement has matched.
virtual void postcondition_failed(char const *rule_set_name)=0
A postcondition has failed.
virtual void path_check_event(char const *rule_set_name, char const *dag_path)=0
A DAG path is checked against a rule set.
The interface to the generated rule matcher, new version for distiller plugin API.
Definition: mdl_distiller_rules.h:203
virtual bool postcond(IRule_matcher_event *event_handler, IDistiller_plugin_api &plugin_api, DAG_node const *root, mi::mdl::Distiller_options const *options) const =0
Returns true if the root node satisfies all postcondition that need to be valid after the rule set ha...
virtual char const * get_rule_set_name() const =0
Return the name of the rule set (for diagnostic messages)
virtual size_t get_target_material_name_count() const =0
Return the number of fully qualified imported MDL names in this rule set.
virtual DAG_node const * matcher(IRule_matcher_event *event_handler, IDistiller_plugin_api &plugin_api, DAG_node const *node, mi::mdl::Distiller_options const *options, Rule_result_code &result_code) const =0
Run the matcher.
virtual char const * get_target_material_name(size_t i) const =0
Return the fully qualified name of the imported MDL name with the given index for this rule set.
virtual Rule_eval_strategy get_strategy() const =0
Return the strategy to be used with this rule set.
virtual void set_node_types(Node_types *node_types)=0
Set the Node_types object to use.
bool(* Checker_function)(IDistiller_plugin_api &plugin_api, DAG_node const *node)
Function pointer for individual checker functions in rule sets.
Definition: mdl_distiller_rules.h:206
Options for distiller rule applications.
Rule_eval_strategy
Rule evaluation strategies.
Definition: mdl_distiller_rules.h:24
@ RULE_EVAL_BOTTOM_UP
Evaluate rules bottom up.
Definition: mdl_distiller_rules.h:26
@ RULE_EVAL_TOP_DOWN
Evaluate rules top down.
Definition: mdl_distiller_rules.h:25
Distiller_extended_node_semantics
Enum that extends mi::mdl::IDefinition::Semantics with semantics for custom extended nodes in the dis...
Definition: mdl_distiller_rules.h:40
@ DS_DIST_BSDF_TINT
tint modifier
Definition: mdl_distiller_rules.h:50
@ DS_DIST_VDF_COLOR_UNBOUNDED_MIX_1
color_unbounded_mix with one component
Definition: mdl_distiller_rules.h:123
@ DS_DIST_EDF_CONDITIONAL_OPERATOR
ternary ?: operator on edf type
Definition: mdl_distiller_rules.h:129
@ DS_DIST_VDF_MIX_4
normalized_mix with four components
Definition: mdl_distiller_rules.h:106
@ DS_DIST_EDF_CLAMPED_MIX_1
clamped_mix with one component
Definition: mdl_distiller_rules.h:83
@ DS_DIST_EDF_COLOR_MIX_3
color_normalized_mix with three components
Definition: mdl_distiller_rules.h:93
@ DS_DIST_BSDF_UNBOUNDED_MIX_2
unbounded_mix with two components
Definition: mdl_distiller_rules.h:64
@ DS_DIST_EDF_COLOR_UNBOUNDED_MIX_4
color_unbounded_mix with four components
Definition: mdl_distiller_rules.h:102
@ DS_DIST_EDF_TINT
tint modifier
Definition: mdl_distiller_rules.h:52
@ DS_DIST_BSDF_UNBOUNDED_MIX_3
unbounded_mix with three components
Definition: mdl_distiller_rules.h:65
@ DS_DIST_VDF_CLAMPED_MIX_2
clamped_mix with two components
Definition: mdl_distiller_rules.h:108
@ DS_DIST_VDF_COLOR_MIX_1
color_normalized_mix with one component
Definition: mdl_distiller_rules.h:115
@ DS_DIST_BSDF_MIX_4
normalized_mix with four components
Definition: mdl_distiller_rules.h:58
@ DS_DIST_BSDF_COLOR_CLAMPED_MIX_1
color_clamped_mix with one component
Definition: mdl_distiller_rules.h:71
@ DS_DIST_EDF_UNBOUNDED_MIX_4
unbounded_mix with four components
Definition: mdl_distiller_rules.h:90
@ DS_DIST_VDF_MIX_3
normalized_mix with three components
Definition: mdl_distiller_rules.h:105
@ DS_DIST_VDF_COLOR_UNBOUNDED_MIX_4
color_unbounded_mix with four components
Definition: mdl_distiller_rules.h:126
@ DS_DIST_STRUCT_MATERIAL
material struct
Definition: mdl_distiller_rules.h:49
@ DS_DIST_BSDF_CLAMPED_MIX_3
clamped_mix with three components
Definition: mdl_distiller_rules.h:61
@ DS_DIST_EDF_COLOR_UNBOUNDED_MIX_3
color_unbounded_mix with three components
Definition: mdl_distiller_rules.h:101
@ DS_DIST_BSDF_COLOR_MIX_1
color_normalized_mix with one component
Definition: mdl_distiller_rules.h:67
@ DS_DIST_EDF_COLOR_UNBOUNDED_MIX_1
color_unbounded_mix with one component
Definition: mdl_distiller_rules.h:99
@ DS_DIST_VDF_TINT
tint modifier
Definition: mdl_distiller_rules.h:53
@ DS_DIST_DEFAULT_VDF
Default vdf().
Definition: mdl_distiller_rules.h:43
@ DS_DIST_VDF_UNBOUNDED_MIX_2
unbounded_mix with two components
Definition: mdl_distiller_rules.h:112
@ DS_DIST_BSDF_DIRECTIONAL_FACTOR
directional factor for BSDF
Definition: mdl_distiller_rules.h:131
@ DS_DIST_EDF_CLAMPED_MIX_3
clamped_mix with three components
Definition: mdl_distiller_rules.h:85
@ DS_DIST_VDF_CLAMPED_MIX_3
clamped_mix with three components
Definition: mdl_distiller_rules.h:109
@ DS_DIST_EDF_COLOR_MIX_1
color_normalized_mix with one component
Definition: mdl_distiller_rules.h:91
@ DS_DIST_STRUCT_MATERIAL_SURFACE
material_surface struct
Definition: mdl_distiller_rules.h:46
@ DS_DIST_STRUCT_MATERIAL_GEOMETRY
material_geometry struct
Definition: mdl_distiller_rules.h:48
@ DS_DIST_EDF_COLOR_CLAMPED_MIX_1
color_clamped_mix with one component
Definition: mdl_distiller_rules.h:95
@ DS_DIST_HAIR_BSDF_TINT
tint modifier
Definition: mdl_distiller_rules.h:54
@ DS_DIST_VDF_UNBOUNDED_MIX_4
unbounded_mix with four components
Definition: mdl_distiller_rules.h:114
@ DS_DIST_STRUCT_MATERIAL_VOLUME
material_volume struct
Definition: mdl_distiller_rules.h:47
@ DS_DIST_VDF_MIX_1
normalized_mix with one component
Definition: mdl_distiller_rules.h:103
@ DS_DIST_VDF_UNBOUNDED_MIX_3
unbounded_mix with three components
Definition: mdl_distiller_rules.h:113
@ DS_DIST_VDF_COLOR_MIX_2
color_normalized_mix with two components
Definition: mdl_distiller_rules.h:116
@ DS_DIST_DEFAULT_BSDF
Default bsdf().
Definition: mdl_distiller_rules.h:41
@ DS_DIST_VDF_COLOR_MIX_3
color_normalized_mix with three components
Definition: mdl_distiller_rules.h:117
@ DS_DIST_BSDF_COLOR_MIX_2
color_normalized_mix with two components
Definition: mdl_distiller_rules.h:68
@ DS_DIST_VDF_COLOR_CLAMPED_MIX_2
color_clamped_mix with two components
Definition: mdl_distiller_rules.h:120
@ DS_DIST_EDF_COLOR_MIX_4
color_normalized_mix with four components
Definition: mdl_distiller_rules.h:94
@ DS_DIST_BSDF_COLOR_UNBOUNDED_MIX_2
color_unbounded_mix with two components
Definition: mdl_distiller_rules.h:76
@ DS_DIST_VDF_COLOR_CLAMPED_MIX_4
color_clamped_mix with four components
Definition: mdl_distiller_rules.h:122
@ DS_DIST_EDF_MIX_2
normalized_mix with two components
Definition: mdl_distiller_rules.h:80
@ DS_DIST_EDF_MIX_4
normalized_mix with four components
Definition: mdl_distiller_rules.h:82
@ DS_DIST_BSDF_CONDITIONAL_OPERATOR
ternary ?: operator on bsdf type
Definition: mdl_distiller_rules.h:128
@ DS_DIST_VDF_CLAMPED_MIX_1
clamped_mix with one component
Definition: mdl_distiller_rules.h:107
@ DS_DIST_STRUCT_MATERIAL_EMISSION
material_emission struct
Definition: mdl_distiller_rules.h:45
@ DS_DIST_EDF_UNBOUNDED_MIX_1
unbounded_mix with one component
Definition: mdl_distiller_rules.h:87
@ DS_DIST_EDF_COLOR_UNBOUNDED_MIX_2
color_unbounded_mix with two components
Definition: mdl_distiller_rules.h:100
@ DS_DIST_VDF_MIX_2
normalized_mix with two components
Definition: mdl_distiller_rules.h:104
@ DS_DIST_BSDF_CLAMPED_MIX_1
clamped_mix with one component
Definition: mdl_distiller_rules.h:59
@ DS_DIST_BSDF_COLOR_UNBOUNDED_MIX_4
color_unbounded_mix with four components
Definition: mdl_distiller_rules.h:78
@ DS_DIST_EDF_CLAMPED_MIX_4
clamped_mix with four components
Definition: mdl_distiller_rules.h:86
@ DS_DIST_BSDF_MIX_1
normalized_mix with one component
Definition: mdl_distiller_rules.h:55
@ DS_DIST_BSDF_UNBOUNDED_MIX_1
unbounded_mix with one component
Definition: mdl_distiller_rules.h:63
@ DS_DIST_VDF_CLAMPED_MIX_4
clamped_mix with four components
Definition: mdl_distiller_rules.h:110
@ DS_DIST_EDF_UNBOUNDED_MIX_2
unbounded_mix with two components
Definition: mdl_distiller_rules.h:88
@ DS_DIST_VDF_COLOR_CLAMPED_MIX_3
color_clamped_mix with three components
Definition: mdl_distiller_rules.h:121
@ DS_DIST_LOCAL_NORMAL
local_normal
Definition: mdl_distiller_rules.h:133
@ DS_DIST_EDF_COLOR_CLAMPED_MIX_4
color_clamped_mix with four components
Definition: mdl_distiller_rules.h:98
@ DS_DIST_EDF_CLAMPED_MIX_2
clamped_mix with two components
Definition: mdl_distiller_rules.h:84
@ DS_DIST_VDF_COLOR_MIX_4
color_normalized_mix with four components
Definition: mdl_distiller_rules.h:118
@ DS_DIST_BSDF_COLOR_CLAMPED_MIX_3
color_clamped_mix with three components
Definition: mdl_distiller_rules.h:73
@ DS_DIST_MATERIAL_CONDITIONAL_OPERATOR
ternary ?: operator on material type
Definition: mdl_distiller_rules.h:127
@ DS_DIST_BSDF_COLOR_UNBOUNDED_MIX_3
color_unbounded_mix with three components
Definition: mdl_distiller_rules.h:77
@ DS_DIST_BSDF_UNBOUNDED_MIX_4
unbounded_mix with four components
Definition: mdl_distiller_rules.h:66
@ DS_DIST_EDF_COLOR_MIX_2
color_normalized_mix with two components
Definition: mdl_distiller_rules.h:92
@ DS_DIST_EDF_COLOR_CLAMPED_MIX_3
color_clamped_mix with three components
Definition: mdl_distiller_rules.h:97
@ DS_DIST_EDF_COLOR_CLAMPED_MIX_2
color_clamped_mix with two components
Definition: mdl_distiller_rules.h:96
@ DS_DIST_VDF_COLOR_UNBOUNDED_MIX_2
color_unbounded_mix with two components
Definition: mdl_distiller_rules.h:124
@ DS_DIST_DEFAULT_EDF
Default edf().
Definition: mdl_distiller_rules.h:42
@ DS_DIST_BSDF_COLOR_CLAMPED_MIX_2
color_clamped_mix with two components
Definition: mdl_distiller_rules.h:72
@ DS_DIST_BSDF_MIX_3
normalized_mix with three components
Definition: mdl_distiller_rules.h:57
@ DS_DIST_EDF_UNBOUNDED_MIX_3
unbounded_mix with three components
Definition: mdl_distiller_rules.h:89
@ DS_DIST_BSDF_COLOR_MIX_3
color_normalized_mix with three components
Definition: mdl_distiller_rules.h:69
@ DS_DIST_BSDF_COLOR_CLAMPED_MIX_4
color_clamped_mix with four components
Definition: mdl_distiller_rules.h:74
@ DS_DIST_DEFAULT_HAIR_BSDF
Default hair_bsdf().
Definition: mdl_distiller_rules.h:44
@ DS_DIST_EDF_MIX_3
normalized_mix with three components
Definition: mdl_distiller_rules.h:81
@ DS_DIST_VDF_COLOR_UNBOUNDED_MIX_3
color_unbounded_mix with three components
Definition: mdl_distiller_rules.h:125
@ DS_DIST_BSDF_COLOR_MIX_4
color_normalized_mix with four components
Definition: mdl_distiller_rules.h:70
@ DS_DIST_BSDF_CLAMPED_MIX_4
clamped_mix with four components
Definition: mdl_distiller_rules.h:62
@ DS_DIST_EDF_MIX_1
normalized_mix with one component
Definition: mdl_distiller_rules.h:79
@ DS_DIST_VDF_COLOR_CLAMPED_MIX_1
color_clamped_mix with one component
Definition: mdl_distiller_rules.h:119
@ DS_DIST_BSDF_COLOR_UNBOUNDED_MIX_1
color_unbounded_mix with one component
Definition: mdl_distiller_rules.h:75
@ DS_DIST_BSDF_MIX_2
normalized_mix with two components
Definition: mdl_distiller_rules.h:56
@ DS_DIST_BSDF_CLAMPED_MIX_2
clamped_mix with two components
Definition: mdl_distiller_rules.h:60
@ DS_DIST_VDF_UNBOUNDED_MIX_1
unbounded_mix with one component
Definition: mdl_distiller_rules.h:111
@ DS_DIST_BSDF_TINT2
tint modifier with extra reflection
Definition: mdl_distiller_rules.h:51
@ DS_DIST_VDF_CONDITIONAL_OPERATOR
ternary ?: operator on vdf type
Definition: mdl_distiller_rules.h:130
@ DS_DIST_EDF_DIRECTIONAL_FACTOR
directional factor for EDF
Definition: mdl_distiller_rules.h:132
Rule_result_code
Return codes for the top-down evaluation strategy.
Definition: mdl_distiller_rules.h:30
@ RULE_RECURSE
Default, recurse into the sub-expressions.
Definition: mdl_distiller_rules.h:31
@ RULE_SKIP_RECURSION
Skip recursion into sub-expressions.
Definition: mdl_distiller_rules.h:33
@ RULE_REPEAT_RULES
Repeat rule matching with current node.
Definition: mdl_distiller_rules.h:32
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5