Files
test2/source/blender/blenkernel/BKE_compute_contexts.hh
Sergey Sharybin c1bc70b711 Cleanup: Add a copyright notice to files and use SPDX format
A lot of files were missing copyright field in the header and
the Blender Foundation contributed to them in a sense of bug
fixing and general maintenance.

This change makes it explicit that those files are at least
partially copyrighted by the Blender Foundation.

Note that this does not make it so the Blender Foundation is
the only holder of the copyright in those files, and developers
who do not have a signed contract with the foundation still
hold the copyright as well.

Another aspect of this change is using SPDX format for the
header. We already used it for the license specification,
and now we state it for the copyright as well, following the
FAQ:

    https://reuse.software/faq/
2023-05-31 16:19:06 +02:00

63 lines
1.5 KiB
C++

/* SPDX-FileCopyrightText: 2023 Blender Foundation
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
/**
* This file implements some specific compute contexts for concepts in Blender.
*/
#include <optional>
#include "BLI_compute_context.hh"
struct bNode;
namespace blender::bke {
class ModifierComputeContext : public ComputeContext {
private:
static constexpr const char *s_static_type = "MODIFIER";
/**
* Use modifier name instead of something like `session_uuid` for now because:
* - It's more obvious that the name matches between the original and evaluated object.
* - We might want that the context hash is consistent between sessions in the future.
*/
std::string modifier_name_;
public:
ModifierComputeContext(const ComputeContext *parent, std::string modifier_name);
private:
void print_current_in_line(std::ostream &stream) const override;
};
class NodeGroupComputeContext : public ComputeContext {
private:
static constexpr const char *s_static_type = "NODE_GROUP";
int32_t node_id_;
#ifdef DEBUG
std::string debug_node_name_;
#endif
public:
NodeGroupComputeContext(const ComputeContext *parent,
int32_t node_id,
const std::optional<ComputeContextHash> &cached_hash = {});
NodeGroupComputeContext(const ComputeContext *parent, const bNode &node);
int32_t node_id() const
{
return node_id_;
}
private:
void print_current_in_line(std::ostream &stream) const override;
};
} // namespace blender::bke