// File: tomfunkhouser[P]gaps/pkgs/R3Utils/R3SurfelViewer.cpp
// Function: gaps::R3SurfelViewer::DrawObjectProperties(int) const
void R3SurfelViewer::
DrawObjectProperties(int property_type) const
{
  // Check stuff
  if (!scene) return;
  
  // Draw object properties
  for (int i = 0; i < scene->NObjectProperties(); i++) {
    R3SurfelObjectProperty *property = scene->ObjectProperty(i);
    if (property->Type() != property_type) continue;
    R3SurfelObject *object = property->Object();
    if (!object->Parent()) continue;
    if (object->Parent() != scene->RootObject()) continue;
    if (!ObjectVisibility(object)) continue;
    if (!object->HasSurfels(TRUE)) continue;
    if ((surfel_color_scheme == R3_SURFEL_VIEWER_COLOR_BY_OBJECT) ||
        (surfel_color_scheme == R3_SURFEL_VIEWER_COLOR_BY_CURRENT_LABEL) ||
        (surfel_color_scheme == R3_SURFEL_VIEWER_COLOR_BY_OBJECT_ATTRIBUTES)) {
      unsigned char color[3];
      CreateColor(color, surfel_color_scheme, NULL, NULL, NULL, object, NULL);
      color[0] += 0.5 * (255 - color[0]);
      color[1] += 0.5 * (255 - color[1]);
      color[2] += 0.5 * (255 - color[2]);
      RNLoadRgb(color);
    }
    property->Draw(0);
  }
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movl %esi, 0x5c(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x8(%rax)
jne 0x34123
jmp 0x34324
movl $0x0, 0x58(%rsp)
movq 0x30(%rsp), %rax
movl 0x58(%rsp), %ecx
movl %ecx, 0x2c(%rsp)
movq 0x8(%rax), %rdi
callq 0x2f7c0
movl %eax, %ecx
movl 0x2c(%rsp), %eax
cmpl %ecx, %eax
jge 0x34324
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
movl 0x58(%rsp), %esi
callq 0x3e110
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
callq 0x3e140
cmpl 0x5c(%rsp), %eax
je 0x3417b
jmp 0x34314
movq 0x50(%rsp), %rdi
callq 0x3e150
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
callq 0x3d2e0
cmpq $0x0, %rax
jne 0x3419f
jmp 0x34314
movq 0x48(%rsp), %rdi
callq 0x3d2e0
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x20(%rsp)
movq 0x8(%rax), %rdi
callq 0x3d2f0
movq %rax, %rcx
movq 0x20(%rsp), %rax
cmpq %rcx, %rax
je 0x341d1
jmp 0x34314
movq 0x30(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x30280
cmpl $0x0, %eax
jne 0x341ea
jmp 0x34314
movq 0x48(%rsp), %rdi
movl $0x1, %esi
callq 0x65f30
cmpl $0x0, %eax
jne 0x34203
jmp 0x34314
movq 0x30(%rsp), %rax
cmpl $0x5, 0x360(%rax)
je 0x34231
movq 0x30(%rsp), %rax
cmpl $0x8, 0x360(%rax)
je 0x34231
movq 0x30(%rsp), %rax
cmpl $0xd, 0x360(%rax)
jne 0x342ec
movq 0x30(%rsp), %rdi
movl 0x360(%rdi), %edx
movq 0x48(%rsp), %rsi
movq (%rdi), %rax
movq 0x210(%rax), %rax
movq %rsp, %rcx
movq %rsi, (%rcx)
movq $0x0, 0x8(%rcx)
xorl %ecx, %ecx
movl %ecx, %r9d
leaq 0x45(%rsp), %rsi
movq %r9, %rcx
movq %r9, %r8
callq *%rax
movzbl 0x45(%rsp), %eax
movl %eax, %ecx
xorl $0xff, %ecx
cvtsi2sd %ecx, %xmm0
cvtsi2sd %eax, %xmm1
movsd 0x20cdb0(%rip), %xmm2   # 0x241038
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, 0x45(%rsp)
movzbl 0x46(%rsp), %eax
movl %eax, %ecx
xorl $0xff, %ecx
cvtsi2sd %ecx, %xmm0
cvtsi2sd %eax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, 0x46(%rsp)
movzbl 0x47(%rsp), %eax
movl %eax, %ecx
xorl $0xff, %ecx
cvtsi2sd %ecx, %xmm0
cvtsi2sd %eax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, 0x47(%rsp)
leaq 0x45(%rsp), %rdi
callq 0x3d7c0
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x38(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2f310
movq 0x18(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq (%rdi), %rax
callq *0x10(%rax)
movl 0x58(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58(%rsp)
jmp 0x3412b
addq $0x68, %rsp
retq
nopl (%rax)