|
Blender V4.5
|
#include <spreadsheet_column_values.hh>
Public Member Functions | |
| ColumnValues (std::string name, GVArray data) | |
| virtual | ~ColumnValues ()=default |
| eSpreadsheetColumnValueType | type () const |
| StringRefNull | name () const |
| int | size () const |
| const GVArray & | data () const |
| float | fit_column_width_px (const std::optional< int64_t > &max_sample_size=std::nullopt) const |
| float | fit_column_values_width_px (const std::optional< int64_t > &max_sample_size=std::nullopt) const |
Protected Attributes | |
| std::string | name_ |
| GVArray | data_ |
This represents a column in a spreadsheet. It has a name and provides a value for all the cells in the column.
Definition at line 20 of file spreadsheet_column_values.hh.
|
inline |
Definition at line 27 of file spreadsheet_column_values.hh.
References BLI_assert, data(), data_, name(), and name_.
|
virtualdefault |
|
inline |
Definition at line 50 of file spreadsheet_column_values.hh.
References data_.
Referenced by blender::ed::spreadsheet::apply_row_filter(), ColumnValues(), and blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_content_cell().
| float blender::ed::spreadsheet::ColumnValues::fit_column_values_width_px | ( | const std::optional< int64_t > & | max_sample_size = std::nullopt | ) | const |
Same as above, but only takes the values into account (ignoring the name).
Definition at line 465 of file spreadsheet_layout.cc.
References BLF_default(), BLF_size(), data_, blender::ed::spreadsheet::estimate_max_column_width(), SPREADSHEET_VALUE_TYPE_BOOL, SPREADSHEET_VALUE_TYPE_BYTE_COLOR, SPREADSHEET_VALUE_TYPE_COLOR, SPREADSHEET_VALUE_TYPE_FLOAT, SPREADSHEET_VALUE_TYPE_FLOAT2, SPREADSHEET_VALUE_TYPE_FLOAT3, SPREADSHEET_VALUE_TYPE_FLOAT4X4, SPREADSHEET_VALUE_TYPE_INSTANCES, SPREADSHEET_VALUE_TYPE_INT32, SPREADSHEET_VALUE_TYPE_INT32_2D, SPREADSHEET_VALUE_TYPE_INT8, SPREADSHEET_VALUE_TYPE_QUATERNION, SPREADSHEET_VALUE_TYPE_STRING, SPREADSHEET_VALUE_TYPE_UNKNOWN, SPREADSHEET_WIDTH_UNIT, type(), UI_DEFAULT_TEXT_POINTS, UI_ICON_SIZE, UI_SCALE_FAC, and UI_UNIT_X.
Referenced by fit_column_width_px().
| float blender::ed::spreadsheet::ColumnValues::fit_column_width_px | ( | const std::optional< int64_t > & | max_sample_size = std::nullopt | ) | const |
Get a good column width for the column name and values.
| max_sample_size | If provided, only a subset of the column values is looked at to determine the width. This is useful when there are lots of rows to avoid unnecessarily long computations in drawing code. If provided, there is also an enforced minimum width to avoid very narrow columns when the sampled values all happen to be very short. |
Definition at line 602 of file spreadsheet_layout.cc.
References BLF_default(), BLF_size(), BLF_width(), fit_column_values_width_px(), name_, SPREADSHEET_WIDTH_UNIT, UI_DEFAULT_TEXT_POINTS, and UI_SCALE_FAC.
Referenced by blender::ed::spreadsheet::spreadsheet_main_region_draw().
|
inline |
Definition at line 40 of file spreadsheet_column_values.hh.
References name_.
Referenced by ColumnValues(), blender::ed::spreadsheet::spreadsheet_filter_rows(), and blender::ed::spreadsheet::spreadsheet_main_region_draw().
|
inline |
Definition at line 45 of file spreadsheet_column_values.hh.
References data_.
Referenced by blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_content_cell().
|
inline |
Definition at line 35 of file spreadsheet_column_values.hh.
References blender::ed::spreadsheet::cpp_type_to_column_type(), and data_.
Referenced by fit_column_values_width_px(), and blender::ed::spreadsheet::spreadsheet_main_region_draw().
|
protected |
Definition at line 24 of file spreadsheet_column_values.hh.
Referenced by ColumnValues(), data(), fit_column_values_width_px(), size(), and type().
|
protected |
Definition at line 22 of file spreadsheet_column_values.hh.
Referenced by ColumnValues(), fit_column_width_px(), and name().