diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-09-20 17:42:04 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-09-25 15:40:06 +0300 |
commit | 6aadfa243de3736d48400ceb8eae81febeffd987 (patch) | |
tree | c3b583e05ceccb79740775da227d44ff1993ec8c /source/blender/depsgraph/intern | |
parent | c0855f77c0768ee60fdeb40c1a8636ce080876c2 (diff) |
Depsgraph: Mark build methods as virtual
Allows to override behavior in a subclasses.
Currently no functional changes. The penalty of calls being virtual
should be neglectable.
Diffstat (limited to 'source/blender/depsgraph/intern')
4 files changed, 170 insertions, 162 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc b/source/blender/depsgraph/intern/builder/deg_builder.cc index 4cbdd169980..4ca7240abd1 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder.cc @@ -74,6 +74,10 @@ DepsgraphBuilder::DepsgraphBuilder(Main *bmain, Depsgraph *graph, DepsgraphBuild { } +DepsgraphBuilder::~DepsgraphBuilder() +{ +} + bool DepsgraphBuilder::need_pull_base_into_graph(Base *base) { /* Simple check: enabled bases are always part of dependency graph. */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder.h b/source/blender/depsgraph/intern/builder/deg_builder.h index 040bb6cfeea..97e12e9ceb2 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder.h +++ b/source/blender/depsgraph/intern/builder/deg_builder.h @@ -35,11 +35,13 @@ class DepsgraphBuilderCache; class DepsgraphBuilder { public: - bool need_pull_base_into_graph(Base *base); + virtual ~DepsgraphBuilder(); - bool check_pchan_has_bbone(Object *object, const bPoseChannel *pchan); - bool check_pchan_has_bbone_segments(Object *object, const bPoseChannel *pchan); - bool check_pchan_has_bbone_segments(Object *object, const char *bone_name); + virtual bool need_pull_base_into_graph(Base *base); + + virtual bool check_pchan_has_bbone(Object *object, const bPoseChannel *pchan); + virtual bool check_pchan_has_bbone_segments(Object *object, const bPoseChannel *pchan); + virtual bool check_pchan_has_bbone_segments(Object *object, const char *bone_name); protected: /* NOTE: The builder does NOT take ownership over any of those resources. */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index 8763936b865..865f60432c1 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -93,8 +93,8 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder { return (T *)cow->id.orig_id; } - void begin_build(); - void end_build(); + virtual void begin_build(); + virtual void end_build(); IDNode *add_id_node(ID *id); IDNode *find_id_node(ID *id); @@ -145,73 +145,75 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder { OperationNode *find_operation_node( ID *id, NodeType comp_type, OperationCode opcode, const char *name = "", int name_tag = -1); - void build_id(ID *id); + virtual void build_id(ID *id); - void build_scene_render(Scene *scene, ViewLayer *view_layer); - void build_scene_parameters(Scene *scene); - void build_scene_compositor(Scene *scene); + virtual void build_scene_render(Scene *scene, ViewLayer *view_layer); + virtual void build_scene_parameters(Scene *scene); + virtual void build_scene_compositor(Scene *scene); - void build_layer_collections(ListBase *lb); - void build_view_layer(Scene *scene, - ViewLayer *view_layer, - eDepsNode_LinkedState_Type linked_state); - void build_collection(LayerCollection *from_layer_collection, Collection *collection); - void build_object(int base_index, - Object *object, - eDepsNode_LinkedState_Type linked_state, - bool is_visible); - void build_object_proxy_from(Object *object, bool is_object_visible); - void build_object_proxy_group(Object *object, bool is_object_visible); - void build_object_flags(int base_index, Object *object, eDepsNode_LinkedState_Type linked_state); - void build_object_data(Object *object, bool is_object_visible); - void build_object_data_camera(Object *object); - void build_object_data_geometry(Object *object, bool is_object_visible); - void build_object_data_geometry_datablock(ID *obdata, bool is_object_visible); - void build_object_data_light(Object *object); - void build_object_data_lightprobe(Object *object); - void build_object_data_speaker(Object *object); - void build_object_transform(Object *object); - void build_object_constraints(Object *object); - void build_object_pointcache(Object *object); - void build_pose_constraints(Object *object, - bPoseChannel *pchan, - int pchan_index, - bool is_object_visible); - void build_rigidbody(Scene *scene); - void build_particle_systems(Object *object, bool is_object_visible); - void build_particle_settings(ParticleSettings *part); - void build_animdata(ID *id); - void build_animdata_nlastrip_targets(ListBase *strips); - void build_animation_images(ID *id); - void build_action(bAction *action); - void build_driver(ID *id, FCurve *fcurve, int driver_index); - void build_driver_variables(ID *id, FCurve *fcurve); - void build_driver_id_property(ID *id, const char *rna_path); - void build_parameters(ID *id); - void build_ik_pose(Object *object, bPoseChannel *pchan, bConstraint *con); - void build_splineik_pose(Object *object, bPoseChannel *pchan, bConstraint *con); - void build_rig(Object *object, bool is_object_visible); - void build_proxy_rig(Object *object); - void build_armature(bArmature *armature); - void build_shapekeys(Key *key); - void build_camera(Camera *camera); - void build_light(Light *lamp); - void build_nodetree(bNodeTree *ntree); - void build_material(Material *ma); - void build_materials(Material **materials, int num_materials); - void build_texture(Tex *tex); - void build_image(Image *image); - void build_world(World *world); - void build_gpencil(bGPdata *gpd); - void build_cachefile(CacheFile *cache_file); - void build_mask(Mask *mask); - void build_movieclip(MovieClip *clip); - void build_lightprobe(LightProbe *probe); - void build_speaker(Speaker *speaker); - void build_sound(bSound *sound); - void build_scene_sequencer(Scene *scene); - void build_scene_audio(Scene *scene); - void build_scene_speakers(Scene *scene, ViewLayer *view_layer); + virtual void build_layer_collections(ListBase *lb); + virtual void build_view_layer(Scene *scene, + ViewLayer *view_layer, + eDepsNode_LinkedState_Type linked_state); + virtual void build_collection(LayerCollection *from_layer_collection, Collection *collection); + virtual void build_object(int base_index, + Object *object, + eDepsNode_LinkedState_Type linked_state, + bool is_visible); + virtual void build_object_proxy_from(Object *object, bool is_object_visible); + virtual void build_object_proxy_group(Object *object, bool is_object_visible); + virtual void build_object_flags(int base_index, + Object *object, + eDepsNode_LinkedState_Type linked_state); + virtual void build_object_data(Object *object, bool is_object_visible); + virtual void build_object_data_camera(Object *object); + virtual void build_object_data_geometry(Object *object, bool is_object_visible); + virtual void build_object_data_geometry_datablock(ID *obdata, bool is_object_visible); + virtual void build_object_data_light(Object *object); + virtual void build_object_data_lightprobe(Object *object); + virtual void build_object_data_speaker(Object *object); + virtual void build_object_transform(Object *object); + virtual void build_object_constraints(Object *object); + virtual void build_object_pointcache(Object *object); + virtual void build_pose_constraints(Object *object, + bPoseChannel *pchan, + int pchan_index, + bool is_object_visible); + virtual void build_rigidbody(Scene *scene); + virtual void build_particle_systems(Object *object, bool is_object_visible); + virtual void build_particle_settings(ParticleSettings *part); + virtual void build_animdata(ID *id); + virtual void build_animdata_nlastrip_targets(ListBase *strips); + virtual void build_animation_images(ID *id); + virtual void build_action(bAction *action); + virtual void build_driver(ID *id, FCurve *fcurve, int driver_index); + virtual void build_driver_variables(ID *id, FCurve *fcurve); + virtual void build_driver_id_property(ID *id, const char *rna_path); + virtual void build_parameters(ID *id); + virtual void build_ik_pose(Object *object, bPoseChannel *pchan, bConstraint *con); + virtual void build_splineik_pose(Object *object, bPoseChannel *pchan, bConstraint *con); + virtual void build_rig(Object *object, bool is_object_visible); + virtual void build_proxy_rig(Object *object); + virtual void build_armature(bArmature *armature); + virtual void build_shapekeys(Key *key); + virtual void build_camera(Camera *camera); + virtual void build_light(Light *lamp); + virtual void build_nodetree(bNodeTree *ntree); + virtual void build_material(Material *ma); + virtual void build_materials(Material **materials, int num_materials); + virtual void build_texture(Tex *tex); + virtual void build_image(Image *image); + virtual void build_world(World *world); + virtual void build_gpencil(bGPdata *gpd); + virtual void build_cachefile(CacheFile *cache_file); + virtual void build_mask(Mask *mask); + virtual void build_movieclip(MovieClip *clip); + virtual void build_lightprobe(LightProbe *probe); + virtual void build_speaker(Speaker *speaker); + virtual void build_sound(bSound *sound); + virtual void build_scene_sequencer(Scene *scene); + virtual void build_scene_audio(Scene *scene); + virtual void build_scene_speakers(Scene *scene, ViewLayer *view_layer); /* Per-ID information about what was already in the dependency graph. * Allows to re-use certain values, to speed up following evaluation. */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h index 36eb10a456b..c6a0014577f 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h @@ -191,95 +191,95 @@ class DepsgraphRelationBuilder : public DepsgraphBuilder { void add_customdata_mask(Object *object, const DEGCustomDataMeshMasks &customdata_masks); void add_special_eval_flag(ID *object, uint32_t flag); - void build_id(ID *id); - - void build_scene_render(Scene *scene, ViewLayer *view_layer); - void build_scene_parameters(Scene *scene); - void build_scene_compositor(Scene *scene); - - void build_layer_collections(ListBase *lb); - void build_view_layer(Scene *scene, - ViewLayer *view_layer, - eDepsNode_LinkedState_Type linked_state); - void build_collection(LayerCollection *from_layer_collection, - Object *object, - Collection *collection); - void build_object(Base *base, Object *object); - void build_object_proxy_from(Object *object); - void build_object_proxy_group(Object *object); - void build_object_flags(Base *base, Object *object); - void build_object_data(Object *object); - void build_object_data_camera(Object *object); - void build_object_data_geometry(Object *object); - void build_object_data_geometry_datablock(ID *obdata); - void build_object_data_light(Object *object); - void build_object_data_lightprobe(Object *object); - void build_object_data_speaker(Object *object); - void build_object_parent(Object *object); - void build_object_pointcache(Object *object); - void build_constraints(ID *id, - NodeType component_type, - const char *component_subdata, - ListBase *constraints, - RootPChanMap *root_map); - void build_animdata(ID *id); - void build_animdata_curves(ID *id); - void build_animdata_curves_targets(ID *id, - ComponentKey &adt_key, - OperationNode *operation_from, - ListBase *curves); - void build_animdata_nlastrip_targets(ID *id, - ComponentKey &adt_key, - OperationNode *operation_from, - ListBase *strips); - void build_animdata_drivers(ID *id); - void build_animation_images(ID *id); - void build_action(bAction *action); - void build_driver(ID *id, FCurve *fcurve); - void build_driver_data(ID *id, FCurve *fcurve); - void build_driver_variables(ID *id, FCurve *fcurve); - void build_driver_id_property(ID *id, const char *rna_path); - void build_parameters(ID *id); - void build_world(World *world); - void build_rigidbody(Scene *scene); - void build_particle_systems(Object *object); - void build_particle_settings(ParticleSettings *part); - void build_particle_system_visualization_object(Object *object, - ParticleSystem *psys, - Object *draw_object); - void build_ik_pose(Object *object, - bPoseChannel *pchan, - bConstraint *con, - RootPChanMap *root_map); - void build_splineik_pose(Object *object, - bPoseChannel *pchan, - bConstraint *con, - RootPChanMap *root_map); - void build_rig(Object *object); - void build_proxy_rig(Object *object); - void build_shapekeys(Key *key); - void build_armature(bArmature *armature); - void build_camera(Camera *camera); - void build_light(Light *lamp); - void build_nodetree(bNodeTree *ntree); - void build_material(Material *ma); - void build_materials(Material **materials, int num_materials); - void build_texture(Tex *tex); - void build_image(Image *image); - void build_gpencil(bGPdata *gpd); - void build_cachefile(CacheFile *cache_file); - void build_mask(Mask *mask); - void build_movieclip(MovieClip *clip); - void build_lightprobe(LightProbe *probe); - void build_speaker(Speaker *speaker); - void build_sound(bSound *sound); - void build_scene_sequencer(Scene *scene); - void build_scene_audio(Scene *scene); - void build_scene_speakers(Scene *scene, ViewLayer *view_layer); - - void build_nested_datablock(ID *owner, ID *id); - void build_nested_nodetree(ID *owner, bNodeTree *ntree); - void build_nested_shapekey(ID *owner, Key *key); + virtual void build_id(ID *id); + + virtual void build_scene_render(Scene *scene, ViewLayer *view_layer); + virtual void build_scene_parameters(Scene *scene); + virtual void build_scene_compositor(Scene *scene); + + virtual void build_layer_collections(ListBase *lb); + virtual void build_view_layer(Scene *scene, + ViewLayer *view_layer, + eDepsNode_LinkedState_Type linked_state); + virtual void build_collection(LayerCollection *from_layer_collection, + Object *object, + Collection *collection); + virtual void build_object(Base *base, Object *object); + virtual void build_object_proxy_from(Object *object); + virtual void build_object_proxy_group(Object *object); + virtual void build_object_flags(Base *base, Object *object); + virtual void build_object_data(Object *object); + virtual void build_object_data_camera(Object *object); + virtual void build_object_data_geometry(Object *object); + virtual void build_object_data_geometry_datablock(ID *obdata); + virtual void build_object_data_light(Object *object); + virtual void build_object_data_lightprobe(Object *object); + virtual void build_object_data_speaker(Object *object); + virtual void build_object_parent(Object *object); + virtual void build_object_pointcache(Object *object); + virtual void build_constraints(ID *id, + NodeType component_type, + const char *component_subdata, + ListBase *constraints, + RootPChanMap *root_map); + virtual void build_animdata(ID *id); + virtual void build_animdata_curves(ID *id); + virtual void build_animdata_curves_targets(ID *id, + ComponentKey &adt_key, + OperationNode *operation_from, + ListBase *curves); + virtual void build_animdata_nlastrip_targets(ID *id, + ComponentKey &adt_key, + OperationNode *operation_from, + ListBase *strips); + virtual void build_animdata_drivers(ID *id); + virtual void build_animation_images(ID *id); + virtual void build_action(bAction *action); + virtual void build_driver(ID *id, FCurve *fcurve); + virtual void build_driver_data(ID *id, FCurve *fcurve); + virtual void build_driver_variables(ID *id, FCurve *fcurve); + virtual void build_driver_id_property(ID *id, const char *rna_path); + virtual void build_parameters(ID *id); + virtual void build_world(World *world); + virtual void build_rigidbody(Scene *scene); + virtual void build_particle_systems(Object *object); + virtual void build_particle_settings(ParticleSettings *part); + virtual void build_particle_system_visualization_object(Object *object, + ParticleSystem *psys, + Object *draw_object); + virtual void build_ik_pose(Object *object, + bPoseChannel *pchan, + bConstraint *con, + RootPChanMap *root_map); + virtual void build_splineik_pose(Object *object, + bPoseChannel *pchan, + bConstraint *con, + RootPChanMap *root_map); + virtual void build_rig(Object *object); + virtual void build_proxy_rig(Object *object); + virtual void build_shapekeys(Key *key); + virtual void build_armature(bArmature *armature); + virtual void build_camera(Camera *camera); + virtual void build_light(Light *lamp); + virtual void build_nodetree(bNodeTree *ntree); + virtual void build_material(Material *ma); + virtual void build_materials(Material **materials, int num_materials); + virtual void build_texture(Tex *tex); + virtual void build_image(Image *image); + virtual void build_gpencil(bGPdata *gpd); + virtual void build_cachefile(CacheFile *cache_file); + virtual void build_mask(Mask *mask); + virtual void build_movieclip(MovieClip *clip); + virtual void build_lightprobe(LightProbe *probe); + virtual void build_speaker(Speaker *speaker); + virtual void build_sound(bSound *sound); + virtual void build_scene_sequencer(Scene *scene); + virtual void build_scene_audio(Scene *scene); + virtual void build_scene_speakers(Scene *scene, ViewLayer *view_layer); + + virtual void build_nested_datablock(ID *owner, ID *id); + virtual void build_nested_nodetree(ID *owner, bNodeTree *ntree); + virtual void build_nested_shapekey(ID *owner, Key *key); void add_particle_collision_relations(const OperationKey &key, Object *object, @@ -292,8 +292,8 @@ class DepsgraphRelationBuilder : public DepsgraphBuilder { bool add_absorption, const char *name); - void build_copy_on_write_relations(); - void build_copy_on_write_relations(IDNode *id_node); + virtual void build_copy_on_write_relations(); + virtual void build_copy_on_write_relations(IDNode *id_node); template<typename KeyType> OperationNode *find_operation_node(const KeyType &key); |