Blender V4.5
blender::ed::spreadsheet::ColumnValues Class Referencefinal

#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 GVArraydata () 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_

Detailed Description

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.

Constructor & Destructor Documentation

◆ ColumnValues()

blender::ed::spreadsheet::ColumnValues::ColumnValues ( std::string name,
GVArray data )
inline

Definition at line 27 of file spreadsheet_column_values.hh.

References BLI_assert, data(), data_, name(), and name_.

◆ ~ColumnValues()

virtual blender::ed::spreadsheet::ColumnValues::~ColumnValues ( )
virtualdefault

Member Function Documentation

◆ data()

const GVArray & blender::ed::spreadsheet::ColumnValues::data ( ) const
inline

◆ fit_column_values_width_px()

◆ 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.

Parameters
max_sample_sizeIf 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().

◆ name()

StringRefNull blender::ed::spreadsheet::ColumnValues::name ( ) const
inline

◆ size()

int blender::ed::spreadsheet::ColumnValues::size ( ) const
inline

◆ type()

eSpreadsheetColumnValueType blender::ed::spreadsheet::ColumnValues::type ( ) const
inline

Member Data Documentation

◆ data_

GVArray blender::ed::spreadsheet::ColumnValues::data_
protected

◆ name_

std::string blender::ed::spreadsheet::ColumnValues::name_
protected

Definition at line 22 of file spreadsheet_column_values.hh.

Referenced by ColumnValues(), fit_column_width_px(), and name().


The documentation for this class was generated from the following files: