19 #define GLFW_INCLUDE_GLU 48 throw std::runtime_error(
"Could not open OpenGL window, please check your graphic drivers");
53 int display_w, display_h;
95 f->
AddFiles(std::vector<std::string>(paths, paths + count));
115 auto res =
ImVec4(r / (
float)255, g / (
float)255, b / (
float)255, a / (
float)255);
165 static int selected = 0;
167 for (
int i = 0;
i < files.
size();
i++)
214 label =
"x##" + files[
i].file_name;
221 selected = std::max(0, selected - 1);
233 std::ostringstream oss;
246 std::vector<std::string> messages_types = topic_to_message_type.second;
247 std::ostringstream oss;
248 int max_topic_len = 100;
249 oss <<
std::left << std::setw(max_topic_len) << topic
250 <<
" " <<
std::left << std::setw(10) << messages_types.size() << std::setw(6) <<
std::string(
" msg") + (messages_types.size() > 1 ?
"s" :
"")
251 <<
": " <<
std::left << std::setw(40) << messages_types.front() << std::endl;
259 constexpr
uint64_t num_next_items_to_show = 10;
264 for (
auto&&
m : messages)
278 int left = messages.size() - max;
300 if (topic.size() > max_topic_len)
356 for (
auto&&
m : entire_bag_view)
379 bag_out.
write(
m.getTopic(),
m.getTime(),
m);
383 if (
m.getTopic().find(
"/option/") != std::string::npos)
390 int main(
int argc,
const char** argv)
415 static bool open =
true;
423 if (files.
size() > 0)
432 std::this_thread::sleep_for(std::chrono::milliseconds(10));
442 _In_ HINSTANCE hInstance,
443 _In_ HINSTANCE hPrevInstance,
444 _In_ LPSTR lpCmdLine,
gui_window(const std::string &title, uint32_t width, uint32_t height)
int main(int argc, const char **argv)
GLboolean GLboolean GLboolean b
IMGUI_API ImVec2 GetCursorPos()
GLFWAPI void glfwGetWindowSize(GLFWwindow *window, int *width, int *height)
Retrieves the size of the client area of the specified window.
IMGUI_API bool BeginPopupContextItem(const char *str_id, int mouse_button=1)
std::map< std::string, uint64_t > num_topics_to_show
The header of the GLFW 3 API.
GLFWAPI GLFWglproc glfwGetProcAddress(const char *procname)
Returns the address of the specified function for the current context.
void AddFiles(std::vector< std::string > const &files)
std::string get_last_error()
IMGUI_API void SetCursorPos(const ImVec2 &local_pos)
void *(* GLADloadproc)(const char *name)
static const ImVec4 scrollbar_grab
static GLFWwindow * window
static const ImVec4 almost_white_bg
IMGUI_API void SetWindowPos(const ImVec2 &pos, ImGuiSetCond cond=0)
IMGUI_API void PopTextWrapPos()
void draw_bag_content(rosbag_content &bag, int flags)
std::chrono::nanoseconds file_duration
GLFWAPI void * glfwGetWindowUserPointer(GLFWwindow *window)
Returns the user pointer of the specified window.
static const ImVec4 redish
GLsizei const GLuint * paths
IMGUI_API void EndTooltip()
void ImGui_ImplGlfw_Shutdown()
static const ImVec4 black
int remove_file(int index)
IMGUI_API bool SmallButton(const char *label)
IMGUI_API bool BeginChild(const char *str_id, const ImVec2 &size=ImVec2(0, 0), bool border=false, ImGuiWindowFlags extra_flags=0)
IMGUI_API void BeginTooltip()
rosbag_inspector::compression_info compression_info
GLdouble GLdouble GLdouble w
GLsizei const GLchar *const * string
IMGUI_API void PushTextWrapPos(float wrap_pos_x=0.0f)
ImVec4 from_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a, bool consistent_color=false)
static const ImVec4 scrollbar_bg
static const ImVec4 sensor_header_light_blue
static const ImVec4 button_color
void sort(sort_type m_sort_type, const std::string &in, const std::string &out)
static const ImVec4 device_info_color
IMGUI_API bool BeginMenuBar()
GLboolean GLboolean GLboolean GLboolean a
static const ImVec4 light_blue
static const ImVec4 header_window_bg
IMGUI_API void SameLine(float pos_x=0.0f, float spacing_w=-1.0f)
GLFWAPI int glfwInit(void)
Initializes the GLFW library.
int draw_files_left_panel(int flags)
GLFWAPI void glfwSetWindowUserPointer(GLFWwindow *window, void *pointer)
Sets the user pointer of the specified window.
IMGUI_API bool Begin(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
IMGUI_API bool CollapsingHeader(const char *label, ImGuiTreeNodeFlags flags=0)
#define GL_COLOR_BUFFER_BIT
IMGUI_API void TextUnformatted(const char *text, const char *text_end=NULL)
bool ImGui_ImplGlfw_Init(GLFWwindow *window, bool install_callbacks)
IMGUI_API ImGuiIO & GetIO()
static const ImVec4 white
GLint GLsizei GLsizei height
IMGUI_API void SetNextWindowSize(const ImVec2 &size, ImGuiSetCond cond=0)
GLFWAPI void glfwSwapBuffers(GLFWwindow *window)
Swaps the front and back buffers of the specified window.
GLFWAPI void glfwMakeContextCurrent(GLFWwindow *window)
Makes the context of the specified window current for the calling thread.
static const ImVec4 regular_blue
void write(std::string const &topic, rs2rosinternal::MessageEvent< T > const &event)
Write a message into the bag file.
unsigned __int64 uint64_t
IMGUI_API void SetCursorPosX(float x)
IMGUI_API void Text(const char *fmt,...) IM_PRINTFARGS(1)
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0))
const char * file_dialog_open(file_dialog_mode flags, const char *filters, const char *default_path, const char *default_name)
IMGUI_API void Separator()
std::string compression_type
int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow)
static const ImVec4 header_color
static const ImVec4 dark_red
IMGUI_API void EndPopup()
GLAPI int gladLoadGLLoader(GLADloadproc)
IMGUI_API void NextColumn()
IMGUI_API void PushStyleColor(ImGuiCol idx, const ImVec4 &col)
std::chrono::duration< uint64_t, std::nano > nanoseconds
static const ImVec4 yellow
IMGUI_API void EndChild()
IMGUI_API bool BeginMenu(const char *label, bool enabled=true)
GLFWAPI GLFWwindow * glfwCreateWindow(int width, int height, const char *title, GLFWmonitor *monitor, GLFWwindow *share)
Creates a window and its associated context.
void next(auto_any_t cur, type2type< T, C > *)
void ImGui_ImplGlfw_NewFrame(float scale_factor)
GLint GLint GLint yoffset
ROSTIME_DECL const Time TIME_MIN
GLuint GLsizei const GLchar * label
GLFWAPI void glfwGetFramebufferSize(GLFWwindow *window, int *width, int *height)
Retrieves the size of the framebuffer of the specified window.
IMGUI_API bool MenuItem(const char *label, const char *shortcut=NULL, bool selected=false, bool enabled=true)
GLFWAPI void glfwTerminate(void)
Terminates the GLFW library.
static const ImVec4 transparent
IMGUI_API bool BeginPopupModal(const char *name, bool *p_open=NULL, ImGuiWindowFlags extra_flags=0)
std::string pretty_time(std::chrono::nanoseconds d)
IMGUI_API bool Selectable(const char *label, bool selected=false, ImGuiSelectableFlags flags=0, const ImVec2 &size=ImVec2(0, 0))
static const ImVec4 dark_window_background
GLFWAPI void glfwPollEvents(void)
Processes all pending events.
std::map< std::string, std::vector< std::string > > topics_to_message_types
static const ImVec4 light_grey
IMGUI_API void EndMenuBar()
static const ImVec4 sensor_bg
IMGUI_API ImVec2 GetWindowPos()
IMGUI_API ImGuiStyle & GetStyle()
IMGUI_API void CloseCurrentPopup()
static const ImVec4 dark_grey
IMGUI_API void OpenPopup(const char *str_id)
static const ImVec4 title_color
IMGUI_API void TextWrapped(const char *fmt,...) IM_PRINTFARGS(1)
IMGUI_API void Columns(int count=1, const char *id=NULL, bool border=true)
IMGUI_API bool IsItemHovered()
struct GLFWwindow GLFWwindow
std::string instanciate_and_cache(const rosbag::MessageInstance &m, uint64_t count)
IMGUI_API void PopStyleColor(int count=1)
GLFWAPI int glfwWindowShouldClose(GLFWwindow *window)
Checks the close flag of the specified window.