// File: carlos-urena[P]svg-gen/figures.cpp
// Function: Figure5_EllipseSectorRadial::Figure5_EllipseSectorRadial()
Figure5_EllipseSectorRadial::Figure5_EllipseSectorRadial()
{
  vec3 observador = vec3(0.7,0.5,1.0),
       lookat     = vec3(0.0,0.0,0.0),
       vup        = vec3(0.0,1.0,0.0);

  cam = Camera( lookat, observador, vup );

  // elipse plana tangente (perp. al eje Z, con eje mayor Y y eje menor X)
  const vec3 ejex = vec3(1.0,0.0,0.0),
             ejey = vec3(0.0,1.0,0.0),
             ejez = vec3(0.0,0.0,1.0);

  const int nump = 256 ;
  //Ellipse * pe = new Ellipse( nump, vec3(0.0,0.0,1.0), real(0.6)*ejex, real(1.5)*ejey );
  const real lonx = 0.8 , lony = 3.0 ;

  Ellipse *             pe    = new Ellipse( nump, vec3(0.0,0.0,1.0), lonx*ejex, lony*ejey );
  EllipseSectorRadial * pser  = new EllipseSectorRadial( nump*3, lonx, lony );
  Sphere *              pes2D = new Sphere( vec3(0.0,0.0,0.0), 1.0 );
  SpherePolygon *       pesf  = new SpherePolygon( *pe );
  ZCylinderPolygon *    pcz   = new ZCylinderPolygon( *pe );

  pesf->style.draw_filled = false ;
  pcz->style.draw_filled = false ;

  //
  SpherePolygon *    pseresf  = new SpherePolygon( *(pser->ppol) );
  ZCylinderPolygonWithSector * psercil
       = new ZCylinderPolygonWithSector( *(pser->ppol), pser->alpha0, pser->alpha1, pser->lonX, pser->lonY );

  pseresf->style.draw_filled = true ;
  psercil->style.draw_filled = true ;

  // circunferencia delantera del cilindro
  Ellipse * cd = new Ellipse( nump, vec3(0.0,0.0,1.0), ejex, ejey );
  cd->style.draw_filled = false ;
  cd->style.draw_lines  = true ;
  cd->style.lines_color = vec3(1.0,0.0,0.0);
  cd->style.lines_width = 0.015 ;

  // points, sacados del sector de elipse radial
  Point * ppoint0 = new Point( pser->point0, vec3(0.0,0.7,0.0) ),
        * ppoint1 = new Point( pser->point1, vec3(0.0,0.7,0.0) );

  ppoint0->radius = 0.05 ;
  ppoint1->radius = 0.05 ;

  // segmento verde entre los points:
  Segment * segmv = new Segment( ppoint0->pos3D, ppoint1->pos3D - ppoint0->pos3D,
                                ppoint0->color, 0.025 );

  //añadir objetos
  const int cadacuantos = 4 ;

  objetos.add( new Axes( 0.010 ) );
  objetos.add( new ZAxisCylinder( cam ) );
  objetos.add( pes2D );
  objetos.add( pesf );
  objetos.add( pcz );
  objetos.add( cd );
  objetos.add( pseresf );
  objetos.add( psercil );
  objetos.add( ppoint0 );
  objetos.add( ppoint1 );
  objetos.add( segmv );

  // cilindro

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3b0, %rsp            # imm = 0x3B0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
callq 0x10a70
movl $0x3f333333, -0x18(%rbp) # imm = 0x3F333333
movl $0x3f000000, -0x1c(%rbp) # imm = 0x3F000000
movl $0x3f800000, -0x20(%rbp) # imm = 0x3F800000
leaq -0x14(%rbp), %rdi
leaq -0x18(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
leaq -0x20(%rbp), %rcx
callq 0x8c30
jmp 0x51bb
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
leaq -0x40(%rbp), %rdx
leaq -0x44(%rbp), %rcx
callq 0x8c30
jmp 0x51e7
movl $0x0, -0x54(%rbp)
movl $0x3f800000, -0x58(%rbp) # imm = 0x3F800000
movl $0x0, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x54(%rbp), %rsi
leaq -0x58(%rbp), %rdx
leaq -0x5c(%rbp), %rcx
callq 0x8c30
jmp 0x5213
leaq -0x8c(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x14(%rbp), %rdx
leaq -0x50(%rbp), %rcx
callq 0xa8f0
jmp 0x522d
movq -0x2d0(%rbp), %rax
movups -0x8c(%rbp), %xmm0
movups -0x7c(%rbp), %xmm1
movups -0x6c(%rbp), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movl $0x3f800000, -0x9c(%rbp) # imm = 0x3F800000
movl $0x0, -0xa0(%rbp)
movl $0x0, -0xa4(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0x9c(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
leaq -0xa4(%rbp), %rcx
callq 0x8c30
jmp 0x528f
movl $0x0, -0xb4(%rbp)
movl $0x3f800000, -0xb8(%rbp) # imm = 0x3F800000
movl $0x0, -0xbc(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb4(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
leaq -0xbc(%rbp), %rcx
callq 0x8c30
jmp 0x52d0
movl $0x0, -0xcc(%rbp)
movl $0x0, -0xd0(%rbp)
movl $0x3f800000, -0xd4(%rbp) # imm = 0x3F800000
leaq -0xc8(%rbp), %rdi
leaq -0xcc(%rbp), %rsi
leaq -0xd0(%rbp), %rdx
leaq -0xd4(%rbp), %rcx
callq 0x8c30
jmp 0x5311
movl $0x100, -0xd8(%rbp)     # imm = 0x100
movl $0x3f4ccccd, -0xdc(%rbp) # imm = 0x3F4CCCCD
movl $0x40400000, -0xe0(%rbp) # imm = 0x40400000
movl $0x98, %edi
callq 0x31b0
movq %rax, -0x2d8(%rbp)
jmp 0x5342
movl $0x0, -0xf8(%rbp)
movl $0x0, -0xfc(%rbp)
movl $0x3f800000, -0x100(%rbp) # imm = 0x3F800000
leaq -0xf4(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0xfc(%rbp), %rdx
leaq -0x100(%rbp), %rcx
callq 0x8c30
jmp 0x5383
movss 0x11c8d(%rip), %xmm0    # 0x17018
leaq -0x98(%rbp), %rdi
callq 0x8cf0
movss %xmm1, -0x2f4(%rbp)
movaps %xmm0, -0x2f0(%rbp)
jmp 0x53a8
movss -0x2f4(%rbp), %xmm0
movaps -0x2f0(%rbp), %xmm1
movlpd %xmm1, -0x120(%rbp)
movss %xmm0, -0x118(%rbp)
movl -0x118(%rbp), %eax
movl %eax, -0x108(%rbp)
movq -0x120(%rbp), %rax
movq %rax, -0x110(%rbp)
movss 0x11c33(%rip), %xmm0    # 0x1701c
leaq -0xb0(%rbp), %rdi
callq 0x8cf0
movss %xmm1, -0x314(%rbp)
movaps %xmm0, -0x310(%rbp)
jmp 0x5406
movq -0x2d8(%rbp), %rdi
movss -0x314(%rbp), %xmm0
movaps -0x310(%rbp), %xmm1
movlpd %xmm1, -0x140(%rbp)
movss %xmm0, -0x138(%rbp)
movl -0x138(%rbp), %eax
movl %eax, -0x128(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0x130(%rbp)
movl -0x128(%rbp), %eax
movl %eax, -0x148(%rbp)
movq -0x130(%rbp), %rax
movq %rax, -0x150(%rbp)
movsd -0x150(%rbp), %xmm0
movss -0x148(%rbp), %xmm1
movl $0x100, %esi            # imm = 0x100
leaq -0xf4(%rbp), %rdx
leaq -0x110(%rbp), %rcx
callq 0xcd30
jmp 0x548a
movq -0x2d8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movl $0x78, %edi
callq 0x31b0
movq %rax, -0x320(%rbp)
jmp 0x54ab
movq -0x320(%rbp), %rdi
movl $0x300, %esi            # imm = 0x300
movss 0x11b59(%rip), %xmm0    # 0x17018
movss 0x11b55(%rip), %xmm1    # 0x1701c
callq 0xdb60
jmp 0x54ce
movq -0x320(%rbp), %rax
movq %rax, -0x158(%rbp)
movl $0x38, %edi
callq 0x31b0
movq %rax, -0x328(%rbp)
jmp 0x54ef
movl $0x0, -0x170(%rbp)
movl $0x0, -0x174(%rbp)
movl $0x0, -0x178(%rbp)
leaq -0x16c(%rbp), %rdi
leaq -0x170(%rbp), %rsi
leaq -0x174(%rbp), %rdx
leaq -0x178(%rbp), %rcx
callq 0x8c30
jmp 0x5530
movq -0x328(%rbp), %rdi
leaq -0x16c(%rbp), %rsi
movss 0x11abe(%rip), %xmm0    # 0x17004
callq 0xb960
jmp 0x554d
movq -0x328(%rbp), %rax
movq %rax, -0x160(%rbp)
movl $0x98, %edi
callq 0x31b0
movq %rax, -0x330(%rbp)
jmp 0x556e
movq -0x330(%rbp), %rdi
movq -0xe8(%rbp), %rsi
xorl %edx, %edx
callq 0x11400
jmp 0x5585
movq -0x330(%rbp), %rax
movq %rax, -0x180(%rbp)
movl $0x98, %edi
callq 0x31b0
movq %rax, -0x338(%rbp)
jmp 0x55a6
movq -0x338(%rbp), %rdi
movq -0xe8(%rbp), %rsi
callq 0x12600
jmp 0x55bb
movq -0x338(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x180(%rbp), %rax
movb $0x0, 0x3a(%rax)
movq -0x188(%rbp), %rax
movb $0x0, 0x3a(%rax)
movl $0x98, %edi
callq 0x31b0
movq %rax, -0x340(%rbp)
jmp 0x55f2
movq -0x340(%rbp), %rdi
movq -0x158(%rbp), %rax
movq 0x38(%rax), %rsi
xorl %edx, %edx
callq 0x11400
jmp 0x560d
movq -0x340(%rbp), %rax
movq %rax, -0x190(%rbp)
movl $0x98, %edi
callq 0x31b0
movq %rax, -0x348(%rbp)
jmp 0x562e
movq -0x348(%rbp), %rdi
movq -0x158(%rbp), %rax
movq 0x38(%rax), %rsi
movss 0x50(%rax), %xmm0
movss 0x54(%rax), %xmm1
movss 0x58(%rax), %xmm2
movss 0x5c(%rax), %xmm3
callq 0x12980
jmp 0x565b
movq -0x348(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x190(%rbp), %rax
movb $0x1, 0x3a(%rax)
movq -0x198(%rbp), %rax
movb $0x1, 0x3a(%rax)
movl $0x98, %edi
callq 0x31b0
movq %rax, -0x350(%rbp)
jmp 0x5692
movl $0x0, -0x1b0(%rbp)
movl $0x0, -0x1b4(%rbp)
movl $0x3f800000, -0x1b8(%rbp) # imm = 0x3F800000
leaq -0x1ac(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
leaq -0x1b4(%rbp), %rdx
leaq -0x1b8(%rbp), %rcx
callq 0x8c30
jmp 0x56d3
movq -0x350(%rbp), %rdi
movl -0xa8(%rbp), %eax
movl %eax, -0x1c0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movl -0x1c0(%rbp), %eax
movl %eax, -0x1d0(%rbp)
movq -0x1c8(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movsd -0x1d8(%rbp), %xmm0
movss -0x1d0(%rbp), %xmm1
movl $0x100, %esi            # imm = 0x100
leaq -0x1ac(%rbp), %rdx
leaq -0x98(%rbp), %rcx
callq 0xcd30
jmp 0x5738
movq -0x350(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x1a0(%rbp), %rax
movb $0x0, 0x3a(%rax)
movq -0x1a0(%rbp), %rax
movb $0x1, 0x38(%rax)
movl $0x3f800000, -0x1e8(%rbp) # imm = 0x3F800000
movl $0x0, -0x1ec(%rbp)
movl $0x0, -0x1f0(%rbp)
leaq -0x1e4(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
leaq -0x1ec(%rbp), %rdx
leaq -0x1f0(%rbp), %rcx
callq 0x8c30
jmp 0x579d
movq -0x1a0(%rbp), %rax
movl -0x1dc(%rbp), %ecx
movl %ecx, 0x28(%rax)
movq -0x1e4(%rbp), %rcx
movq %rcx, 0x20(%rax)
movq -0x1a0(%rbp), %rax
movl $0x3c75c28f, 0x3c(%rax) # imm = 0x3C75C28F
movl $0x40, %edi
callq 0x31b0
movq %rax, -0x358(%rbp)
jmp 0x57d9
movq -0x158(%rbp), %rax
movl 0x68(%rax), %ecx
movl %ecx, -0x200(%rbp)
movq 0x60(%rax), %rax
movq %rax, -0x208(%rbp)
movl $0x0, -0x218(%rbp)
movl $0x3f333333, -0x21c(%rbp) # imm = 0x3F333333
movl $0x0, -0x220(%rbp)
leaq -0x214(%rbp), %rdi
leaq -0x218(%rbp), %rsi
leaq -0x21c(%rbp), %rdx
leaq -0x220(%rbp), %rcx
callq 0x8c30
jmp 0x5835
movq -0x358(%rbp), %rdi
movl -0x200(%rbp), %eax
movl %eax, -0x228(%rbp)
movq -0x208(%rbp), %rax
movq %rax, -0x230(%rbp)
movsd -0x230(%rbp), %xmm0
movss -0x228(%rbp), %xmm1
movl -0x20c(%rbp), %eax
movl %eax, -0x238(%rbp)
movq -0x214(%rbp), %rax
movq %rax, -0x240(%rbp)
movsd -0x240(%rbp), %xmm2
movss -0x238(%rbp), %xmm3
callq 0xad10
jmp 0x5897
movq -0x358(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movl $0x40, %edi
callq 0x31b0
movq %rax, -0x360(%rbp)
jmp 0x58b8
movq -0x158(%rbp), %rax
movl 0x74(%rax), %ecx
movl %ecx, -0x250(%rbp)
movq 0x6c(%rax), %rax
movq %rax, -0x258(%rbp)
movl $0x0, -0x268(%rbp)
movl $0x3f333333, -0x26c(%rbp) # imm = 0x3F333333
movl $0x0, -0x270(%rbp)
leaq -0x264(%rbp), %rdi
leaq -0x268(%rbp), %rsi
leaq -0x26c(%rbp), %rdx
leaq -0x270(%rbp), %rcx
callq 0x8c30
jmp 0x5914
movq -0x360(%rbp), %rdi
movl -0x250(%rbp), %eax
movl %eax, -0x278(%rbp)
movq -0x258(%rbp), %rax
movq %rax, -0x280(%rbp)
movsd -0x280(%rbp), %xmm0
movss -0x278(%rbp), %xmm1
movl -0x25c(%rbp), %eax
movl %eax, -0x288(%rbp)
movq -0x264(%rbp), %rax
movq %rax, -0x290(%rbp)
movsd -0x290(%rbp), %xmm2
movss -0x288(%rbp), %xmm3
callq 0xad10
jmp 0x5976
movq -0x360(%rbp), %rax
movq %rax, -0x248(%rbp)
movq -0x1f8(%rbp), %rax
movl $0x3d4ccccd, 0x3c(%rax) # imm = 0x3D4CCCCD
movq -0x248(%rbp), %rax
movl $0x3d4ccccd, 0x3c(%rax) # imm = 0x3D4CCCCD
movl $0x98, %edi
callq 0x31b0
movq %rax, -0x368(%rbp)
jmp 0x59b3
movq -0x1f8(%rbp), %rsi
addq $0x1c, %rsi
movq %rsi, -0x390(%rbp)
movq -0x248(%rbp), %rdi
addq $0x1c, %rdi
callq 0x8d60
movss %xmm1, -0x384(%rbp)
movaps %xmm0, -0x380(%rbp)
jmp 0x59e6
movss -0x384(%rbp), %xmm0
movaps -0x380(%rbp), %xmm1
movlpd %xmm1, -0x2c0(%rbp)
movss %xmm0, -0x2b8(%rbp)
movl -0x2b8(%rbp), %eax
movl %eax, -0x2a8(%rbp)
movq -0x2c0(%rbp), %rax
movq %rax, -0x2b0(%rbp)
leaq -0x2a4(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x8e00
jmp 0x5a34
movq -0x390(%rbp), %rsi
movq -0x368(%rbp), %rdi
movq -0x1f8(%rbp), %rcx
addq $0x28, %rcx
leaq -0x2a4(%rbp), %rdx
movss 0x115b8(%rip), %xmm0    # 0x17014
callq 0xcaa0
jmp 0x5a63
movq -0x2d0(%rbp), %rax
movq -0x368(%rbp), %rcx
movq %rcx, -0x298(%rbp)
movl $0x4, -0x2c4(%rbp)
addq $0x30, %rax
movq %rax, -0x3a0(%rbp)
movl $0x38, %edi
callq 0x31b0
movq %rax, -0x398(%rbp)
jmp 0x5aa0
movq -0x398(%rbp), %rdi
movss 0x11559(%rip), %xmm0    # 0x17008
xorl %esi, %esi
callq 0xebb0
jmp 0x5ab8
movq -0x398(%rbp), %rsi
movq -0x3a0(%rbp), %rdi
callq 0xb660
jmp 0x5acd
movq -0x2d0(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x3b0(%rbp)
movl $0x38, %edi
callq 0x31b0
movq %rax, -0x3a8(%rbp)
jmp 0x5af2
movq -0x2d0(%rbp), %rsi
movq -0x3a8(%rbp), %rdi
callq 0xfdb0
jmp 0x5b07
movq -0x3a8(%rbp), %rsi
movq -0x3b0(%rbp), %rdi
callq 0xb660
jmp 0x5b1c
movq -0x2d0(%rbp), %rdi
addq $0x30, %rdi
movq -0x160(%rbp), %rsi
callq 0xb660
jmp 0x5b35
movq -0x2d0(%rbp), %rdi
addq $0x30, %rdi
movq -0x180(%rbp), %rsi
callq 0xb660
jmp 0x5b4e
movq -0x2d0(%rbp), %rdi
addq $0x30, %rdi
movq -0x188(%rbp), %rsi
callq 0xb660
jmp 0x5b67
movq -0x2d0(%rbp), %rdi
addq $0x30, %rdi
movq -0x1a0(%rbp), %rsi
callq 0xb660
jmp 0x5b80
movq -0x2d0(%rbp), %rdi
addq $0x30, %rdi
movq -0x190(%rbp), %rsi
callq 0xb660
jmp 0x5b99
movq -0x2d0(%rbp), %rdi
addq $0x30, %rdi
movq -0x198(%rbp), %rsi
callq 0xb660
jmp 0x5bb2
movq -0x2d0(%rbp), %rdi
addq $0x30, %rdi
movq -0x1f8(%rbp), %rsi
callq 0xb660
jmp 0x5bcb
movq -0x2d0(%rbp), %rdi
addq $0x30, %rdi
movq -0x248(%rbp), %rsi
callq 0xb660
jmp 0x5be4
movq -0x2d0(%rbp), %rdi
addq $0x30, %rdi
movq -0x298(%rbp), %rsi
callq 0xb660
jmp 0x5bfd
addq $0x3b0, %rsp            # imm = 0x3B0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x5d7f
movq -0x2d8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3190
jmp 0x5d7f
movq -0x320(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3190
jmp 0x5d7f
movq -0x328(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3190
jmp 0x5d7f
movq -0x330(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3190
jmp 0x5d7f
movq -0x338(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3190
jmp 0x5d7f
movq -0x340(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3190
jmp 0x5d7f
movq -0x348(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3190
jmp 0x5d7f
movq -0x350(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3190
jmp 0x5d7f
movq -0x358(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3190
jmp 0x5d7f
movq -0x360(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3190
jmp 0x5d7f
movq -0x368(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3190
jmp 0x5d7f
movq -0x398(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3190
jmp 0x5d7f
movq -0x3a8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3190
movq -0x2d0(%rbp), %rdi
callq 0x8cc0
movq -0x28(%rbp), %rdi
callq 0x3280
nopw %cs:(%rax,%rax)