// File: /workspace/github_cpp_makefile_star2_O3/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 0x187225(%rip), %rax    # 0x1b3ae0
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
leaq 0x10(%rdi), %rbx
movq %rbx, %rdi
callq 0x411ac
leaq 0x78(%r12), %r14
movq %r14, %rdi
movq %rbx, 0x20(%rsp)
callq 0x78524
leaq 0x120(%r12), %r15
movsd 0x10ba44(%rip), %xmm0   # 0x138338
movsd 0x10ba44(%rip), %xmm3   # 0x138340
movq %r15, %rdi
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
movaps %xmm3, %xmm4
movaps %xmm3, %xmm5
movq %r14, 0x18(%rsp)
callq 0xad364
leaq 0x158(%r12), %rdi
movsd 0x10ba13(%rip), %xmm0   # 0x138338
movsd 0x10ba13(%rip), %xmm1   # 0x138340
movq %r15, 0x10(%rsp)
callq 0xe76ca
leaq 0x168(%r12), %r13
movq %r13, %rdi
callq 0xa9de0
leaq 0x2b0(%r12), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %r13, 0x8(%rsp)
callq 0xc3d32
xorps %xmm0, %xmm0
movups %xmm0, 0x2c8(%r12)
movaps 0x10badb(%rip), %xmm1   # 0x138450
movups %xmm1, 0x2d8(%r12)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x2e8(%r12)
movaps 0x10bac9(%rip), %xmm1   # 0x138460
movups %xmm1, 0x2f0(%r12)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x300(%r12)
movups %xmm0, 0x308(%r12)
movups %xmm0, 0x314(%r12)
movaps 0x10baa5(%rip), %xmm1   # 0x138470
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 0x10b5e7(%rip), %xmm1   # 0x138008
xorps %xmm0, %xmm0
xorps %xmm2, %xmm2
callq 0xe54f8
leaq 0x380(%r12), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0xe54f8
leaq 0x398(%r12), %rdi
movsd 0x10b5b6(%rip), %xmm1   # 0x138008
xorps %xmm0, %xmm0
movaps %xmm1, %xmm2
callq 0xe54f8
leaq 0x3b0(%r12), %rdi
movsd 0x10b8db(%rip), %xmm0   # 0x138348
xorps %xmm1, %xmm1
movaps %xmm0, %xmm2
callq 0xe54f8
leaq 0x3c8(%r12), %rdi
movsd 0x10b580(%rip), %xmm1   # 0x138008
xorps %xmm0, %xmm0
movaps %xmm1, %xmm2
callq 0xe54f8
leaq 0x3e0(%r12), %rdi
movsd 0x10b565(%rip), %xmm2   # 0x138008
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0xe54f8
leaq 0x3f8(%r12), %rdi
movsd 0x10b54a(%rip), %xmm1   # 0x138008
xorps %xmm0, %xmm0
xorps %xmm2, %xmm2
callq 0xe54f8
leaq 0x410(%r12), %rdi
movsd 0x10b52f(%rip), %xmm1   # 0x138008
xorps %xmm0, %xmm0
movaps %xmm1, %xmm2
callq 0xe54f8
leaq 0x428(%r12), %rdi
movsd 0x10b514(%rip), %xmm1   # 0x138008
xorps %xmm0, %xmm0
movaps %xmm1, %xmm2
callq 0xe54f8
leaq 0x440(%r12), %rdi
movsd 0x10b501(%rip), %xmm2   # 0x138010
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0xe54f8
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 0x10b925(%rip), %xmm0   # 0x138480
movups %xmm0, 0x48c(%r12)
movq %rax, 0x4bc(%r12)
movl %eax, 0x4c4(%r12)
leaq 0x4c8(%r12), %r14
movq %r14, %rdi
callq 0xe50e8
leaq 0x4d8(%r12), %r15
movq %r15, %rdi
callq 0xe50e8
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 0xcc6a4
leaq 0x5c8(%r12), %r13
movq %r13, %rdi
callq 0xdea78
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 0x28020
movq %r15, %rdi
xorl %esi, %esi
callq 0x28020
testq %rbp, %rbp
je 0x2cc44
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 0xdeff4
jmp 0x2cc63
movq %rax, %rbp
movq %rbx, %rdi
callq 0xcd2d8
jmp 0x2cc84
movq %rax, %rbp
jmp 0x2cca1
movq %rax, %rbp
jmp 0x2ccb5
movq %rax, %rbp
jmp 0x2ccbf
movq %rax, %rbp
jmp 0x2ccab
movq %rax, %rbp
movq 0x340(%r12), %rdi
testq %rdi, %rdi
je 0x2cca1
movq 0x350(%r12), %rsi
subq %rdi, %rsi
callq 0x27930
movq 0x8(%rsp), %rdi
callq 0xae0e4
movq 0x10(%rsp), %rdi
callq 0xae0e4
movq 0x18(%rsp), %rdi
callq 0x785f8
movq 0x20(%rsp), %rdi
callq 0x412c0
movq %rbp, %rdi
callq 0x28120
nop