Blender V4.3
COM_input_single_value_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
10
11#include "COM_context.hh"
12#include "COM_operation.hh"
13#include "COM_result.hh"
14
16
17using namespace nodes::derived_node_tree_types;
18
19/* ------------------------------------------------------------------------------------------------
20 * Input Single Value Operation
21 *
22 * An input single value operation is an operation that outputs a single value result whose value
23 * is the value of an unlinked input socket. This is typically used to initialize the values of
24 * unlinked node input sockets. */
26 private:
27 /* The identifier of the output. */
28 static const StringRef output_identifier_;
29 /* The input socket whose value will be computed as the operation's result. */
30 DInputSocket input_socket_;
31
32 public:
33 InputSingleValueOperation(Context &context, DInputSocket input_socket);
34
35 /* Allocate a single value result and set its value to the default value of the input socket. */
36 void execute() override;
37
38 /* Get a reference to the output result of the operation, this essentially calls the super
39 * get_result with the output identifier of the operation. */
41
42 private:
43 /* Populate the result of the operation, this essentially calls the super populate_result method
44 * with the output identifier of the operation. */
45 void populate_result(Result result);
46};
47
48} // namespace blender::realtime_compositor
InputSingleValueOperation(Context &context, DInputSocket input_socket)