Blender V5.0
blender::ed::spreadsheet::ColumnValues Class Referencefinal

#include <spreadsheet_column_values.hh>

Public Member Functions

 ColumnValues (std::string name, GVArray data, const ColumnValueDisplayHint display_hint=ColumnValueDisplayHint::None)
virtual ~ColumnValues ()=default
eSpreadsheetColumnValueType type () const
StringRefNull name () const
int size () const
const GVArraydata () const
ColumnValueDisplayHint display_hint () 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_
ColumnValueDisplayHint display_hint_

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 25 of file spreadsheet_column_values.hh.

Constructor & Destructor Documentation

◆ ColumnValues()

blender::ed::spreadsheet::ColumnValues::ColumnValues ( std::string name,
GVArray data,
const ColumnValueDisplayHint display_hint = ColumnValueDisplayHint::None )
inline

◆ ~ColumnValues()

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

Member Function Documentation

◆ data()

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

◆ display_hint()

ColumnValueDisplayHint blender::ed::spreadsheet::ColumnValues::display_hint ( ) 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 are inspected 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 742 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

◆ display_hint_

ColumnValueDisplayHint blender::ed::spreadsheet::ColumnValues::display_hint_
protected

Definition at line 30 of file spreadsheet_column_values.hh.

Referenced by ColumnValues(), and display_hint().

◆ name_

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

Definition at line 27 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: