Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-03-19 10:26:29 +0300
committerJacques Lucke <jacques@blender.org>2022-03-19 10:26:29 +0300
commit3e16f3b3ef4b8f385b30fe4a1e00860620f610ee (patch)
treecea8e2a3ea8a8a7dbce98263d166b4782d83721b /source/blender/editors/space_spreadsheet
parentc655146b87fe20853e52b87991b46732a04d749e (diff)
BLI: move generic data structures to blenlib
This is a follow up to rB2252bc6a5527cd7360d1ccfe7a2d1bc640a8dfa6.
Diffstat (limited to 'source/blender/editors/space_spreadsheet')
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh9
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc14
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.hh4
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_layout.cc2
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc2
5 files changed, 15 insertions, 16 deletions
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh b/source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh
index f4d07255e2d..7cf9238d34e 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh
@@ -4,10 +4,9 @@
#include "DNA_space_types.h"
+#include "BLI_generic_virtual_array.hh"
#include "BLI_string_ref.hh"
-#include "FN_generic_virtual_array.hh"
-
namespace blender::ed::spreadsheet {
struct CellDrawParams;
@@ -22,10 +21,10 @@ class ColumnValues final {
protected:
std::string name_;
- fn::GVArray data_;
+ GVArray data_;
public:
- ColumnValues(std::string name, fn::GVArray data) : name_(std::move(name)), data_(std::move(data))
+ ColumnValues(std::string name, GVArray data) : name_(std::move(name)), data_(std::move(data))
{
/* The array should not be empty. */
BLI_assert(data_);
@@ -48,7 +47,7 @@ class ColumnValues final {
return data_.size();
}
- const fn::GVArray &data() const
+ const GVArray &data() const
{
return data_;
}
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
index 3c94c466da1..0ad64db1b6d 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
@@ -53,11 +53,11 @@ void ExtraColumns::foreach_default_column_ids(
std::unique_ptr<ColumnValues> ExtraColumns::get_column_values(
const SpreadsheetColumnID &column_id) const
{
- const fn::GSpan *values = columns_.lookup_ptr(column_id.name);
+ const GSpan *values = columns_.lookup_ptr(column_id.name);
if (values == nullptr) {
return {};
}
- return std::make_unique<ColumnValues>(column_id.name, fn::GVArray::ForSpan(*values));
+ return std::make_unique<ColumnValues>(column_id.name, GVArray::ForSpan(*values));
}
void GeometryDataSource::foreach_default_column_ids(
@@ -199,7 +199,7 @@ std::unique_ptr<ColumnValues> GeometryDataSource::get_column_values(
if (!attribute) {
return {};
}
- fn::GVArray varray = std::move(attribute.varray);
+ GVArray varray = std::move(attribute.varray);
if (attribute.domain != domain_) {
return {};
}
@@ -462,7 +462,7 @@ static void find_fields_to_evaluate(const SpaceSpreadsheet *sspreadsheet,
}
if (const geo_log::GenericValueLog *generic_value_log =
dynamic_cast<const geo_log::GenericValueLog *>(value_log)) {
- fn::GPointer value = generic_value_log->value();
+ GPointer value = generic_value_log->value();
r_fields.add("Viewer", fn::make_constant_field(*value.type(), value.get()));
}
}
@@ -508,7 +508,7 @@ class GeometryComponentCacheValue : public SpreadsheetCache::Value {
public:
/* Stores the result of fields evaluated on a geometry component. Without this, fields would have
* to be reevaluated on every redraw. */
- Map<std::pair<AttributeDomain, GField>, fn::GArray<>> arrays;
+ Map<std::pair<AttributeDomain, GField>, GArray<>> arrays;
};
static void add_fields_as_extra_columns(SpaceSpreadsheet *sspreadsheet,
@@ -529,8 +529,8 @@ static void add_fields_as_extra_columns(SpaceSpreadsheet *sspreadsheet,
const GField &field = item.value;
/* Use the cached evaluated array if it exists, otherwise evaluate the field now. */
- fn::GArray<> &evaluated_array = cache.arrays.lookup_or_add_cb({domain, field}, [&]() {
- fn::GArray<> evaluated_array(field.cpp_type(), domain_size);
+ GArray<> &evaluated_array = cache.arrays.lookup_or_add_cb({domain, field}, [&]() {
+ GArray<> evaluated_array(field.cpp_type(), domain_size);
bke::GeometryComponentFieldContext field_context{component, domain};
fn::FieldEvaluator field_evaluator{field_context, domain_size};
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.hh b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.hh
index 303f495e3df..8b281e5a558 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.hh
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.hh
@@ -21,10 +21,10 @@ namespace blender::ed::spreadsheet {
class ExtraColumns {
private:
/** Maps column names to their data. The data is actually stored in the spreadsheet cache. */
- Map<std::string, fn::GSpan> columns_;
+ Map<std::string, GSpan> columns_;
public:
- void add(std::string name, fn::GSpan data)
+ void add(std::string name, GSpan data)
{
columns_.add(std::move(name), data);
}
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_layout.cc b/source/blender/editors/space_spreadsheet/spreadsheet_layout.cc
index 33fd7329e6d..db466f8ccf3 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_layout.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_layout.cc
@@ -89,7 +89,7 @@ class SpreadsheetLayoutDrawer : public SpreadsheetDrawer {
return;
}
- const fn::GVArray &data = column.data();
+ const GVArray &data = column.data();
if (data.type().is<int>()) {
const int value = data.get<int>(real_index);
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc b/source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc
index 1fddd751d78..e45317c2a5c 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc
@@ -42,7 +42,7 @@ static void apply_row_filter(const SpreadsheetRowFilter &row_filter,
Vector<int64_t> &new_indices)
{
const ColumnValues &column = *columns.lookup(row_filter.column_name);
- const fn::GVArray &column_data = column.data();
+ const GVArray &column_data = column.data();
if (column_data.type().is<float>()) {
const float value = row_filter.value_float;
switch (row_filter.operation) {