// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3SurfelViewer.cpp
// Function: gaps::R3SurfelViewer::R3SurfelViewer(gaps::R3SurfelScene*)
R3SurfelViewer::
R3SurfelViewer(R3SurfelScene *scene)
  : scene(NULL),
    resident_nodes(),
    viewer(),
    viewing_extent(FLT_MAX, FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX, -FLT_MAX),
    elevation_range(FLT_MAX, -FLT_MAX),
    viewing_frustum(),
    center_point(0,0,0),
    selected_point(NULL),
    selected_image(NULL),
    image_inset_size(0.2),
    image_plane_depth(2),
    surfel_size(2),
    surfel_visibility(1),
    normal_visibility(0),
    backfacing_visibility(1),
    aerial_visibility(1),
    terrestrial_visibility(1),
    human_labeled_object_visibility(1),
    object_principal_axes_visibility(0),
    object_oriented_bbox_visibility(0),
    object_relationship_visibility(0),
    object_bbox_visibility(0),
    node_bbox_visibility(0),
    block_bbox_visibility(0),
    scan_viewpoint_visibility(0),
    image_viewpoint_visibility(1),
    image_plane_visibility(0),
    image_inset_visibility(1),
    image_points_visibility(0),
    center_point_visibility(0),
    viewing_extent_visibility(1),
    axes_visibility(0),
    label_visibilities(),
    attribute_visibility_flags(0xFFFFFFFF),
    surfel_color_scheme(R3_SURFEL_VIEWER_COLOR_BY_RGB),
    normal_color(0,1,0),
    background_color(0,0,0),
    object_principal_axes_color(0,1,1),
    object_oriented_bbox_color(0.75,0.0,0.75),
    object_bbox_color(0,1,1),
    node_bbox_color(0,0,1),
    block_bbox_color(0,1,0),
    scan_viewpoint_color(0,1,1),
    image_viewpoint_color(0,1,1),
    center_point_color(0,0,0.5),
    shape_draw_flags(0),
    adapt_working_set_automatically(0),
    target_resolution(100),
    last_target_resolution(0),
    focus_radius(0),
    last_focus_radius(0),
    adapt_subsampling_automatically(0),
    subsampling_factor(1),
    subsampling_multiplier_when_mouse_down(1),
    window_height(0),
    window_width(0),
    shift_down(0),
    ctrl_down(0),
    alt_down(0),
    start_timer(),
    frame_timer(),
    frame_time(-1),
    screenshot_name(NULL),
    ground_z_grid(),
    selected_image_color_pixels(),
    previous_color_image(NULL),
    selected_image_texture_id(0),
    previous_texture_image(NULL),
    vbo_position_buffer(0),
    vbo_normal_buffer(0),
    vbo_color_buffer(0),
    vbo_nsurfels(0),
    shader_program(0),
    vertex_shader(0),
    fragment_shader(0)
{
  // Initialize mouse button state
  mouse_button[0] = 0;
  mouse_button[1] = 0;
  mouse_button[2] = 0;

  // Initialize mouse positions
  mouse_position[0] = 0;
  mouse_position[1] = 0;

  // Initialize mouse positions
  mouse_down_position[0] = 0;
  mouse_down_position[1] = 0;

  // Initialize mouse drag distance
  mouse_drag_distance_squared = 0;

  // Initialize timers
  start_timer.Read();
  frame_timer.Read();

  // Set the scene
  if (scene) SetScene(scene);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbp
movq %rdi, %r12
leaq 0x18a151(%rip), %rax    # 0x1b6ae0
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
leaq 0x10(%rdi), %rbx
movq %rbx, %rdi
callq 0x41110
leaq 0x78(%r12), %r14
movq %r14, %rdi
movq %rbx, 0x20(%rsp)
callq 0x78d38
leaq 0x120(%r12), %r15
movsd 0x10e970(%rip), %xmm0   # 0x13b338
movsd 0x10e970(%rip), %xmm3   # 0x13b340
movq %r15, %rdi
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
movaps %xmm3, %xmm4
movaps %xmm3, %xmm5
movq %r14, 0x18(%rsp)
callq 0xae5c8
leaq 0x158(%r12), %rdi
movsd 0x10e93f(%rip), %xmm0   # 0x13b338
movsd 0x10e93f(%rip), %xmm1   # 0x13b340
movq %r15, 0x10(%rsp)
callq 0xe916e
leaq 0x168(%r12), %r13
movq %r13, %rdi
callq 0xab008
leaq 0x2b0(%r12), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %r13, 0x8(%rsp)
callq 0xc531e
xorps %xmm0, %xmm0
movups %xmm0, 0x2c8(%r12)
movaps 0x10ea07(%rip), %xmm1   # 0x13b450
movups %xmm1, 0x2d8(%r12)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x2e8(%r12)
movaps 0x10e9f5(%rip), %xmm1   # 0x13b460
movups %xmm1, 0x2f0(%r12)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x300(%r12)
movups %xmm0, 0x308(%r12)
movups %xmm0, 0x314(%r12)
movaps 0x10e9d1(%rip), %xmm1   # 0x13b470
movups %xmm1, 0x324(%r12)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x334(%r12)
movups %xmm0, 0x33c(%r12)
movups %xmm0, 0x348(%r12)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x358(%r12)
movl $0x0, 0x360(%r12)
leaq 0x368(%r12), %rdi
movsd 0x10e513(%rip), %xmm1   # 0x13b008
xorps %xmm0, %xmm0
xorps %xmm2, %xmm2
callq 0xe6d3c
leaq 0x380(%r12), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0xe6d3c
leaq 0x398(%r12), %rdi
movsd 0x10e4e2(%rip), %xmm1   # 0x13b008
xorps %xmm0, %xmm0
movaps %xmm1, %xmm2
callq 0xe6d3c
leaq 0x3b0(%r12), %rdi
movsd 0x10e807(%rip), %xmm0   # 0x13b348
xorps %xmm1, %xmm1
movaps %xmm0, %xmm2
callq 0xe6d3c
leaq 0x3c8(%r12), %rdi
movsd 0x10e4ac(%rip), %xmm1   # 0x13b008
xorps %xmm0, %xmm0
movaps %xmm1, %xmm2
callq 0xe6d3c
leaq 0x3e0(%r12), %rdi
movsd 0x10e491(%rip), %xmm2   # 0x13b008
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0xe6d3c
leaq 0x3f8(%r12), %rdi
movsd 0x10e476(%rip), %xmm1   # 0x13b008
xorps %xmm0, %xmm0
xorps %xmm2, %xmm2
callq 0xe6d3c
leaq 0x410(%r12), %rdi
movsd 0x10e45b(%rip), %xmm1   # 0x13b008
xorps %xmm0, %xmm0
movaps %xmm1, %xmm2
callq 0xe6d3c
leaq 0x428(%r12), %rdi
movsd 0x10e440(%rip), %xmm1   # 0x13b008
xorps %xmm0, %xmm0
movaps %xmm1, %xmm2
callq 0xe6d3c
leaq 0x440(%r12), %rdi
movsd 0x10e42d(%rip), %xmm2   # 0x13b010
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0xe6d3c
xorl %eax, %eax
movq %rax, 0x458(%r12)
movl %eax, 0x460(%r12)
movabsq $0x4059000000000000, %rcx # imm = 0x4059000000000000
movq %rcx, 0x468(%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x470(%r12)
movups %xmm0, 0x47c(%r12)
movsd 0x10e851(%rip), %xmm0   # 0x13b480
movups %xmm0, 0x48c(%r12)
movq %rax, 0x4bc(%r12)
movl %eax, 0x4c4(%r12)
leaq 0x4c8(%r12), %r14
movq %r14, %rdi
callq 0xe692c
leaq 0x4d8(%r12), %r15
movq %r15, %rdi
callq 0xe692c
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x4e8(%r12)
movq $0x0, 0x4f0(%r12)
leaq 0x4f8(%r12), %rbx
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xcddc8
leaq 0x5c8(%r12), %r13
movq %r13, %rdi
callq 0xe02c8
movq $0x0, 0x5e0(%r12)
xorl %eax, %eax
movl %eax, 0x5e8(%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x49c(%r12)
movups %xmm0, 0x4ac(%r12)
movups %xmm0, 0x5f0(%r12)
movups %xmm0, 0x600(%r12)
movl %eax, 0x610(%r12)
movq %r14, %rdi
xorl %esi, %esi
callq 0x28030
movq %r15, %rdi
xorl %esi, %esi
callq 0x28030
testq %rbp, %rbp
je 0x2cd18
movq (%r12), %rax
movq %r12, %rdi
movq %rbp, %rsi
callq *0x350(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbp
movq %r13, %rdi
callq 0xe0852
jmp 0x2cd37
movq %rax, %rbp
movq %rbx, %rdi
callq 0xce9e8
jmp 0x2cd58
movq %rax, %rbp
jmp 0x2cd75
movq %rax, %rbp
jmp 0x2cd89
movq %rax, %rbp
jmp 0x2cd93
movq %rax, %rbp
jmp 0x2cd7f
movq %rax, %rbp
movq 0x340(%r12), %rdi
testq %rdi, %rdi
je 0x2cd75
movq 0x350(%r12), %rsi
subq %rdi, %rsi
callq 0x27930
movq 0x8(%rsp), %rdi
callq 0xaf380
movq 0x10(%rsp), %rdi
callq 0xaf380
movq 0x18(%rsp), %rdi
callq 0x78e0c
movq 0x20(%rsp), %rdi
callq 0x41224
movq %rbp, %rdi
callq 0x28130
nop