Cleanup: remove loading blender namespace from Vector.
This commit is contained in:
parent
b6ab1107c2
commit
36427a8d03
|
@ -92,7 +92,7 @@ class ExecutionGroup {
|
|||
/**
|
||||
* \brief list of operations in this ExecutionGroup
|
||||
*/
|
||||
blender::Vector<NodeOperation *> m_operations;
|
||||
Vector<NodeOperation *> m_operations;
|
||||
|
||||
ExecutionGroupFlags m_flags;
|
||||
|
||||
|
@ -136,7 +136,7 @@ class ExecutionGroup {
|
|||
/**
|
||||
* \brief All read operations of this execution group.
|
||||
*/
|
||||
blender::Vector<ReadBufferOperation *> m_read_operations;
|
||||
Vector<ReadBufferOperation *> m_read_operations;
|
||||
|
||||
/**
|
||||
* \brief reference to the original bNodeTree,
|
||||
|
@ -153,7 +153,7 @@ class ExecutionGroup {
|
|||
/**
|
||||
* \brief m_work_packages holds all unit of work.
|
||||
*/
|
||||
blender::Vector<WorkPackage> m_work_packages;
|
||||
Vector<WorkPackage> m_work_packages;
|
||||
|
||||
/**
|
||||
* \brief denotes boundary for border compositing
|
||||
|
|
|
@ -119,14 +119,14 @@ ExecutionSystem::~ExecutionSystem()
|
|||
this->m_groups.clear();
|
||||
}
|
||||
|
||||
void ExecutionSystem::set_operations(const blender::Vector<NodeOperation *> &operations,
|
||||
const blender::Vector<ExecutionGroup *> &groups)
|
||||
void ExecutionSystem::set_operations(const Vector<NodeOperation *> &operations,
|
||||
const Vector<ExecutionGroup *> &groups)
|
||||
{
|
||||
m_operations = operations;
|
||||
m_groups = groups;
|
||||
}
|
||||
|
||||
static void update_read_buffer_offset(blender::Vector<NodeOperation *> &operations)
|
||||
static void update_read_buffer_offset(Vector<NodeOperation *> &operations)
|
||||
{
|
||||
unsigned int order = 0;
|
||||
for (NodeOperation *operation : operations) {
|
||||
|
@ -138,7 +138,7 @@ static void update_read_buffer_offset(blender::Vector<NodeOperation *> &operatio
|
|||
}
|
||||
}
|
||||
|
||||
static void init_write_operations_for_execution(blender::Vector<NodeOperation *> &operations,
|
||||
static void init_write_operations_for_execution(Vector<NodeOperation *> &operations,
|
||||
const bNodeTree *bTree)
|
||||
{
|
||||
for (NodeOperation *operation : operations) {
|
||||
|
@ -149,7 +149,7 @@ static void init_write_operations_for_execution(blender::Vector<NodeOperation *>
|
|||
}
|
||||
}
|
||||
|
||||
static void link_write_buffers(blender::Vector<NodeOperation *> &operations)
|
||||
static void link_write_buffers(Vector<NodeOperation *> &operations)
|
||||
{
|
||||
for (NodeOperation *operation : operations) {
|
||||
if (operation->get_flags().is_read_buffer_operation) {
|
||||
|
@ -159,7 +159,7 @@ static void link_write_buffers(blender::Vector<NodeOperation *> &operations)
|
|||
}
|
||||
}
|
||||
|
||||
static void init_non_write_operations_for_execution(blender::Vector<NodeOperation *> &operations,
|
||||
static void init_non_write_operations_for_execution(Vector<NodeOperation *> &operations,
|
||||
const bNodeTree *bTree)
|
||||
{
|
||||
for (NodeOperation *operation : operations) {
|
||||
|
@ -170,7 +170,7 @@ static void init_non_write_operations_for_execution(blender::Vector<NodeOperatio
|
|||
}
|
||||
}
|
||||
|
||||
static void init_execution_groups_for_execution(blender::Vector<ExecutionGroup *> &groups,
|
||||
static void init_execution_groups_for_execution(Vector<ExecutionGroup *> &groups,
|
||||
const int chunk_size)
|
||||
{
|
||||
for (ExecutionGroup *execution_group : groups) {
|
||||
|
|
|
@ -129,12 +129,12 @@ class ExecutionSystem {
|
|||
/**
|
||||
* \brief vector of operations
|
||||
*/
|
||||
blender::Vector<NodeOperation *> m_operations;
|
||||
Vector<NodeOperation *> m_operations;
|
||||
|
||||
/**
|
||||
* \brief vector of groups
|
||||
*/
|
||||
blender::Vector<ExecutionGroup *> m_groups;
|
||||
Vector<ExecutionGroup *> m_groups;
|
||||
|
||||
private: // methods
|
||||
public:
|
||||
|
@ -159,8 +159,8 @@ class ExecutionSystem {
|
|||
*/
|
||||
~ExecutionSystem();
|
||||
|
||||
void set_operations(const blender::Vector<NodeOperation *> &operations,
|
||||
const blender::Vector<ExecutionGroup *> &groups);
|
||||
void set_operations(const Vector<NodeOperation *> &operations,
|
||||
const Vector<ExecutionGroup *> &groups);
|
||||
|
||||
/**
|
||||
* \brief execute this system
|
||||
|
|
|
@ -65,12 +65,12 @@ class Node {
|
|||
/**
|
||||
* \brief the list of actual input-sockets \see NodeInput
|
||||
*/
|
||||
blender::Vector<NodeInput *> inputs;
|
||||
Vector<NodeInput *> inputs;
|
||||
|
||||
/**
|
||||
* \brief the list of actual output-sockets \see NodeOutput
|
||||
*/
|
||||
blender::Vector<NodeOutput *> outputs;
|
||||
Vector<NodeOutput *> outputs;
|
||||
|
||||
public:
|
||||
Node(bNode *editorNode, bool create_sockets = true);
|
||||
|
@ -115,7 +115,7 @@ class Node {
|
|||
/**
|
||||
* \brief get access to the vector of input sockets
|
||||
*/
|
||||
const blender::Vector<NodeInput *> &getInputSockets() const
|
||||
const Vector<NodeInput *> &getInputSockets() const
|
||||
{
|
||||
return this->inputs;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ class Node {
|
|||
/**
|
||||
* \brief get access to the vector of input sockets
|
||||
*/
|
||||
const blender::Vector<NodeOutput *> &getOutputSockets() const
|
||||
const Vector<NodeOutput *> &getOutputSockets() const
|
||||
{
|
||||
return this->outputs;
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ void NodeGraph::add_bNode(const CompositorContext &context,
|
|||
|
||||
NodeOutput *NodeGraph::find_output(const NodeRange &node_range, bNodeSocket *b_socket)
|
||||
{
|
||||
for (blender::Vector<Node *>::iterator it = node_range.first; it != node_range.second; ++it) {
|
||||
for (Vector<Node *>::iterator it = node_range.first; it != node_range.second; ++it) {
|
||||
Node *node = *it;
|
||||
for (NodeOutput *output : node->getOutputSockets()) {
|
||||
if (output->getbNodeSocket() == b_socket) {
|
||||
|
@ -187,7 +187,7 @@ void NodeGraph::add_bNodeLink(const NodeRange &node_range, bNodeLink *b_nodelink
|
|||
return;
|
||||
}
|
||||
|
||||
for (blender::Vector<Node *>::iterator it = node_range.first; it != node_range.second; ++it) {
|
||||
for (Vector<Node *>::iterator it = node_range.first; it != node_range.second; ++it) {
|
||||
Node *node = *it;
|
||||
for (NodeInput *input : node->getInputSockets()) {
|
||||
if (input->getbNodeSocket() == b_nodelink->tosock && !input->isLinked()) {
|
||||
|
|
|
@ -52,18 +52,18 @@ class NodeGraph {
|
|||
};
|
||||
|
||||
private:
|
||||
blender::Vector<Node *> m_nodes;
|
||||
blender::Vector<Link> m_links;
|
||||
Vector<Node *> m_nodes;
|
||||
Vector<Link> m_links;
|
||||
|
||||
public:
|
||||
NodeGraph();
|
||||
~NodeGraph();
|
||||
|
||||
const blender::Vector<Node *> &nodes() const
|
||||
const Vector<Node *> &nodes() const
|
||||
{
|
||||
return m_nodes;
|
||||
}
|
||||
const blender::Vector<Link> &links() const
|
||||
const Vector<Link> &links() const
|
||||
{
|
||||
return m_links;
|
||||
}
|
||||
|
@ -71,8 +71,7 @@ class NodeGraph {
|
|||
void from_bNodeTree(const CompositorContext &context, bNodeTree *tree);
|
||||
|
||||
protected:
|
||||
typedef std::pair<blender::Vector<Node *>::iterator, blender::Vector<Node *>::iterator>
|
||||
NodeRange;
|
||||
typedef std::pair<Vector<Node *>::iterator, Vector<Node *>::iterator> NodeRange;
|
||||
|
||||
static bNodeSocket *find_b_node_input(bNode *b_node, const char *identifier);
|
||||
static bNodeSocket *find_b_node_output(bNode *b_node, const char *identifier);
|
||||
|
|
|
@ -252,8 +252,8 @@ struct NodeOperationFlags {
|
|||
class NodeOperation {
|
||||
private:
|
||||
std::string m_name;
|
||||
blender::Vector<NodeOperationInput> m_inputs;
|
||||
blender::Vector<NodeOperationOutput> m_outputs;
|
||||
Vector<NodeOperationInput> m_inputs;
|
||||
Vector<NodeOperationOutput> m_outputs;
|
||||
|
||||
/**
|
||||
* \brief the index of the input socket that will be used to determine the resolution
|
||||
|
|
|
@ -254,7 +254,7 @@ void NodeOperationBuilder::registerViewer(ViewerOperation *viewer)
|
|||
|
||||
void NodeOperationBuilder::add_datatype_conversions()
|
||||
{
|
||||
blender::Vector<Link> convert_links;
|
||||
Vector<Link> convert_links;
|
||||
for (const Link &link : m_links) {
|
||||
/* proxy operations can skip data type conversion */
|
||||
NodeOperation *from_op = &link.from()->getOperation();
|
||||
|
@ -285,7 +285,7 @@ void NodeOperationBuilder::add_operation_input_constants()
|
|||
/* Note: unconnected inputs cached first to avoid modifying
|
||||
* m_operations while iterating over it
|
||||
*/
|
||||
blender::Vector<NodeOperationInput *> pending_inputs;
|
||||
Vector<NodeOperationInput *> pending_inputs;
|
||||
for (NodeOperation *op : m_operations) {
|
||||
for (int k = 0; k < op->getNumberOfInputSockets(); ++k) {
|
||||
NodeOperationInput *input = op->getInputSocket(k);
|
||||
|
@ -353,7 +353,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input,
|
|||
|
||||
void NodeOperationBuilder::resolve_proxies()
|
||||
{
|
||||
blender::Vector<Link> proxy_links;
|
||||
Vector<Link> proxy_links;
|
||||
for (const Link &link : m_links) {
|
||||
/* don't replace links from proxy to proxy, since we may need them for replacing others! */
|
||||
if (link.from()->getOperation().get_flags().is_proxy_operation &&
|
||||
|
@ -403,7 +403,7 @@ void NodeOperationBuilder::determineResolutions()
|
|||
|
||||
/* add convert resolution operations when needed */
|
||||
{
|
||||
blender::Vector<Link> convert_links;
|
||||
Vector<Link> convert_links;
|
||||
for (const Link &link : m_links) {
|
||||
if (link.to()->getResizeMode() != ResizeMode::None) {
|
||||
NodeOperation &from_op = link.from()->getOperation();
|
||||
|
@ -419,10 +419,10 @@ void NodeOperationBuilder::determineResolutions()
|
|||
}
|
||||
}
|
||||
|
||||
blender::Vector<NodeOperationInput *> NodeOperationBuilder::cache_output_links(
|
||||
Vector<NodeOperationInput *> NodeOperationBuilder::cache_output_links(
|
||||
NodeOperationOutput *output) const
|
||||
{
|
||||
blender::Vector<NodeOperationInput *> inputs;
|
||||
Vector<NodeOperationInput *> inputs;
|
||||
for (const Link &link : m_links) {
|
||||
if (link.from() == output) {
|
||||
inputs.append(link.to());
|
||||
|
@ -487,7 +487,7 @@ void NodeOperationBuilder::add_output_buffers(NodeOperation *operation,
|
|||
NodeOperationOutput *output)
|
||||
{
|
||||
/* cache connected sockets, so we can safely remove links first before replacing them */
|
||||
blender::Vector<NodeOperationInput *> targets = cache_output_links(output);
|
||||
Vector<NodeOperationInput *> targets = cache_output_links(output);
|
||||
if (targets.is_empty()) {
|
||||
return;
|
||||
}
|
||||
|
@ -538,7 +538,7 @@ void NodeOperationBuilder::add_complex_operation_buffers()
|
|||
/* note: complex ops and get cached here first, since adding operations
|
||||
* will invalidate iterators over the main m_operations
|
||||
*/
|
||||
blender::Vector<NodeOperation *> complex_ops;
|
||||
Vector<NodeOperation *> complex_ops;
|
||||
for (NodeOperation *operation : m_operations) {
|
||||
if (operation->get_flags().complex) {
|
||||
complex_ops.append(operation);
|
||||
|
@ -593,7 +593,7 @@ void NodeOperationBuilder::prune_operations()
|
|||
}
|
||||
|
||||
/* delete unreachable operations */
|
||||
blender::Vector<NodeOperation *> reachable_ops;
|
||||
Vector<NodeOperation *> reachable_ops;
|
||||
for (NodeOperation *op : m_operations) {
|
||||
if (reachable.find(op) != reachable.end()) {
|
||||
reachable_ops.append(op);
|
||||
|
@ -607,7 +607,7 @@ void NodeOperationBuilder::prune_operations()
|
|||
}
|
||||
|
||||
/* topological (depth-first) sorting of operations */
|
||||
static void sort_operations_recursive(blender::Vector<NodeOperation *> &sorted,
|
||||
static void sort_operations_recursive(Vector<NodeOperation *> &sorted,
|
||||
Tags &visited,
|
||||
NodeOperation *op)
|
||||
{
|
||||
|
@ -628,7 +628,7 @@ static void sort_operations_recursive(blender::Vector<NodeOperation *> &sorted,
|
|||
|
||||
void NodeOperationBuilder::sort_operations()
|
||||
{
|
||||
blender::Vector<NodeOperation *> sorted;
|
||||
Vector<NodeOperation *> sorted;
|
||||
sorted.reserve(m_operations.size());
|
||||
Tags visited;
|
||||
|
||||
|
|
|
@ -68,9 +68,9 @@ class NodeOperationBuilder {
|
|||
const CompositorContext *m_context;
|
||||
NodeGraph m_graph;
|
||||
|
||||
blender::Vector<NodeOperation *> m_operations;
|
||||
blender::Vector<Link> m_links;
|
||||
blender::Vector<ExecutionGroup *> m_groups;
|
||||
Vector<NodeOperation *> m_operations;
|
||||
Vector<Link> m_links;
|
||||
Vector<ExecutionGroup *> m_groups;
|
||||
|
||||
/** Maps operation inputs to node inputs */
|
||||
blender::Map<NodeOperationInput *, NodeInput *> m_input_map;
|
||||
|
@ -134,7 +134,7 @@ class NodeOperationBuilder {
|
|||
void determineResolutions();
|
||||
|
||||
/** Helper function to store connected inputs for replacement */
|
||||
blender::Vector<NodeOperationInput *> cache_output_links(NodeOperationOutput *output) const;
|
||||
Vector<NodeOperationInput *> cache_output_links(NodeOperationOutput *output) const;
|
||||
/** Find a connected write buffer operation to an OpOutput */
|
||||
WriteBufferOperation *find_attached_write_buffer_operation(NodeOperationOutput *output) const;
|
||||
/** Add read/write buffer operations around complex operations */
|
||||
|
|
|
@ -72,7 +72,7 @@ static struct {
|
|||
/** \brief list of all CPUDevices. for every hardware thread an instance of CPUDevice is
|
||||
* created
|
||||
*/
|
||||
blender::Vector<CPUDevice> devices;
|
||||
Vector<CPUDevice> devices;
|
||||
|
||||
/** \brief list of all thread for every CPUDevice in cpudevices a thread exists. */
|
||||
ListBase threads;
|
||||
|
@ -91,7 +91,7 @@ static struct {
|
|||
cl_program program;
|
||||
/** \brief list of all OpenCLDevices. for every OpenCL GPU device an instance of OpenCLDevice
|
||||
* is created. */
|
||||
blender::Vector<OpenCLDevice> devices;
|
||||
Vector<OpenCLDevice> devices;
|
||||
/** \brief list of all thread for every GPUDevice in cpudevices a thread exists. */
|
||||
ListBase threads;
|
||||
/** \brief all scheduled work for the GPU. */
|
||||
|
|
|
@ -103,7 +103,7 @@ static std::string combined_layer_pass_name(RenderLayer *render_layer, RenderPas
|
|||
void CryptomatteNode::input_operations_from_render_source(
|
||||
const CompositorContext &context,
|
||||
const bNode &node,
|
||||
blender::Vector<NodeOperation *> &r_input_operations)
|
||||
Vector<NodeOperation *> &r_input_operations)
|
||||
{
|
||||
Scene *scene = (Scene *)node.id;
|
||||
if (!scene) {
|
||||
|
@ -143,7 +143,7 @@ void CryptomatteNode::input_operations_from_render_source(
|
|||
void CryptomatteNode::input_operations_from_image_source(
|
||||
const CompositorContext &context,
|
||||
const bNode &node,
|
||||
blender::Vector<NodeOperation *> &r_input_operations)
|
||||
Vector<NodeOperation *> &r_input_operations)
|
||||
{
|
||||
NodeCryptomatte *cryptomatte_settings = (NodeCryptomatte *)node.storage;
|
||||
Image *image = (Image *)node.id;
|
||||
|
@ -202,10 +202,10 @@ void CryptomatteNode::input_operations_from_image_source(
|
|||
BKE_image_release_ibuf(image, ibuf, nullptr);
|
||||
}
|
||||
|
||||
blender::Vector<NodeOperation *> CryptomatteNode::create_input_operations(
|
||||
const CompositorContext &context, const bNode &node)
|
||||
Vector<NodeOperation *> CryptomatteNode::create_input_operations(const CompositorContext &context,
|
||||
const bNode &node)
|
||||
{
|
||||
blender::Vector<NodeOperation *> input_operations;
|
||||
Vector<NodeOperation *> input_operations;
|
||||
switch (node.custom1) {
|
||||
case CMP_CRYPTOMATTE_SRC_RENDER:
|
||||
input_operations_from_render_source(context, node, input_operations);
|
||||
|
@ -231,7 +231,7 @@ CryptomatteOperation *CryptomatteNode::create_cryptomatte_operation(
|
|||
const bNode &node,
|
||||
const NodeCryptomatte *cryptomatte_settings) const
|
||||
{
|
||||
blender::Vector<NodeOperation *> input_operations = create_input_operations(context, node);
|
||||
Vector<NodeOperation *> input_operations = create_input_operations(context, node);
|
||||
CryptomatteOperation *operation = new CryptomatteOperation(input_operations.size());
|
||||
LISTBASE_FOREACH (CryptomatteEntry *, cryptomatte_entry, &cryptomatte_settings->entries) {
|
||||
operation->addObjectIndex(cryptomatte_entry->encoded_hash);
|
||||
|
|
|
@ -64,16 +64,14 @@ class CryptomatteNode : public CryptomatteBaseNode {
|
|||
const NodeCryptomatte *cryptomatte_settings) const override;
|
||||
|
||||
private:
|
||||
static blender::Vector<NodeOperation *> create_input_operations(const CompositorContext &context,
|
||||
const bNode &node);
|
||||
static void input_operations_from_render_source(
|
||||
const CompositorContext &context,
|
||||
const bNode &node,
|
||||
blender::Vector<NodeOperation *> &r_input_operations);
|
||||
static void input_operations_from_image_source(
|
||||
const CompositorContext &context,
|
||||
const bNode &node,
|
||||
blender::Vector<NodeOperation *> &r_input_operations);
|
||||
static Vector<NodeOperation *> create_input_operations(const CompositorContext &context,
|
||||
const bNode &node);
|
||||
static void input_operations_from_render_source(const CompositorContext &context,
|
||||
const bNode &node,
|
||||
Vector<NodeOperation *> &r_input_operations);
|
||||
static void input_operations_from_image_source(const CompositorContext &context,
|
||||
const bNode &node,
|
||||
Vector<NodeOperation *> &r_input_operations);
|
||||
};
|
||||
|
||||
class CryptomatteLegacyNode : public CryptomatteBaseNode {
|
||||
|
|
|
@ -24,10 +24,10 @@ namespace blender::compositor {
|
|||
|
||||
class CryptomatteOperation : public NodeOperation {
|
||||
private:
|
||||
blender::Vector<float> m_objectIndex;
|
||||
Vector<float> m_objectIndex;
|
||||
|
||||
public:
|
||||
blender::Vector<SocketReader *> inputs;
|
||||
Vector<SocketReader *> inputs;
|
||||
|
||||
CryptomatteOperation(size_t num_inputs = 6);
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ class OutputOpenExrMultiLayerOperation : public NodeOperation {
|
|||
char m_path[FILE_MAX];
|
||||
char m_exr_codec;
|
||||
bool m_exr_half_float;
|
||||
blender::Vector<OutputOpenExrLayer> m_layers;
|
||||
Vector<OutputOpenExrLayer> m_layers;
|
||||
const char *m_viewName;
|
||||
|
||||
StampData *createStampData() const;
|
||||
|
|
Loading…
Reference in New Issue