39 : spreadsheet_layout_(spreadsheet_layout)
69 const int real_index = spreadsheet_layout_.
row_indices[row_index];
70 std::string index_str = std::to_string(real_index);
91 const int real_index = spreadsheet_layout_.
row_indices[row_index];
93 if (real_index > column.
size()) {
99 if (data.type().is<
int>()) {
100 const int value = data.
get<
int>(real_index);
101 const std::string value_str = std::to_string(value);
117 [](
bContext * ,
void *argN,
const char * ) {
118 return fmt::format(
TIP_(
"{}"), *((
int *)argN));
120 MEM_cnew<int>(__func__, value),
126 if (data.type().is<
int8_t>()) {
128 const std::string value_str = std::to_string(value);
146 else if (data.type().is<
int2>()) {
147 const int2 value = data.get<
int2>(real_index);
150 else if (data.type().is<
float>()) {
151 const float value = data.get<
float>(real_index);
152 std::stringstream ss;
153 ss << std::fixed << std::setprecision(3) << value;
154 const std::string value_str = ss.str();
170 [](
bContext * ,
void *argN,
const char * ) {
171 return fmt::format(
TIP_(
"{:f}"), *((
float *)argN));
173 MEM_cnew<float>(__func__, value),
179 else if (data.type().is<
bool>()) {
180 const bool value = data.get<
bool>(real_index);
181 const int icon = value ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT;
197 else if (data.type().is<
float2>()) {
201 else if (data.type().is<
float3>()) {
217 else if (data.type().is<
float4x4>()) {
238 else if (data.type().is<std::string>()) {
243 data.get<std::string>(real_index),
255 data.get_to_uninitialized(real_index, prop);
272 [](
bContext * ,
void *argN,
const char * ) {
284 const float segment_width =
float(
params.width) / values.size();
285 for (
const int i : values.index_range()) {
286 std::stringstream ss;
287 const float value = values[i];
288 ss <<
" " << std::fixed << std::setprecision(3) << value;
289 const std::string value_str = ss.str();
295 params.xmin + i * segment_width,
306 [](
bContext * ,
void *argN,
const char * ) {
307 return fmt::format(
TIP_(
"{:f}"), *((
float *)argN));
309 MEM_cnew<float>(__func__, value),
320 const float segment_width =
float(
params.width) / values.size();
321 for (
const int i : values.index_range()) {
322 std::stringstream ss;
323 const int value = values[i];
325 const std::string value_str = ss.str();
331 params.xmin + i * segment_width,
341 [](
bContext * ,
void *argN,
const char * ) {
342 return fmt::format(
TIP_(
"{}"), *((
int *)argN));
344 MEM_cnew<int>(__func__, value),
356 const float segment_width =
float(
params.width) / values.size();
357 for (
const int i : values.index_range()) {
358 std::stringstream ss;
359 const float value = values[i];
360 ss <<
" " << std::fixed << std::setprecision(3) << value;
361 const std::string value_str = ss.str();
367 params.xmin + i * segment_width,
382 [](
bContext * ,
void *argN,
const char * ) {
385 return fmt::format(
TIP_(
"Byte Color (sRGB encoded):\n{} {} {} {}"),
415 [](
bContext * ,
void *argN,
const char * ) {
418 std::stringstream ss;
419 ss << value[0] <<
",\n";
420 ss << value[1] <<
",\n";
421 ss << value[2] <<
",\n";
425 MEM_cnew<float4x4>(__func__, value),
431 return spreadsheet_layout_.
columns[column_index].width;
438 return std::make_unique<SpreadsheetLayoutDrawer>(spreadsheet_layout);
#define POINTER_AS_UINT(i)
#define POINTER_FROM_UINT(i)
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
void UI_but_func_tooltip_set(uiBut *but, uiButToolTipFunc func, void *arg, uiFreeArgFunc free_arg)
void UI_but_drawflag_enable(uiBut *but, int flag)
uiBut * uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
void UI_but_drawflag_disable(uiBut *but, int flag)
void get(int64_t index, void *r_value) const
constexpr bool is_empty() const
const GVArray & data() const
void draw_top_row_cell(int column_index, const CellDrawParams ¶ms) const final
void draw_byte_color(const CellDrawParams ¶ms, const ColorGeometry4b color) const
void draw_left_column_cell(int row_index, const CellDrawParams ¶ms) const final
void draw_int_vector(const CellDrawParams ¶ms, const Span< int > values) const
void draw_content_cell(int row_index, int column_index, const CellDrawParams ¶ms) const final
int column_width(int column_index) const final
void draw_float_vector(const CellDrawParams ¶ms, const Span< float > values) const
void draw_float4x4(const CellDrawParams ¶ms, const float4x4 &value) const
SpreadsheetLayoutDrawer(const SpreadsheetLayout &spreadsheet_layout)
draw_view in_light_buf[] float
void MEM_freeN(void *vmemh)
int get_instance_reference_icon(const bke::InstanceReference &reference)
std::unique_ptr< SpreadsheetDrawer > spreadsheet_drawer_from_layout(const SpreadsheetLayout &spreadsheet_layout)
MatBase< T, NumCol, NumRow > transpose(const MatBase< T, NumRow, NumCol > &mat)
VecBase< float, 4 > float4
Vector< ColumnLayout > columns