Blender V5.3
COM_single_value_node_input_operation.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include "BLI_string_ref.hh"
8
9#include "COM_context.hh"
10#include "COM_operation.hh"
11#include "COM_result.hh"
12
13namespace blender::compositor {
14
15/* ------------------------------------------------------------------------------------------------
16 * Single Value Node Input Operation
17 *
18 * An operation that outputs a single value result whose value is the value of an unlinked input
19 * socket. This is typically used to initialize the values of unlinked node input sockets. */
21 private:
22 /* The identifier of the output. */
23 static const StringRef output_identifier_;
24 /* The input socket whose value will be computed as the operation's result. */
25 const bNodeSocket &input_socket_;
26
27 public:
29
30 /* Allocate a single value result and set its value to the default value of the input socket. */
31 void execute() override;
32
33 /* Get a reference to the output result of the operation, this essentially calls the super
34 * get_result with the output identifier of the operation. */
36
37 private:
38 /* Populate the result of the operation, this essentially calls the super populate_result method
39 * with the output identifier of the operation. */
40 void populate_result(ResultType type);
41};
42
43} // namespace blender::compositor
Operation(Context &context)
Definition operation.cc:22
Context & context() const
Definition operation.cc:57
SingleValueNodeInputOperation(Context &context, const bNodeSocket &input_socket)