diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-15 14:45:56 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-15 17:42:58 +0300 |
commit | 0ecd587991e474ead562e8d9326146ccaa179849 (patch) | |
tree | e0171cacca0ecfa678243a2ebae81aaadd26de92 /source/blender/depsgraph/intern/builder/deg_builder_rna.h | |
parent | 373b8e311d28ee907d6e1fb291e5318fd74867b7 (diff) |
Depsgraph: Move RNA lookup to an own query class
Currently should have no functional changes, but allows to
implement runction optimizations more localized and easily.
Diffstat (limited to 'source/blender/depsgraph/intern/builder/deg_builder_rna.h')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_rna.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.h b/source/blender/depsgraph/intern/builder/deg_builder_rna.h new file mode 100644 index 00000000000..db0e1cb8dc7 --- /dev/null +++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.h @@ -0,0 +1,61 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2019 Blender Foundation. + * All rights reserved. + */ + +/** \file \ingroup depsgraph + */ + +#pragma once + +struct PointerRNA; +struct PropertyRNA; + +namespace DEG { + +struct Depsgraph; +struct Node; + +/* For queries which gives operation node or key defines whether we are + * interested in a result of the given property or whether we are linking some + * dependency to that property. */ +enum class RNAPointerSource { + /* Query will return pointer to an entry operation of component which is + * responsible for evaluation of the given property. */ + ENTRY, + /* Query will return pointer to an exit operation of component which is + * responsible for evaluation of the given property. + * More precisely, it will return operation at which the property is known + * to be evaluated. */ + EXIT, +}; + +/* Helper class which performs optimized lookups of a node within a given + * dependency graph which satisfies given RNA pointer or RAN path. */ +class RNANodeQuery { +public: + RNANodeQuery(Depsgraph *depsgraph); + + Node *find_node(const PointerRNA *ptr, + const PropertyRNA *prop, + RNAPointerSource source); + +protected: + Depsgraph *depsgraph_; +}; + +} // namespace DEG |