Blender V5.3
spreadsheet_column_values.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 "DNA_space_types.h"
8
10#include "BLI_string_ref.hh"
11
13
15
17 None,
19};
20
26 protected:
27 std::string name_;
28 std::string description_;
29
32
33 public:
34 ColumnValues(std::string name,
36 std::string description = "",
38 : name_(std::move(name)),
39 description_(std::move(description)),
40 data_(std::move(data)),
42 {
43 /* The array should not be empty. */
45 }
46
47 virtual ~ColumnValues() = default;
48
53
55 {
56 return name_;
57 }
58
60 {
61 return description_;
62 }
63
64 int size() const
65 {
66 return data_.size();
67 }
68
69 const GVArray &data() const
70 {
71 return data_;
72 }
73
78
87 float fit_column_width_px(const std::optional<int64_t> &max_sample_size = std::nullopt) const;
88
91 const std::optional<int64_t> &max_sample_size = std::nullopt) const;
92};
93
94} // namespace blender::ed::spreadsheet
#define final(a, b, c)
Definition BLI_hash_c.hh:21
eSpreadsheetColumnValueType type() const
float fit_column_values_width_px(const std::optional< int64_t > &max_sample_size=std::nullopt) const
float fit_column_width_px(const std::optional< int64_t > &max_sample_size=std::nullopt) const
ColumnValues(std::string name, GVArray data, std::string description="", const ColumnValueDisplayHint display_hint=ColumnValueDisplayHint::None)
eSpreadsheetColumnValueType cpp_type_to_column_type(const CPPType &type)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)