Compare commits

..

10 commits

Author SHA1 Message Date
silverweed
fe924743ef make off and cur_field_off absolute in Sec_Hover_Fn 2024-09-27 15:40:53 +02:00
silverweed
d3786e4c6d add uncomp test ntuple 2024-09-27 15:35:12 +02:00
silverweed
523099206b update lmext1.root 2024-09-27 15:34:59 +02:00
silverweed
a57f48d5ff fix(?) cluster parsing 2024-09-27 15:09:16 +02:00
silverweed
57bf7675f8 some reordering 2024-09-27 11:54:50 +02:00
silverweed
6468ad1dd7 some fixes to highlight logic 2024-09-27 11:21:19 +02:00
silverweed
331eec77e6 introduce frame() 2024-09-26 14:11:25 +02:00
silverweed
a876064718 fix wrong column_desc 2024-09-26 10:55:28 +02:00
silverweed
cdcf1db83a more stuff 2024-09-25 14:57:06 +02:00
silverweed
c83d457738 some hover fixes 2024-09-25 14:23:28 +02:00
9 changed files with 662 additions and 427 deletions

Binary file not shown.

BIN
lmext1_uncomp.root Normal file

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -213,7 +213,7 @@ void viewer_jump_to_cluster(App_State &app, u64 cluster_idx)
}
internal
void imgui_render_string_tree(Arena *arena, String8_Node *root, u16 indent = 0)
void imgui_render_string_tree(Arena *arena, String8_Node *root, String8_Node *highlighted, u16 indent = 0)
{
String8 indent_str;
if (indent) {
@ -225,10 +225,13 @@ void imgui_render_string_tree(Arena *arena, String8_Node *root, u16 indent = 0)
}
for (String8_Node *node = root; node; node = node->next) {
ImGui::Text("%s%s", indent_str.c(), node->str.c());
if (node == highlighted)
ImGui::TextColored(ImColor(1.0f, 1.0f, 0.0f), "%s%s", indent_str.c(), node->str.c());
else
ImGui::Text("%s%s", indent_str.c(), node->str.c());
if (node->first_child)
imgui_render_string_tree(arena, node->first_child, indent + 2);
imgui_render_string_tree(arena, node->first_child, highlighted, indent + 2);
}
}
@ -397,7 +400,7 @@ void update_and_render(Arena *arena, App_State &app, f32 delta_time_ms)
ImGui::TextColored(ImColor(0.5f, 0.5f, 0.5f), "(Hint: press Alt for single-field hover information)");
if (hovered_section.id == Sec_Page)
ImGui::TextColored(ImColor(0.5f, 0.5f, 0.5f), "(Hint: Shift-Click to jump to the start of this page)");
imgui_render_string_tree(scratch.arena, hover_info.desc->head);
imgui_render_string_tree(scratch.arena, hover_info.desc->head, hover_info.highlighted_desc);
app.viewer.hovered_range = hover_info.rng;
// Shift-clicking on a page section will update the current page in the legend

View file

@ -140,7 +140,7 @@ internal const String8 section_names[Sec_COUNT] = {
str8("None"),
str8("TFile Header"),
str8("TFile Object"),
str8("TFile Info"),
str8("TFile Streamer Info"),
str8("TFile FreeList"),
str8("TKey List"),
str8("RNTuple Anchor"),

View file

@ -26,8 +26,9 @@
#include <cmath>
#include <cstring>
#include <cassert>
#include <inttypes.h> // PRIu64
#include <inttypes.h> // PRIu64, ...
#include <type_traits> // For std::decay_t and std::is_same_v
#include <chrono>
#ifdef DEBUG
@ -45,7 +46,7 @@
#endif // RNT_NO_GFX
#define V_MAJOR "0"
#define V_MINOR "5"
#define V_MINOR "6"
#include "root/root_inc.h"
#include "root/RMicroFileReader.hxx"

View file

@ -1223,11 +1223,8 @@ RMicroFileReader::GetNTupleProper(const char *ntupleName)
// @Incomplete: each section has a differently-sized RBlob, we need to account for that!
RTFString blobName { kBlobClassName };
RTFKey dummy;
// FIXME: it seems that sometimes even if IsBigFile() == false we get a big header size!
if (fileHeader.IsBigFile())
dummy.MakeBigKey();
fileInfo.rblob_key_header_nbytes = dummy.GetHeaderSize() + blobName.GetSize() + 2 * RTFString{}.GetSize();
printf("nbytes: %lu\n", fileInfo.rblob_key_header_nbytes);
dummy.MakeBigKey();
fileInfo.rblob_key_header_nbytes = dummy.fKeyHeaderSize + blobName.GetSize() + 2 * RTFString{}.GetSize();
}
// @----
ReadBuffer(ntuple, objNbytes, offset);

View file

@ -39,37 +39,52 @@ String8 to_pretty_size(Arena *arena, u64 bytes)
}
internal
String8_Node *push_str8_node(Arena *arena, String8_Node *prev, const char *fmt, ...)
String8_Node *push_str8_node_v(Arena *arena, String8_Node *prev, const char *fmt, va_list args)
{
va_list args2;
va_copy(args2, args);
String8_Node *snode = arena_push<String8_Node>(arena);
va_list args;
va_start(args, fmt);
snode->str = push_str8fv(arena, fmt, args);
va_end(args);
snode->str = push_str8fv(arena, fmt, args2);
if (prev) {
prev->next = snode;
snode->head = prev->head;
snode->parent = prev->parent;
} else {
snode->head = snode;
}
snode->prev = prev;
va_end(args2);
return snode;
}
internal
String8_Node *push_str8_node_child(Arena *arena, String8_Node *parent, const char *fmt, ...)
String8_Node *push_str8_node(Arena *arena, String8_Node *prev, const char *fmt, ...)
{
assert(parent);
String8_Node *snode = arena_push<String8_Node>(arena);
va_list args;
va_start(args, fmt);
snode->str = push_str8fv(arena, fmt, args);
String8_Node *snode = push_str8_node_v(arena, prev, fmt, args);
va_end(args);
return snode;
}
internal
String8_Node *push_str8_node_child_v(Arena *arena, String8_Node *parent, const char *fmt, va_list args)
{
va_list args2;
va_copy(args2, args);
if (!parent) {
// If there is no parent, just behave the same as push_str8_node.
String8_Node *snode = push_str8_node_v(arena, nullptr, fmt, args2);
va_end(args2);
return snode;
}
String8_Node *snode = arena_push<String8_Node>(arena);
snode->str = push_str8fv(arena, fmt, args2);
snode->prev = parent->last_child;
if (parent->first_child) {
@ -79,7 +94,19 @@ String8_Node *push_str8_node_child(Arena *arena, String8_Node *parent, const cha
parent->last_child = parent->first_child = snode;
}
snode->head = parent->head;
snode->parent = parent;
va_end(args2);
return snode;
}
internal
String8_Node *push_str8_node_child(Arena *arena, String8_Node *parent, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
String8_Node *snode = push_str8_node_child_v(arena, parent, fmt, args);
va_end(args);
return snode;
}

View file

@ -14,5 +14,6 @@ struct String8 {
struct String8_Node {
String8_Node *next, *prev, *head;
String8_Node *first_child, *last_child;
String8_Node *parent;
String8 str;
};